Quote:
Originally Posted by Sandiel
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerInVehicle(i, GetPlayerVehicleModel(GetPlayerVehicleID(playerid))) && playerid != i) { new iState = GetPlayerState(i); if(iState == PLAYER_STATE_DRIVER) { // Do what's necessary to the carjacker (playerid) here. } } } return 1; }
Not the most efficient way I can think of right now, but it is infact way better than the one you're currently using, hope this helps. (Compile error and in game errors may be presented, I haven't made this on pawn nor have I tested it, but should work fine.)
|
I don't want it in OnPlayerEnterVehicle as the player car jacking can "cancel" getting into the vehicle.. which I don't want.
Quote:
Originally Posted by Blackazur
|
That's to lock the car, not detect if it's being jacked.