-
-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Description
If you are in vehicle (PLAYER_STATE_DRIVER OR PLAYER_STATE_PASSANGER), and you die, OnPlayerStateChange will output oldstate PLAYER_STATE_SPAWNED, and newstate PLAYER_STATE_NONE, than PLAYER_STATE_ONFOOT, so if i try make per player timer when they sit as driver, and die, timer won't kill when newstate != PLAYER_STATE_DRIVER
In samp this work correctly, when player die in vehicle, oldstate first is PLAYER_STATE_DRIVER, than others
code example
static speedoMeter[MAX_PLAYERS] = {-1, ...};
OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
KillTimer(speedoMeter[playerid]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
speedoMeter[playerid] = SetTimerEx(...);
}
}
So, sit in vehicle as driver, kill yourself (SetPlayerHealth(...)), or explode in gas station, then see that oldstate will not be PLAYER_STATE_DRIVER, though you was PLAYER_STATE_DRIVER
Metadata
Metadata
Assignees
Labels
No labels