if(AmmuRecentlyRobbed == 0)
{
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu[playerid] = 20;
AmmuRecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
AmmuRecentlyRobbed = 100;
return true;
}
}
else if(AmmuRecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
if(GetPlayerWantedLevel == 6)
return SendClientMessage(playerid,COLOR,"Bla, text here!");
else if(GetPlayerWantedLevel < 6)
//your robbing-code
(2721) : error 076: syntax error in the expression, or invalid function call
(2723) : error 076: syntax error in the expression, or invalid function call
if(GetPlayerWantedLevel == 6)
else if(GetPlayerWantedLevel < 6)
new WLevel;
GetPlayerWantedLevel(playerid, WLevel);
if(WLevel == 6) return SendClientMessage(playerid,COLOR_RED,"You need to have a lower wantedlevel to continue!");
else if(WLevel < 6)
//The rest of your code here, what should continue, bla
GetPlayerWantedLevel(playerid, WLevel);
warning 202: number of arguments does not match definition
WLevel = GetPlayerWantedLevel(playerid);
if(WLevel == 6) return SendClientMessage(playerid,COLOR_RED,"You need to have a lower wantedlevel to continue!");
else if(WLevel < 6)
pawn Код:
|
if(AmmuRecentlyRobbed == 0)
{
if( GetPlayerWantedLevel( playerid ) >= 6 )
return SendClientMessage( playerid, -1, "You must to have less wanted stars to rob the ammunation !" );
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu[playerid] = 20;
AmmuRecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
AmmuRecentlyRobbed = 100;
return true;
}
}
else if(AmmuRecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
if( GetPlayerWantedLevel( playerid ) >= 6 )
return SendClientMessage( playerid, -1, "You must to have less wanted stars to rob the ammunation !" );
Try this:
pawn Код:
pawn Код:
|
No errors or warnings, but it still allows the player to rob
|