if(..) doesn't work correctly.
#1

RESOLVED. Fixed by using empty statement and else.

Good Evening all,
First off, sorry if my description of my problem seems a little vague, i have had no sleep for about 40 hours, and really really cannot be arsed with typing anymore.

Anyway, I seem to be having a problem with an if statement. I requested assistance on such problem before, and now cannot find the thread.

I am trying to see if a player is in the correct type of vehicle, by doing this:
pawn Код:
new m = 403 || 514 || 515;
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != m) return Error(playerid, 0);
(Before anyone asks, Error(playerid, 0) would do:
pawn Код:
case 0:
        {
            SendClientMessage(playerid, COLOUR, "You are not in the correct vehicle for your job");
        }
)

Can anyone see a problem?

Thanks,
Ash
Reply
#2

Why not just do this because the way you're doing it won't work.

pawn Код:
new v = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(v) != 403 && GetVehicleModel(v) != 514 && GetVehicleModel(v) != 515) return Error(playerid, 0);
Edit: Shit. Didn't see the resolved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)