22.07.2010, 01:58
It takes a delay for users to exit the vehicle so you would have to start a timer and make them re-enter it.
I just coded this at the spot, so if you find any bugs, post it.
Edit: There's no function to force a player to stay in the vehicle.
pawn Код:
new MyVehicle[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == PLAYER_STATE_DRIVER) MyVehicle[playerid] = GetPlayerVehicleID(playerid);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicle) {
// SendClientMessage(playerid, 0xFFFFFFFF, "You can't exit >:]");
SetTimerEx("PlacePlayerBackInVehicle", 5000, 0, "i", playerid);
return 1;
}
forward PlacePlayerBackInVehicle(playerid);
public PlacePlayerBackInVehicle(playerid) {
PutPlayerInVehicle(playerid, MyVehicle[playerid], 0);
return 1;
}
Edit: There's no function to force a player to stay in the vehicle.