28.11.2011, 10:52
Quote:
pawn Код:
- Create three new variables: x, y, z. These are all floats, as we're storing the player's position. - The PVar "VehicleExited" is set to the vehicleid the player is currently trying to exit. - The PVar "VehicleSeat" is set to where the player is sitting (seatid) in vehicleid. - Then, it will get the player's position (GetPlayerPos) and store their values in x, y, z. - It will set the player's position on top of the vehicle (SetPlayerPos). - It will set a timer to call the function "EnterBack" in 600 milliseconds (which is 0.6 seconds, 1000 milliseconds is 1 second, etc). - It will send them a message, saying they have to take their seatbelt off first. The EnterBack function: - Puts the player back into the vehicle as soon as it's called. - Deletes the 2 PVars we used: VehicleSeat and VehicleExited. Here's more information on the functions we've used in that code (they are links, click them!). SetPVarInt GetPVarInt SetPlayerPos GetPlayerPos SetTimerEx OnPlayerExitVehicle |