SA-MP Forums Archive
Help Car - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Car (/showthread.php?tid=665532)



Help Car - Brysius - 07.04.2019

Hi,I want to ask, how to make a person unable to carry a car roof, to drop or freeze it immediately?


Re: Help Car - Markski - 07.04.2019

Ask that again, but in english this time


Re: Help Car - Brysius - 08.04.2019

How to make on the car roof it would not be possible to transport man


Re: Help Car - Markski - 08.04.2019

I imagine what you're asking is how to stop players from surfing on top of people's cars?

If that's what you mean, I imagine a simple way to do it is to have a timer running each second and looping through MAX_PLAYERS, then check each player with GetPlayerSurfingVehicleID(playerid)

If the player isn't surfing a vehicle, the function will return INVALID_VEHICLE_ID

Example from the SA-MP wiki:

Code:
new surf = GetPlayerSurfingVehicleID(playerid);
if(surf == INVALID_VEHICLE_ID) SendClientMessage(playerid, COLOR_RED, "You are not surfing.");