Advertisement
Guest User

stats

a guest
Oct 7th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COLOR_YELLOW 0xFFFF00AA
  4.  
  5. enum stats
  6. {
  7. deaths,
  8. kills
  9. }
  10. new pInfo[MAX_PLAYERS][stats];
  11.  
  12. #if defined FILTERSCRIPT
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.  
  17. return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22. return 1;
  23. }
  24. public OnPlayerConnect()
  25. {
  26. pInfo[playerid][deaths]=0;
  27. pInfo[killerid][kills]=0;
  28. return 1;
  29. }
  30.  
  31. public OnPlayerDeath(playerid, killerid, reason)
  32. {
  33. pInfo[playerid][deaths]++;
  34. pInfo[killerid][kills]++;
  35. return 1;
  36. }
  37.  
  38. public OnPlayerCommandText(playerid, cmdtext[])
  39. {
  40. if (strcmp("/stats", cmdtext, true, 10) == 0)
  41. {
  42. new string[200];
  43. format(string, sizeof(string),"Ölések:%d Halások:%d",pInfo[playerid][kills],pInfo[playerid][deaths]);
  44. SendClientMessage(playerid,COLOR_YELLOW,string);
  45. return 1;
  46. }
  47. return 0;
  48. }
  49. #endif
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement