error 029: invalid expression, assumed zero
#1

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;
}
Reply
#2

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;

Reply
#3

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{
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)