30.11.2016, 18:23
First and foremost, you can use the GetPlayerSurfingVehicleID function to check if the player is surfing on the roof. Example of checking if someone is:
1. Surfing on any car:
2. Surfing on a specific car
Secondly, you can use the SetPlayerVelocity(or even SetPlayerPos) function to move the player off of the car. For example, you can slap the player into the air.
1. Surfing on any car:
pawn Код:
if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID)
{
// do things here
}
pawn Код:
if(GetPlayerSurfingVehicleID(playerid) == vehicleid)
{
// do something here
}
pawn Код:
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z + 6.0);