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=561547)



error 029: invalid expression, assumed zero - Tony$$ - 03.02.2015

Got these errors and a warning
C:\Users\YakupMalikDavut\Desktop\Havana Roleplay Scripts\ORIGINAL SRRP 3.1.2\gamemodes\H-RP.pwn(21267) : error 029: invalid expression, assumed zero
C:\Users\YakupMalikDavut\Desktop\Havana Roleplay Scripts\ORIGINAL SRRP 3.1.2\gamemodes\H-RP.pwn(21267) : error 029: invalid expression, assumed zero
C:\Users\YakupMalikDavut\Desktop\Havana Roleplay Scripts\ORIGINAL SRRP 3.1.2\gamemodes\H-RP.pwn(21267) : error 029: invalid expression, assumed zero
C:\Users\YakupMalikDavut\Desktop\Havana Roleplay Scripts\ORIGINAL SRRP 3.1.2\gamemodes\H-RP.pwn(21267) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (coffee) 1997-2006, ITB CompuPhase


4 Errors.

Heres is the line
pawn Код:
if(PlayerInfo[playerid][pAdmin] == 1 || if(PlayerInfo[playerid][pAdmin] == 2 || if(PlayerInfo[playerid][pAdmin] == 3 || if(PlayerInfo[playerid][pAdmin]== 4 || if(PlayerInfo[playerid][pAdmin]== 1337 || if(PlayerInfo[playerid][pAdmin] == 99999){
Here is the full command
pawn Код:
CMD:mykey(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 1 || if(PlayerInfo[playerid][pAdmin] == 2 || if(PlayerInfo[playerid][pAdmin] == 3 || if(PlayerInfo[playerid][pAdmin]== 4 || if(PlayerInfo[playerid][pAdmin]== 1337 || if(PlayerInfo[playerid][pAdmin] == 99999){
        new para1, string[128];
        format(string,sizeof(string),"Your Security key is %s", PlayerInfo[para1][pSecKey]);
        SendClientMessage(playerid, COLOR_BLUE,string);
        }else{
        SendClientMessage(playerid, COLOR_RED, "   You are not authorized to use that command !");
    }
    return 1;
}



Re: error 029: invalid expression, assumed zero - Samieastwood - 03.02.2015

Try this
PHP код:
CMD:mykey(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] == || if(PlayerInfo[playerid][pAdmin] == || if(PlayerInfo[playerid][pAdmin] == || if(PlayerInfo[playerid][pAdmin]== || if(PlayerInfo[playerid][pAdmin]== 1337 || if(PlayerInfo[playerid][pAdmin] == 99999) {
        new 
para1string[128];
        
format(string,sizeof(string),"Your Security key is %s"PlayerInfo[para1][pSecKey]);
        
SendClientMessage(playeridCOLOR_BLUE,string);
        }else{
        
SendClientMessage(playeridCOLOR_RED"   You are not authorized to use that command !");
    }
    return 
1;




Re: error 029: invalid expression, assumed zero - CalvinC - 03.02.2015

It starts to check IF PlayerInfo admin is 1, OR PlayerInfo admin is 2, and so on.
You made it to check with IF after every OR, which you shouldn't.
Use this:
pawn Код:
if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pAdmin] == 2 || PlayerInfo[playerid][pAdmin] == 3 || PlayerInfo[playerid][pAdmin]== 4 || PlayerInfo[playerid][pAdmin]== 1337 || PlayerInfo[playerid][pAdmin] == 99999{