SA-MP Forums Archive
I have a doubt - 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: I have a doubt (/showthread.php?tid=618411)



I have a doubt - Juance - 05.10.2016

As I can get the collision of a vehicle according to its speed? for example: I want to make a script that, if you collide at high speed leaves you trapped in the vehicle. Sorry for my bad English


Re: I have a doubt - Speaker - 05.10.2016

You Can Use This For Not Allowing Player To Exit Vehicle
Code:
// above your script
new last_vehicle[MAX_PLAYERS];

// OnPlayerStateChange
if(newstate == PLAYER_STATE_DRIVER)
{
    last_vehicle[playerid] = GetPlayerVehicleID(playerid);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
    PutPlayerInVehicle(playerid, last_vehicle[playerid], 0);
}
And For Speed And Collision
Code:
You should take a look at Emmet_'s OnPlayerCrashVehicle include. I don't know if it uses the best method, but it works pretty well. And I believe the "extra include" include might be Emmet_'s include which has this function inside of it aswell.Give Link Below
https://sampforum.blast.hk/showthread.php?tid=485682


Respuesta: I have a doubt - Juance - 05.10.2016

Thank you!!! but the link is dead