error 029: invalid expression, assumed zero
#3

pawn Код:
if(pickupid == copdutypoint)
{
    if(GetPlayerTeam(playerid) == 100)
    {//you need opening and closing braces if more than one statement follows the if
        GivePlayerWeapon(playerid, 3, 1);
        GivePlayerWeapon(playerid, 22, 99);
        GivePlayerWeapon(playerid, 27, 50);
    }
    else//only one statement following the else, so braces can be omitted.
        SendClientMessage(playerid, 0xAA3333AA, "You can't go on duty! You're not a cop");
}
You could also use comma's without braces but it looks ugly IMO.

EDIT:
Quote:
Originally Posted by pds2012
pawn Код:
if(pickupid == copdutypoint)
    if(GetPlayerTeam(playerid) == 100) //get the player team if cop
    {
    GivePlayerWeapon(playerid, 3, 1);//weapon 1 you set
   GivePlayerWeapon(playerid, 22, 99); //weapon 2 you set
   GivePlayerWeapon(playerid, 27, 50);//weapon 2 you set
    {
    SendClientMessage(playerid, 0xAA3333AA, "You can't go on duty! You're not a cop");// message if they are not cop
    return 1;
}//wheres the opening brace?
Your missing braces again.
Reply


Messages In This Thread
error 029: invalid expression, assumed zero - by ThePhill97 - 20.11.2012, 16:39
Re: error 029: invalid expression, assumed zero - by Patrick - 20.11.2012, 16:43
Re: error 029: invalid expression, assumed zero - by iggy1 - 20.11.2012, 16:50

Forum Jump:


Users browsing this thread: 1 Guest(s)