Mistake in some script, can't pinpoint it please help.
#1

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;
    } 
Reply
#2

Edited the subject, this is my issue.
Reply
#3

you did not define pfile
Reply
#4

I did, the whole system works, but only the main notice when you log in doesn't appear.
Reply
#5

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.
Reply
#6

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;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)