Problem with /register and /login - 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: Problem with /register and /login (
/showthread.php?tid=265413)
Problem with /register and /login -
Glorian - 30.06.2011
What's wrong with this code:
Код:
public OnPlayerConnect(playerid)
{
gPlayerLogged[playerid] = 0;
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Khaos Register", "Welcome, You're not registered!, Register to play!", "Register", "Leave");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Khaos Register", "Registered Complete. Now login", "Login", "Leave");
}
}
I get this error:
Код:
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : error 017: undefined symbol "gPlayerLogged"
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : warning 215: expression has no effect
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : error 001: expected token: ";", but found "]"
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : error 029: invalid expression, assumed zero
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
new PlayerInfo[MAX_PLAYERS] [pInfo];
new gPlayerLogged[MAX_PLAYERS];
Re: Problem with /register and /login -
Shadoww5 - 01.07.2011
Put this on top of your GM:
PHP код:
new gPlayerLogged[MAX_PLAYERS];
Or delete this line:
PHP код:
gPlayerLogged[playerid] = 0;