Jump to passenger seat
#1

Hi, I'm trying to make a command for Administrators .. to jump into a free seat in a players cars (if there is a free seat and if the player is in a car) .. thing is, I'm thinking .. how would I go about checking that the passenger seat is free .. if I just cram the player in there without checking, and somebody is already in that seat, it will cause problems, right?

SO .. my question is - How do I check that the seat I want to jump the player into, is free?
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerVehicleSeat
Reply
#3

How does that help me in the slightest? You want me to check each and every player in the server, to see if they are in a seat in the car the player I'm jumping to is in? I don't understand ..
Reply
#4

On the page that dice7 send you, There is a related function calld PutPlayerInVehice, at the bottom of the page. With those functions(GetPlayerVehicleSeat and PutPlayerInVehicle) you should be able to work out a code to do the job. Sorry for not beeing able to help more. Kind of new to scripting.
Reply
#5

I've got the code .. all of it, and it works great, but thing is .. I'm worried that when the time comes to warp into a full car (accidentally because there is nothing stopping me from doing so) it's going to crash players, or worse the whole server.
Reply
#6

Nope, It will only crash if you attempt to exit a vehicle if you're in a non-existing seat, otherwise it's just fine. Best thing to do is freeze your player if you're in a deadseat then OnPlayerKeyStateChange or OnPlayerExitVehicle use SetPlayerPos.
Reply
#7

Oh great Thanks for clearing it up, didn't know what would happen lol
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)