SA-MP Forums Archive
Noobish problem.. - 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: Noobish problem.. (/showthread.php?tid=336141)



Noobish problem.. - vassilis - 21.04.2012

Hey guys i am not noticeable..so i have difficult a bit here i hope you can help me
:

pawn Код:
CMD:cia(playerid,params[])
{

    if(IsPlayerInRangeOfPoint(playerid,3.0,1292.5715,-1012.6298,6645.7319) && gTeam[playerid] == TEAM_CIA) return SendClientMessage(playerid,-1,""COL_RED"ERROR:You are not at CIA lockers or you are not CIA!");
    {

    GivePlayerWeapon(playerid,29,100);

    }

    else if(gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIVILIAN || gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_MEDIC)
    {

    SendClientMessage(playerid,-1,""COL_RED"ERROR:You are not CIA Officer to use this command!");

    }


    return 1;
}
errors:
pawn Код:
(4272) : error 029: invalid expression, assumed zero
(4272) : warning 215: expression has no effect
(4272) : error 001: expected token: ";", but found "if"
4272 line:
pawn Код:
else if(gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIVILIAN || gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_MEDIC)



Re: Noobish problem.. - Face9000 - 21.04.2012

pawn Код:
else if(gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIVILIAN || gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_MEDIC);



Re: Noobish problem.. - vassilis - 21.04.2012

so in else if i need to add ";" too?

EDIT:I changed it to empy "if" so it fixed it anyway it doesnt fix it by adding ;.Furthermore i think when you use else if you need to return a value.Thanks anyway.


Re: Noobish problem.. - Face9000 - 21.04.2012

Yes.