OnPlayerConnect (login/register)
#1

I have an issue with my Script here...

CODE:

pawn Код:
public OnPlayerConnect
{
new playrname[MAX_PLAYER_NAME];
new connect[128];
GetPlayerName(playerid, playrname, sizeof(playrname));
format(connect, sizeof(connect), "%s.cer", playrname);
if(fexist(connect)) //line 108
{
gPlayerAccount[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "You are registered, please login with /login password");
}
return 1; //line 113
}
else //line 115
{
gPlayerAccount[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "You are new here or not registered, please register with /register password");
}
return 1; //line 120
}
ERRORS:

Код:
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(108) : error 010: invalid function or declaration
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(113) : error 010: invalid function or declaration
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(115) : error 010: invalid function or declaration
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(120) : error 010: invalid function or declaration
Thanks in Advance
Reply
#2

Код:
public OnPlayerConnect(playerid)
{
new playrname[MAX_PLAYER_NAME];
new connect[128];
GetPlayerName(playerid, playrname, sizeof(playrname));
format(connect, sizeof(connect), "%s.cer", playrname);
if(fexist(connect)) //line 108
{
gPlayerAccount[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "You are registered, please login with /login password");
}
return 1; //line 113
}
else //line 115
{
gPlayerAccount[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "You are new here or not registered, please register with /register password");
}
return 1; //line 120
}
try this ... you forgot the "(playerid)" after OnPlayerConnect.
The Function dont know, what playerid means, so its for him an invalid declaration
Reply
#3

Oh lol, sorry mate, I just copied the code and wrote that myself.

Basicly... same errors. Help please?
Reply
#4

Hmm ... why do you return 1; Twice? Oo
Reply
#5

LOLZ, Thanks mate. Credits going to you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)