Adding passengers
#1

Hi there,

Well i know this is a Scripting Help board and i shouldn't be requesting a script. But i wanted to make a system(especially for shamals and or planes) in which player could type a command such as /in or /getinvehicle as a passenger. I dont need a pre-made script for anybody but i'd just like an advice on how do i start off and what i should use to achieve what i am thinking.
Reply
#2

https://sampwiki.blast.hk/wiki/Function:PutPlayerInVehicle

Also might want to add a var or some kind of check to see if the seat is valid or not. Otherwise they'll crash on exit.

Use https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange for this.
Reply
#3

Do you mean a script where in a bus, or a plane a player can type /passenger... then they will spawn into an interior of a plane etc? If you do reply back, and I will write a check list for you, and a little guide.
Reply
#4

Umm well, not really, the can type /passenger and they can sit be inside the vehicle but as a passenger even if the vehicle is full.
Reply
#5

Bump, anyone?
Reply
#6

I don't think this is possible, BUT I'm giving you this idea:
How about making the player spectate the vehicle. (Note the player will not be able to drive-by)
Reply
#7

Yeah, that used to be possible in earlier SAMP versions... however it was removed. There was a thread on it: Can't find it.

Anyhow, Kalcor removed it in a 0.3e version or something, and there was a discussion on which cars it should be put back on. I don't know if it was restored to any of the vehicles.

This means you'll have to do what Stinged said:

You can do this using OnPlayerEnterVehicle, when the player gets in the vehicle you need to set a variable in their player data, or a global variable telling you their in car state.

Once you have done that, also set it to spectate.

Then under OnPlayerExitVehicle do the opposite, unset the variable and stop the spectate. You will have to also, set their position next to the vehicle.

Just as an FYI, it doesn't matter if the car is full OnPlayerEnterVehicle is still called. Information is on Wiki.
Reply
#8

Ty for help, ill get back to you asap
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)