SA-MP Forums Archive
You can't leave 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: You can't leave car (/showthread.php?tid=389016)



You can't leave car - KlooP - 31.10.2012

Hey everyone, how to make a player could never get out of the car?

Sorry for bad english...


Re: You can't leave car - [HK]Ryder[AN] - 31.10.2012

in the callback OnPlayerExitVehicle
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
PutPlayerInVehicle(playerid, vehicleid, 0);



Re: You can't leave car - Abhishek. - 31.10.2012

you cannot make a system like the player never exits a car insted you can check if the player exited the car then teleport the player back to the car or you can kill the player if he isnt in the car
EDIT:what the hell man got late the third time today


Re: You can't leave car - Jaxson - 31.10.2012

Use OnPlayerExitVehicle callback to detect if the player has left the vehicle and once he has left the vehicle use PutPlayerInVehicle to put the player back inside. You might also want to save the player's seat in a global variable.


Re: You can't leave car - KlooP - 31.10.2012

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
in the callback OnPlayerExitVehicle
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
PutPlayerInVehicle(playerid, vehicleid, 0);
Thank you