Quote:
Originally Posted by funky1234
Lock the players vehicle for everyone but the player.
pawn Код:
if (IsPlayerInAnyVehicle(playerid) == 1) { for(new i; i < MAX_PLAYERS; i++) { SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1); SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), playerid, 0, 0); } return 1; }
There is another function for this, in a way. But i find the above more efficient ![Smiley](images/smilies/smile.png)
|
but its not very efficient to call GetPlayerVehicleID(playerid) 1000 times
you just could put the second SetVehicleParamsForPlayer outside the loop
(but exactly the car is already unlocked [for himself] so its quite useless to unlock it again)
and assign GetPlayerVehicleID(playerid) to a variable