Posts: 105
Threads: 10
Joined: Jul 2014
Reputation:
0
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.
Posts: 1,765
Threads: 1
Joined: Aug 2011
Reputation:
0
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.
Posts: 105
Threads: 10
Joined: Jul 2014
Reputation:
0
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.
Posts: 1,578
Threads: 15
Joined: Feb 2013
Reputation:
0
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)
Posts: 1,765
Threads: 1
Joined: Aug 2011
Reputation:
0
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.
Posts: 105
Threads: 10
Joined: Jul 2014
Reputation:
0
Ty for help, ill get back to you asap