Posts: 92
Threads: 20
Joined: Jan 2015
Reputation:
0
Hello guys. I have a problem, i try to remove a player from a vehicle if he enter in another car job, not in his car job. If you understand what i mean. Can someone help ? I can't speak more about it becauze isn't something to say.
Posts: 3,324
Threads: 96
Joined: Sep 2013
ikey07's example, with this:
pawn Код:
RemovePlayerFromVehicle(playerid)
{
new Float:t_x, Float:t_y, Float:t_z, Float:t_s, t_v = GetPlayerVehicleID(playerid);
GetVehicleModelInfo(GetVehicleModel(t_v), VEHICLE_MODEL_INFO_SIZE, t_s, t_s, t_s);
GetVehiclePos(t_v, t_x, t_y, t_z);
//Place the player on top of the vehicle...
SetPlayerPos(playerid, t_x, t_y, t_z + (t_s / 2.0) + 0.5);
}
Posts: 153
Threads: 6
Joined: Nov 2014
Reputation:
0
(Smartphone)
You cant kick a player from a vehicle while he is entering the car. Because... hes simply not in yet. You got 2 options. I recommend Option one because it will stop the player directly at the Moment he attemp to enter.
1. OnPlayerEnterVehicle
Check if its a jobcar and not bis one. Then just use "ClearAnimations(playerid);" to stop him. Dont use "SetPlayerPos"! To much code.
2. given above