error 029: invalid expression, assumed zero
#1

Hello there, i got here a badge command but i get the following error : error 029: invalid expression, assumed zero, if you could help me i would appreciate it .
pawn Код:
CMD:badge(playerid, params[]) {
    if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9)
    {
        {
            PlayerInfo[playerid][pDuty] = 0;
            SetPlayerToTeamColor(playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You have taken off your badge , you are now off-duty");
        }
        else
        {
            PlayerInfo[playerid][pDuty] = 1;
            SetPlayerToTeamColor(playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You have shown your badge, you are now on-duty");
        }
    }
    return 1;
}
Reply
#2

Any idea what's the problem ?
Reply
#3

please do not bump after just 4 minutes, only bump after 24 hours.


could you tell use which line the error is on?
Reply
#4

Try this ? i dident test it out im from phone ..

PHP код:

CMD
:badge(playeridparams[]) {
    if(
IsACop(playerid) || PlayerInfo[playerid][pFaction] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pFaction] == || PlayerInfo[playerid][pLeader] == 9)
    {
        
        
PlayerInfo[playerid][pDuty] = 0;
        
SetPlayerToTeamColor(playerid);
        
SendClientMessage(playeridCOLOR_WHITE"You have taken off your badge , you are now off-duty");
        
    }
    else
    {
        
PlayerInfo[playerid][pDuty] = 1;
        
SetPlayerToTeamColor(playerid);
        
SendClientMessage(playeridCOLOR_WHITE"You have shown your badge, you are now on-duty");
    }
    return 
1;

Reply
#5

pawn Код:
CMD:badge(playerid, params[]) {
    if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9)
    {
        // if( ??? ) // Missing here?
        {
            PlayerInfo[playerid][pDuty] = 0;
            SetPlayerToTeamColor(playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You have taken off your badge , you are now off-duty");
        }
        else
        {
            PlayerInfo[playerid][pDuty] = 1;
            SetPlayerToTeamColor(playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You have shown your badge, you are now on-duty");
        }
    }
    return 1;
}
Reply
#6

Maybe this??
pawn Код:
CMD:badge(playerid, params[]) {
* * if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9)
* * {
* * * * PlayerInfo[playerid][pDuty] = 0;
* * * * SetPlayerToTeamColor(playerid);
* * * * SendClientMessage(playerid, COLOR_WHITE, "You have taken off your badge , you are now off-duty");
*   }
 *  else
 *  {
* *     PlayerInfo[playerid][pDuty] = 1;
* * * * SetPlayerToTeamColor(playerid);
* * * * SendClientMessage(playerid, COLOR_WHITE, "You have shown your badge, you are now on-duty");
* * }
* * return 1;
}
Sry for "*", just imagine that they are " ".
Reply
#7

Thank you guys. It fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)