OnPlayerExitVehicle
#3

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.


Код:
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;
}


Quote:
Originally Posted by Lokii
Посмотреть сообщение
why getid if you allready got in the callback
I was just tinkering with the code, in an attempt to get it to work. Thanks for your response/support anyway!
Reply


Messages In This Thread
OnPlayerExitVehicle - by Zmith - 23.06.2018, 13:46
Re: OnPlayerExitVehicle - by Lokii - 23.06.2018, 14:05
Re: OnPlayerExitVehicle - by Zmith - 23.06.2018, 14:27

Forum Jump:


Users browsing this thread: 1 Guest(s)