Advertisement
DraKiNs

[COD] Debug OnPlayerUpdate

Aug 24th, 2011
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.82 KB | None | 0 0
  1. /*
  2.  * Author: Bruno da Silva
  3.  * Site: www.ips-team.blogspot.com
  4.  * Date: 02:58 23/08/2011
  5.  * (C) Copyright [iPs]TeaM
  6. */
  7.  
  8. #include a_samp
  9.  
  10. main()
  11. {
  12.     return state debugUpdate:sim, true;
  13. }
  14.  
  15.  
  16. new
  17.     string[30],
  18.     updateTick[MAX_PLAYERS char],
  19.     diferenceTimes[MAX_PLAYERS char];
  20.  
  21. /*
  22.     Debug your OnPlayerUpdate using Game Text
  23.     The code shows the amount of calls for onplayerupdate in ms (20 ~ 500 ms)
  24. */
  25.  
  26. public OnPlayerUpdate(playerid) <debugUpdate:sim>
  27. {
  28.     diferenceTimes{playerid} = GetTickCount() - updateTick{playerid};
  29.  
  30.     format(string, sizeof(string), "OnPlayerUpdate: %d ms", diferenceTimes{playerid});
  31.     GameTextForPlayer(playerid, string, 100, 4);
  32.  
  33.     return updateTick{playerid} = GetTickCount(), true;
  34. }
  35.  
  36.  
  37. public OnPlayerUpdate(playerid) <debugUpdate:nao>
  38. {
  39.     return true;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement