SA-MP Forums Archive
error 029: invalid expression, assumed zero - 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: error 029: invalid expression, assumed zero (/showthread.php?tid=554965)



error 029: invalid expression, assumed zero - BeesSi - 05.01.2015

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;
}



Re: error 029: invalid expression, assumed zero - BeesSi - 05.01.2015

Any idea what's the problem ?


Re: error 029: invalid expression, assumed zero - ikkentim - 05.01.2015

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


could you tell use which line the error is on?


Re : error 029: invalid expression, assumed zero - MCZOFT - 05.01.2015

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;




Re: error 029: invalid expression, assumed zero - Vince - 05.01.2015

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;
}



Re: error 029: invalid expression, assumed zero - RockyGamer - 05.01.2015

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 " ".


Re: error 029: invalid expression, assumed zero - BeesSi - 05.01.2015

Thank you guys. It fixed.