Ghecco

GetPlayerOldState

Aug 31st, 2020 (edited)
176
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define GetPlayerOldState(%0) GetPVarInt(%0, "PLAYER_OLD_STATE")
  2.  
  3. public OnPlayerStateChange(playerid, newstate, oldstate)
  4. {
  5.     SetPVarInt(playerid, "PLAYER_OLD_STATE", oldstate);
  6.     return 1;
  7. }
  8.  
  9. // example
  10. public OnPlayerDeath(playerid, killerid, reason)
  11. {
  12.     if(GetPlayerOldState(playerid) == PLAYER_STATE_DRIVER) print("1");
  13.     else print("0");
  14.     return 1;
  15. }
RAW Paste Data