SA-MP Forums Archive
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];
   
    
   
RemovePlayerMapIconplayerid12 );
if(
dini_Exists(pfile)) { format(stringsizeof(string), "/login [password] "playername1);
SendClientMessage(playerid0xFF4646Fstring);
return 
1;
}
 else if(
dini_Exists(pfile)) { format(stringsizeof(string), "/register [password] "playername1);
  
SendClientMessage(playerid0xFF000000,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];
    
   
RemovePlayerMapIconplayerid12 );
GetPlayerName(playeridplayername1sizeof(playername1));
if(!
fexist(pfile))
    {
  
format(stringsizeof(string), "/login [password] "playername1);
SendClientMessage(playerid0xFF4646Fstring);
logged[playerid] = 0;
 }
 if(
fexist(pfile))
 {
 
format(stringsizeof(pfile), "/register [password] "playername1);
  
SendClientMessage(playerid0xFF000000,string);
  
logged[playerid] = 1;
  }
        return 
1;
    }