SA-MP Forums Archive
Why its says this when i compile? - 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: Why its says this when i compile? (/showthread.php?tid=510582)



Why its says this when i compile? - Inc - 01.05.2014

Quote:

C:\Users\Jacob\Desktop\Basic RP Script Scratch FIX\gamemodes\U1.pwn(562) : error 017: undefined symbol "Team"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Код:
CMD:stats(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new
			string[ 128 ],
			Age = PlayerInfo[ playerid ][ pAge ],
			Money = GetPlayerCash( playerid )
		;

		new Sex[20];
		if(PlayerInfo[ playerid ][ pSex ] == 1) { Sex = "Male"; }
		else if(PlayerInfo[ playerid ][ pSex ] == 2) { Sex = "Female"; }

		SendClientMessage(playerid, COLOR_LIGHTBLUE, "------------------------------------------------------------------------");
		format(string, sizeof(string), "Name: %s | Money: %d | Age: %d | Sex: %s | Team: %s | Accent: %d | Skin: %d", RPName(playerid), Money, Age, Sex, Team, Accent, Skin);
        SendClientMessage(playerid, COLOR_GRAD2, string);
	}
	return 1;
}



Re: Why its says this when i compile? - Affan - 01.05.2014

Which line is 564?


Re: Why its says this when i compile? - Inc - 01.05.2014

This is 564 line
Quote:

CMDtats(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new
string[ 128 ],
Age = PlayerInfo[ playerid ][ pAge ],
Money = GetPlayerCash( playerid )
;




Re: Why its says this when i compile? - Jstylezzz - 01.05.2014

Obviously it's this one
pawn Код:
format(string, sizeof(string), "Name: %s | Money: %d | Age: %d | Sex: %s | Team: %s | Accent: %d | Skin: %d", RPName(playerid), Money, Age, Sex, Team, Accent, Skin);
Now, I think you want to use something like PlayerInfo[playerid][Team] here.. You didn't declare the 'Team' variable, not globally nor locally. Be sure to add it and give it a value.


Re: Why its says this when i compile? - Inc - 01.05.2014

Where should i add this one?

PlayerInfo[playerid][Team]


Re: Why its says this when i compile? - Jstylezzz - 01.05.2014

It should be added in the enum that is linked with PlayerInfo.


Re: Why its says this when i compile? - AphexCCFC - 01.05.2014

pawn Код:
CMD:stats(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            new string[128], Sex[20], Age = PlayerInfo[playerid][pAge], Team = PlayerInfo[playerid][pTeam], Money = GetPlayerCash(playerid);

            if(PlayerInfo[ playerid ][ pSex ] == 1) { Sex = "Male"; }
            else if(PlayerInfo[ playerid ][ pSex ] == 2) { Sex = "Female"; }

            SendClientMessage(playerid, COLOR_LIGHTBLUE, "------------------------------------------------------------------------");
            format(string, sizeof(string), "Name: %s | Money: %d | Age: %d | Sex: %s | Team: %s | Accent: %d | Skin: %d", RPName(playerid), Money, Age, Sex, Team, Accent, Skin);
            SendClientMessage(playerid, COLOR_GRAD2, string);
        }
        return 1;
    }
Search for 'enum pInfo' in pawno and add 'pTeam' with the rest of the variables.
Also add the team variable in all player saving and loading callbacks.
Sorry about the indent issue


Re: Why its says this when i compile? - Inc - 01.05.2014

Thanks