OnPlayerStateChange vs OnPlayerExitVehicle
#1

Hi, I'm learning to script and I'm trying to make a simple gamemode with a focus on Rustler air combats. The thing is that I have declared a global boolean array named pilot[playerid], that would be true whenever the player gets in the driver seat of an airplane or helicopter, and false one minute after he leaves it (well, it would be set as false also in other situations, but that's not the topic of this thread). Now comes the time to detect whenever the player enters or leaves his air vehicle as driver to set the boolean as true or to start the timer that will set it as false, and I have seen as my main options the combination of OnPlayerEnterVehicle and OnPlayerExitVehicle, or just using OnPlayerStateChange alone. The most logical option seems to be the first one, but what if once ingame I use an admin command to slap or teleport the player while he's flying a plane or heli, or to put him in one while he's on foot? maybe I'm wrong, but I think that OnPlayerExitVehicle and OnPlayerEnterVehicle are called only when the player leaves or enters his vehicle on his own will, and not when you use SetPlayerPos or PutPlayerInVehicle on him. So I'm wondering if all these situations could be detected by OnPlayerStateChange.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)