Guest User

[FilterScript] Score and Ping - Striker Samp

a guest
Nov 1st, 2012
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. /*
  2. Basic Player Stats. Shows Score and Ping in a textdraw.
  3. Credits - iPLEOMAX
  4. [HK]Ryder[AN]
  5. SA:MP Team
  6. */
  7.  
  8. // Striker Samp - Tudo Para Seu Servidor!
  9. // www.strikersamp.blogspot.com
  10.  
  11. #include <a_samp>
  12.  
  13. // Striker Samp - Tudo Para Seu Servidor!
  14. // www.strikersamp.blogspot.com
  15.  
  16. new updatetimer[MAX_PLAYERS];
  17.  
  18. // Striker Samp - Tudo Para Seu Servidor!
  19. // www.strikersamp.blogspot.com
  20.  
  21. //Player Textdraws:
  22. new PlayerText:Textdraw0[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
  23. new PlayerText:Textdraw1[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
  24.  
  25. // Striker Samp - Tudo Para Seu Servidor!
  26. // www.strikersamp.blogspot.com
  27.  
  28. forward update(playerid);
  29. public OnPlayerConnect(playerid)
  30. {
  31. Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 498.398, 100.799, "Score - -=-");
  32. PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
  33. PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
  34. PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
  35. PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
  36. PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
  37. PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
  38. PlayerTextDrawShow(playerid, Textdraw0[playerid]);
  39.  
  40. Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 497.600, 120.212, "Ping - -=- ms");
  41. PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
  42. PlayerTextDrawColor(playerid, Textdraw1[playerid], -1);
  43. PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 1);
  44. PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
  45. PlayerTextDrawFont(playerid, Textdraw1[playerid], 2);
  46. PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);
  47. PlayerTextDrawShow(playerid, Textdraw1[playerid]);
  48.  
  49. updatetimer[playerid] = SetTimerEx("update", 1000, true, "d", playerid);
  50. return 1;
  51. }
  52.  
  53. // Striker Samp - Tudo Para Seu Servidor!
  54. // www.strikersamp.blogspot.com
  55.  
  56. public update(playerid)
  57. {
  58. new score[16], ping[16];
  59. format(score, sizeof(score), "Score - %d", GetPlayerScore(playerid));
  60. format(ping, sizeof(ping), "Ping - %d ms", GetPlayerPing(playerid));
  61. PlayerTextDrawSetString(playerid, Textdraw0[playerid], score);
  62. PlayerTextDrawSetString(playerid, Textdraw1[playerid], ping);
  63. return 1;
  64. }
  65.  
  66. // Striker Samp - Tudo Para Seu Servidor!
  67. // www.strikersamp.blogspot.com
  68.  
  69. public OnPlayerDisconnect(playerid, reason)
  70. {
  71. PlayerTextDrawDestroy(playerid, Textdraw0[playerid]);
  72. Textdraw0[playerid] = PlayerText:INVALID_TEXT_DRAW;
  73.  
  74. PlayerTextDrawDestroy(playerid, Textdraw1[playerid]);
  75. Textdraw1[playerid] = PlayerText:INVALID_TEXT_DRAW;
  76.  
  77. KillTimer(updatetimer[playerid]);
  78.  
  79. return 1;
  80. }
  81.  
  82. // Striker Samp - Tudo Para Seu Servidor!
  83. // www.strikersamp.blogspot.com
Advertisement
Add Comment
Please, Sign In to add comment