SA-MP Forums Archive
Undefined symbol "pFrozen" PLEASE HELP - 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 "pFrozen" PLEASE HELP (/showthread.php?tid=331021)



Undefined symbol "pFrozen" PLEASE HELP - Scripter12345 - 03.04.2012

I defined pFrozen in my enums which you can see below


Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pSex,
    pAge,
   	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pSkin,
	pTeam,
	pAccent
	pFrozen
}
He is my /freeze command


Код:
CMD:freeze(playerid,params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
            new Target; //defines the playerid we wanna freeze
            if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /freeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
            if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
                return SendClientMessage(playerid, COLOR_GREY, "ERROR:Player is not connected!");
            if(!sscanf(params, "u", Target))
            {
                if(PlayerInfo[Target][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are higher than your level!"); // if the player you're performing this command on has a higher level as you, return a message, you ain't able to freeze him
                new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
                GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
                new pname[MAX_PLAYER_NAME]; //define the adminname
                GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
                new tstring[128]; //define the string for the player (victim)
                new pstring[128];// define the string for the admin which is performing
                new astring[128];//define the string for all the players which are online
                format(tstring,sizeof(tstring),"You have been frozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
                format(pstring,sizeof(pstring),"You have frozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
                format(astring,sizeof(astring),"Administrator %s has frozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
                SendClientMessage(Target,COLOR_GOLD,tstring);//sends the message to the victim
                SendClientMessage(playerid,TEAM_GROVE_COLOR,pstring);//sends the message to the admin
                SendClientMessageToAll(COLOR_LIGHTBLUE,astring);//sends the message to everybody
                TogglePlayerControllable(Target,0); //with that function, the player won't be able to mov, while we're using the variable "Target" as the playerid
                PlayerInfo[Target][pFrozen] = 1;//IMPORTANT:we're getting the variable "[frozen]" out of the enum, and set it's value to "1', the compiler knows now that the player is frozen
            }

    }
It says on the error


Код:
(973) : error 017: undefined symbol "pFrozen"
Please Help Me


Re: Undefined symbol "pFrozen" PLEASE HELP - blank. - 03.04.2012

Add a comma after pAccent.


Re: Undefined symbol "pFrozen" PLEASE HELP - Jonny5 - 03.04.2012

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pSex,
    pAge,
    Float:pPos_x,
    Float:pPos_y,
    Float:pPos_z,
    pSkin,
    pTeam,
    pAccent,
    pFrozen
}
you where missing a comma after pAccent


Re: Undefined symbol "pFrozen" PLEASE HELP - Reklez - 03.04.2012

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pSex,
    pAge,
    Float:pPos_x,
    Float:pPos_y,
    Float:pPos_z,
    pSkin,
    pTeam,
    pAccent,
    pFrozen
};
new PlayerInfo[MAX_PLAYERS][pInfo];



Re: Undefined symbol "pFrozen" PLEASE HELP - Scripter12345 - 03.04.2012

Thank You Every One