23.06.2018, 14:27
I managed to fix the problem. I probably posted this prematurely.
It appears that the player is still registered as being inside the vehicle when OnPlayerExitVehicle is called due to the time it takes for the player to actually get out (animnation), therefore I simply removed the player from the vehicle and then PutPlayerInVehicle.
I was just tinkering with the code, in an attempt to get it to work. Thanks for your response/support anyway!
It appears that the player is still registered as being inside the vehicle when OnPlayerExitVehicle is called due to the time it takes for the player to actually get out (animnation), therefore I simply removed the player from the vehicle and then PutPlayerInVehicle.
Код:
public OnPlayerExitVehicle(playerid, vehicleid) { if(RecentEnterExit[playerid] == 1) { new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+10); PutPlayerInVehicle(playerid, vehicleid, 0); SendClientMessage(playerid, COLOR_ERROR, "Error: You cannot exit so soon."); } return 1; }
I was just tinkering with the code, in an attempt to get it to work. Thanks for your response/support anyway!