SFSF

CreonSniper said:
CreonSniper said:
i don't know how to use Pawno and Filter scripts for SA-MP.

LOL i don't know how as i stated above.
Okay, if you don't know how to script, why would you be interested?

P.S: Mave, can you unban me from the SA:FE SFSF forum?
 
I totaly agree with Andre. cmg4life wanted to make the script more stable, but he is doing the opposite of it:
http://themavesite.com/sfsf-forum/index.php?topic=816.0
http://themavesite.com/sfsf-forum/index.php?topic=837.0
http://themavesite.com/sfsf-forum/index.php?topic=840.0
These bugs are fixed, but you can see his scripting skills... And its only a question of time when the next bug comes. And then there will be a fifth fix to fix the fourth fix to fix the second fix, which should have fixed the first fix to fix the bug..
I don't say that cmg4life is a bad person, he is a good person, but I only say that he isn't the right scripter for sfsf, even if he is only a "temp" scripter.

Andre would be perfect for sfsf.

@CreonSniper: Are you saying "yes" to every offer?? Even if you are unable to do the job??
 
I discussed with Mave.
I'll get started tonight / tomorrow, when cmg4life gets "kicked" out.

When I receive the gamemode I expect to see a lot of pname[200]'s and str1[256], str2[256], str3[256].
But I didn't just "sit" last night, but I coded a registration system with following commands:
/register <password> <email>
/login <password>
/changepass <old password> <new password>
/changename <password> <new name>

They're all safe and logged into the MySQL aswell, so they could be viewed from player page in PHP.
With SFSF.net, we'll make it rock with Mave.

P.S - Remis, do you know PHP? I have some issues with the sessions.
 
Yeah I already read some books about PHP, including sessions. And Iam practising PHP every day, since several months.
So I could help you with it
 
Remis said:
Yeah I already read some books about PHP, including sessions. And Iam practising PHP every day, since several months.
So I could help you with it

Ok, so...
I started recoding my PHP panel. Before it used several pages, but now I wish to use $_GET to arrange the pages.
So banlist.php would become index.php?area=banlist. Alright, I can work the $_GET and I know how to, but I have a problem with the session starting.

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\panel\index.php:1) in C:\xampp\htdocs\panel\index.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\panel\index.php:1) in C:\xampp\htdocs\panel\index.php on line 2

I Google'd it up and I found that session_start() must be the first line of the script without whitespace, so I tried several things, such as:
Code:
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...
...
Code:
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...
...

But still, I get the same 2 errors described before.
What's other to do with sessions is that I use:
Code:
if(session_is_registered("myusername"))
Code:
session_register("myusername");
and bunch of $_SESSION["thing"] operators.

Also, when I do the login, I do like this:
Code:
<?php
if($area == "login")
{
session_register("myusername");
$_POST["myusername"] = $username;
$_POST["mypassword"] = $password;
					
if(!isset($_POST["myusername"]))
{
    $_SESSION["loginerror"] = 'myusername_not_entered';
    header("Location: index.php", false);
}
if(!isset($_POST["mypassword"]))
{
    $_SESSION["loginerror"] = 'mypassword_not_entered';
    header("Location: index.php", false);
}
if(empty($username))
{
    $_SESSION["loginerror"] = 'username_empty';
    header("Location: index.php", false);
}
if(empty($password))
{
    $_SESSION["loginerror"] = 'password_empty';
    header("Location: index.php", false);					
}
$search = mysql_query("SELECT * FROM `players` WHERE `playername` = '$username'");
if(mysql_num_rows($search) == 0)
{
    $_SESSION["loginerror"] = 'account_not_found';
    header("Location: index.php", false);
}
if(mysql_num_rows($search) > 1)
{
    $_SESSION["loginerror"] = 'really_fucked_up';
    header("Location: index.php", false);
}
$row = mysql_fetch_array($search);
if($row["password"] != $password)
{
    $_SESSION["loginerror"] = 'password_wrong';
    header("Location: index.php", false);
}					
$_SESSION["loginerror"] = 'none';
$_SESSION["logged"] = 1;
$_SESSION["username"] = $username;
header("Location: index.php", false);
}
?>
However I get error about the headers already being sent.
So how the **** can I send it from ?area=login to ?area=index with the session shit saved?
I mean the f**king headers are already set, so how?

I don't know where the fuck did those fucking errors jump out from.
 
Sorry, but the script is a mess. I suggest to return to the several php files, instead the $_GET thing, to have clear code.

$_SESSION["loginerror"]
Why do you need it in the session array?

header("Location: index.php", false);
What is the point of this? You dont need it


I found that session_start() must be the first line of the script without whitespace
Thats wrong.
session_start() has to be anywhere before <html>.
Example:
Code:
<?php
session_start();
?>
<html>
<body>
<?
php stuff..
?>
</body>
</html>

Can you post the index.php? The file with the form stuff?
 
Remis said:
$_SESSION["loginerror"]
Why do you need it in the session array?
Because I want to pass the string using $_SESSION to other parts of the script?

Remis said:
header("Location: index.php", false);
What is the point of this? You dont need it
I do need to redirect, or what? I don't know how to redirect it there then?

Remis said:
I found that session_start() must be the first line of the script without whitespace
Thats wrong.
session_start() has to be anywhere before <html>.
Example:
Code:
<?php
session_start();
?>
<html>
<body>
<?
php stuff..
?>
</body>
</html>
Wrong. There can't be any output before <?php. Just got a reply on one forum, yet nothing else helpful.

I will PM you the link to the file.
 
I would reconstructure that code. The whole script could be done in less lines with better structure.

Things like that are very bad:
Code:
					$_POST["myusername"] = $username;
					$_POST["mypassword"] = $password;
 
I read all the post and I didn't understand if we bring back old SFSF with same maps and scripts or do we open a new server called SFSF?

I don't know anything about scripting so I can't say anything about Andres and Remises chat... If the cmds which Andre said he made work then it kicks ass. Very useful cmds :wink:

If it will be a new server with old name then heres a suggestion:
Make it a RP/stunt server. RP/stunt is a server where you can stunt freely with godmode. You can drive any vehicle and you don't have to repair it or anything like that. The RP part of it is that there are rankings for stunting/racing/answering questions/DMs... There is a huge scoreboard for all of the event points in total and smallers ones for each event.

How to make a stunt event for tricks?
It could be an admin command which would be useable when there are 5 admins online. People would line up in a speacial map and get bout 5 mins practice time. When the event starts people will start stunting 1 by 1(those who are waiting can play regular map) and admins will rate em(admins have an overview spec of the spot like the old cmds /cam1, /cam2). For each event you get points, money, score. When you reach an amount of points you can exchange em for new fancy cmds. (Not sure if the last one is possible.. It should be when you totally script the whole system from 0) Each teleport and fancy cmd should cost some money to do every time. Score goes to scoretable.

I have posted something like that before, but i find that this post has more details. Hope you like the idea :wink:
 
WOW, somehow i feel like this is Futurama and we're bringing back New York City, BTW if you

haven't seen futurama, your weird... watch it at Watch-Futurama.net, BTW stop load before

"Your required to visit a ad to watch this page" Shows up.
 
You're the master of going off-topic

//

Just to let you know, SF-SF Development is doing GREAT
 
Back
Top Bottom