Mistake in some script, can't pinpoint it please help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mistake in some script, can't pinpoint it please help. (
/showthread.php?tid=180401)
Mistake in some script, can't pinpoint it please help. -
Scriptissue - 01.10.2010
So I was working on register and login ,and when the server starts It doesn't show a proper message whether the player is registered or not.
I want it to show if the player has to to register or has to log in:
PHP код:
public OnPlayerConnect(playerid)
{
#pragma tabsize 0
new pfile[256];
new string[64];
RemovePlayerMapIcon( playerid, 12 );
if(dini_Exists(pfile)) { format(string, sizeof(string), "/login [password] ", playername1);
SendClientMessage(playerid, 0xFF4646F, string);
return 1;
}
else if(dini_Exists(pfile)) { format(string, sizeof(string), "/register [password] ", playername1);
SendClientMessage(playerid, 0xFF000000,string); }
return 1;
}
Re: Mistake in some script, can't pinpoint it please help. -
Scriptissue - 01.10.2010
Edited the subject, this is my issue.
Re: Mistake in some script, can't pinpoint it please help. -
kLx - 01.10.2010
you did not define pfile
Re: Mistake in some script, can't pinpoint it please help. -
Scriptissue - 01.10.2010
I did, the whole system works, but only the main notice when you log in doesn't appear.
Re: Mistake in some script, can't pinpoint it please help. -
Mike Garber - 01.10.2010
Quote:
Originally Posted by Scriptissue
I did, the whole system works, but only the main notice when you log in doesn't appear.
|
That is because you didn't define pfile.
You made the variable pfile, but you never defined It.
Re: Mistake in some script, can't pinpoint it please help. -
Scriptissue - 01.10.2010
I just told, I did, at the top of my script. "#define pfile"
It just shows /login [Password] nothing more here is a new script : I can only see /login [password] even though I'm not registered
PHP код:
public OnPlayerConnect(playerid)
{
#pragma tabsize 0
new pfile[256];
new string[64];
RemovePlayerMapIcon( playerid, 12 );
GetPlayerName(playerid, playername1, sizeof(playername1));
if(!fexist(pfile))
{
format(string, sizeof(string), "/login [password] ", playername1);
SendClientMessage(playerid, 0xFF4646F, string);
logged[playerid] = 0;
}
if(fexist(pfile))
{
format(string, sizeof(pfile), "/register [password] ", playername1);
SendClientMessage(playerid, 0xFF000000,string);
logged[playerid] = 1;
}
return 1;
}