Undefined symbol string :-? - 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)
+--- Thread: Undefined symbol string :-? (
/showthread.php?tid=466188)
Undefined symbol string :-? -
radiobizza - 26.09.2013
Error:
PHP код:
gm.pwn(387) : error 017: undefined symbol "string"
Code:
PHP код:
public OnPlayerConnect(playerid)
{
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
}
else
{
gPlayerAccount[playerid] = 0;
}
return 1;
}
Re: Undefined symbol string :-? -
Konstantinos - 26.09.2013
You need to declare it first and even if you do, it's null (empty). You'll need to format it to your needs.
pawn Код:
public OnPlayerConnect(playerid)
{
new
string[ 32 ],
_name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, _name, MAX_PLAYER_NAME );
format( string, sizeof( string ), "THE PATH GOES HERE", _name ); // CHANGE IT.
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
}
else
{
gPlayerAccount[playerid] = 0;
}
return 1;
}
Re: Undefined symbol string :-? -
radiobizza - 26.09.2013
Quote:
Originally Posted by Konstantinos
You need to declare it first and even if you do, it's null (empty). You'll need to format it to your needs.
pawn Код:
public OnPlayerConnect(playerid) { new string[ 32 ], _name[ MAX_PLAYER_NAME ] ; GetPlayerName( playerid, _name, MAX_PLAYER_NAME ); format( string, sizeof( string ), "THE PATH GOES HERE", _name ); // CHANGE IT. if(fexist(string)) { gPlayerAccount[playerid] = 1; } else { gPlayerAccount[playerid] = 0; } return 1; }
|
Thx