Quote:
Originally Posted by Jacks
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { if(GetPlayerVehicleID(playerid) == Testcar) { new Float:X, Float:Y, Float:Z; GetVehiclePos(Fabmobile, X, Y, Z); SetPlayerPos(playerid, X, Y, Z); SendClientMessage(playerid, 0xFF0000FF, "You are not the owner of this car!"); GameTextForPlayer(playerid, "~r~Ejected!", 3000, 5); TogglePlayerControllable(playerid, 1); RemovePlayerFromVehicle(playerid); } } return 1; }
|
You see, the SetPlayerPos is for removing the player from the vehicle, as RemovePlayerFromVehicle performs the exit anim, but with SetPlayerPos it ejects the player in a better way.
And TogglePlayerControllable should be false, as the player should be frozen for 7,5 seconds, the timer should be in too.
And as i said, removeplayerfromvehicle is useless since the player is already ejected at that point.