Undefined Symbo
#1

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

Can you show us your PlayerInfo enum?
Reply
#3

Код:
enum pInfo
{
	pPass,
	pCash,
	pAdmin,
	pKills,
	pDeaths,
	pTeam,
}

new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#4

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

Код:
enum pInfo
{
	pPass,
	pCash,
	pAdmin,
	pKills,
	pDeaths,
	pTeam
}

new PlayerInfo[MAX_PLAYERS][pInfo];
Try it now. And move your CMDtats to be outside OnPlayerCommandText.

Examp:
Код:
public OnPlayerCommandText(.....) 
{
        return 1;
}

CMD:stats(playerid, pararams[])
{
        // Your command
        return 1;
}

public OnPlayerSpawn(playerid)
{
        return 1;
}
Reply
#6

Yeah the 2nd Examp fixed it,thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)