Quote:
Originally Posted by Finn
Are you sure this part is right:
pawn Код:
PlayerInfo[playerid][pJob] != 1
Also, I'd suggest first checking player's job, then launching the loop if the job is correct (not like you're doing - checking the job every loop tick). Plus breaking the loop when found the correct vehicle id wouldn't hurt.
pawn Код:
if(PlayerInfo[playerid][pJob] != 1) { for(new i = 0; i <MAX_PIZZABIKES; i++) { if(vehicleid == PizzaJobVehicles[i]) { SendClientMessage(playerid, COLOR_RED, "You don't have the keys of this Vehicle"); SendClientMessage(playerid, COLOR_RED, "So you decide to step off the Pizzaboy"); RemovePlayerFromVehicle(playerid); break; // Kill the loop. } } }
Edit: Maybe I should learn to write faster.
|
Guys, can you explain, because i want to know, what actually means from this line:if(PlayerInfo[playerid][pJob] != 1):
[pJob] and !=1?I only saw =1 per my scripting time...And i don't understand the whole line:
for(new i = 0; i <MAX_PIZZABIKES; i++) :can someone say what it is used for?I understand that
new i is variable and now it has integer
0 inside itself, but what it gives i don't know.Is this code
i<MAX_PIZZABIKES only checks if all pizza boy bikes number is lower than variable
i?So why it need than?And for me it's unclear how bikes number can be lower than variable
i if variable is only
0, so there's no bikes?
And the last thing about that is code
i++ what actually it does?!Big thanks for the help and don't say anything like go and learn yourself boy.Write what you know about what i asking.