SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/10/2012, 02:11 PM   #1
KlooP
Little Clucker
 
Join Date: Jan 2012
Posts: 27
Reputation: 0
Question You can't leave car

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

Sorry for bad english...
__________________
Sorry for my bad english
KlooP is offline   Reply With Quote
Old 31/10/2012, 02:14 PM   #2
[HK]Ryder[AN]
High-roller
 
[HK]Ryder[AN]'s Avatar
 
Join Date: Jan 2012
Location: New Delhi, India
Posts: 1,196
Reputation: 362
Default Re: You can't leave car

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


[HK]Ryder[AN] is offline   Reply With Quote
Old 31/10/2012, 02:15 PM   #3
Abhishek.
Huge Clucker
 
Abhishek.'s Avatar
 
Join Date: Jan 2012
Location: http://forum.sa-mp.com/member.php?u=152987
Posts: 472
Reputation: 51
Default Re: You can't leave car

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
__________________
i dont write any codes now.
gone old.
Abhishek. is offline   Reply With Quote
Old 31/10/2012, 02:19 PM   #4
Jaxson
Big Clucker
 
Jaxson's Avatar
 
Join Date: Oct 2010
Location: Croatia
Posts: 120
Reputation: 65
Default Re: You can't leave car

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.
Jaxson is offline   Reply With Quote
Old 31/10/2012, 02:19 PM   #5
KlooP
Little Clucker
 
Join Date: Jan 2012
Posts: 27
Reputation: 0
Default Re: You can't leave car

Quote:
Originally Posted by [HK]Ryder[AN] View Post
in the callback OnPlayerExitVehicle
pawn Code:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
PutPlayerInVehicle(playerid, vehicleid, 0);
Thank you
__________________
Sorry for my bad english
KlooP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP]NPC connect/leave losdementos Help Archive 2 01/04/2010 10:53 AM
Leave? ScottCFR Help Archive 2 13/03/2010 08:22 PM
NPC Join then leave? Torran Help Archive 8 28/01/2010 04:06 PM


All times are GMT. The time now is 05:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.