25.02.2012, 22:46
Quote:
This doesn't work, it still allows me to exit the vehicle, OnPlayerExitVehicle doesn't seem to work either.
|
EDIT:
If you want the player not to exit out of the vehicle you could use the following:-
pawn Код:
// Top in your script
new
n_szPlayerVehicle[MAX_PLAYERS],
n_bSeatID[MAX_PLAYERS]
;
// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if ((newstate == PLAYER_STATE_DRIVER) || (newstate == PLAYER_STATE_PASSENGER))
{
n_szPlayerVehicle[playerid] = GetPlayerVehicleID(playerid);
n_bSeatID[playerid] = GetPlayerVehicleSeat(playerid);
}
// this stops the player to exit the vehicle.
if ((newstate == PLAYER_STATE_ONFOOT) && ((oldstate == PLAYER_STATE_DRIVER) || (oldstate == PLAYER_STATE_PASSENGER)))
PutPlayerInVehicle(playerid, n_szPlayerVehicle[playerid], n_bSeatID[playerid]);
SendClientMessage(playerid, -1, "You can't exit the vehicle");
return 1;
}
-FalconX