Undefined Symbo - 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 Symbo (
/showthread.php?tid=433661)
Undefined Symbo -
mahdi499 - 28.04.2013
So im working on my TDM Script,i've got stuck at this point,the ZCMD include is included and in my files, but i still get this error
Код:
CMD:stats(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new line1[128];
format(line1, sizeof(line1), "Cash:[%d] Admin:[%d] Team:[%d] Kills:[%d] Deaths:[%d]", GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
SendClientMessage(playerid, COLOR_WHITE, line1);
}
return 1;
}
Re: Undefined Symbo -
RenSoprano - 28.04.2013
Can you show us your PlayerInfo enum?
Re: Undefined Symbo -
mahdi499 - 28.04.2013
Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pTeam,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Re: Undefined Symbo -
mahdi499 - 28.04.2013
here is the error that i get:
Код:
C:\Users\user\Desktop\Samp server\gamemodes\GLTDM.pwn(205) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\Samp server\gamemodes\GLTDM.pwn(205) : error 017: undefined symbol "cmd_stats"
C:\Users\user\Desktop\Samp server\gamemodes\GLTDM.pwn(205) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\Samp server\gamemodes\GLTDM.pwn(205) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Undefined Symbo -
RenSoprano - 28.04.2013
Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pTeam
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Try it now. And move your CMD
tats to be outside OnPlayerCommandText.
Examp:
Код:
public OnPlayerCommandText(.....)
{
return 1;
}
CMD:stats(playerid, pararams[])
{
// Your command
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
Re: Undefined Symbo -
mahdi499 - 28.04.2013
Yeah the 2nd Examp fixed it,thank you!