Advertisement
Hellrocker

Untitled

Jan 26th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. cmd(stats)
  2. {
  3. new targetid;
  4. new ownStringID[8];
  5. format(ownStringID, 8, "I(%d)", playerid);
  6. checkParams(ownStringID, targetid);
  7. checkTargetConnected();
  8. CallRemoteFunction("showPlayerStats", "ii", playerid, targetid);
  9. new msg[128];
  10. format(msg, 128, MSGPREFIX"%s checked your /stats", playerNick[playerid]);
  11. if(playerid != targetid && !playerAccount[playerid][playerAdminLevel]) SendClientMessage(targetid, 0x66CCCC, msg);
  12.  
  13. notifyAdminEvent("%s used /stats.", playerNick[playerid]);
  14. return 1;
  15. }
  16.  
  17. global:showPlayerStats(toplayerid, playerid)
  18. {
  19. new countryString[48];
  20. GetPVarString(playerid, "country", countryString, 48);
  21. new subQuery[1024];
  22. strpack(subQuery, "");
  23. new tempString[128];
  24. new rgbMaxColors = sizeof(RGBColors);
  25. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  26. format(tempString, 128, "AccountID: %d \tCountry: %s\r\n", userStats[playerid][accID], countryString);
  27. strcat(subQuery, tempString);
  28. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  29. format(tempString, 128, "General Stats:");
  30. strcat(subQuery, tempString);
  31. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  32. format(tempString, 128, "\nCash:\t\t\t$%08d", (userStats[playerid][cash]));
  33. strcat(subQuery, tempString);
  34. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  35. format(tempString, 128, "\nKills:\t\t\t%d", userStats[playerid][kills]);
  36. strcat(subQuery, tempString);
  37. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  38. format(tempString, 128, "\nDeaths:\t\t%d", userStats[playerid][deaths]);
  39. strcat(subQuery, tempString);
  40. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  41. format(tempString, 128, "\nTime Played:\t\t%s", getTimeStr(userStats[playerid][timePlayed]));
  42. strcat(subQuery, tempString);
  43. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  44. format(tempString, 128, "\nRatio:\t\t\t%0.2f", (floatdiv(userStats[playerid][kills],userStats[playerid][deaths])));
  45. strcat(subQuery, tempString);
  46. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  47. format(tempString, 128, "\nPoints:\t\t\t%d", userStats[playerid][points]);
  48. strcat(subQuery, tempString);
  49. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  50. format(tempString, 128, "\nRank:\t\t\t%d", userStats[playerid][rank]);
  51. strcat(subQuery, tempString);
  52. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  53. format(tempString, 128, "\nAdmins Killed:\t\t%d", userStats[playerid][adminKills]);
  54. strcat(subQuery, tempString);
  55. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  56. format(tempString, 128, "\nReaction tests won:\t%d", userStats[playerid][reactionTestWin]);
  57. strcat(subQuery, tempString);
  58. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  59. format(tempString, 128, "\nFPS:\t\t\t%d", CallRemoteFunction("getPlayerFPS", "i", playerid));
  60. strcat(subQuery, tempString);
  61. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  62. format(tempString, 128, "\nAccuracy:\t\t%0.2f%%", floatdiv(userStats[playerid][sT], userStats[playerid][sT] + userStats[playerid][sM]) * 100);
  63. strcat(subQuery, tempString);
  64. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  65. format(tempString, 128, "\nChi:\t\t\t%d%%", GetPVarInt(playerid, "chiVal"));
  66. strcat(subQuery, tempString);
  67. strcat(subQuery, RGBColors[random(rgbMaxColors)]);
  68. if(GetPVarInt(playerid, "clanID")) {
  69. //CallRemoteFunction("registerClanPVar", "i", playerid);
  70. new pClanName[56];
  71. GetPVarString(playerid, "clanName", pClanName, 56);
  72. format(tempString, 128, "\nClan:\t\t\t%s", pClanName);
  73. } else {
  74. format(tempString, 128, "\nClan:\t\t\tNone");
  75. }
  76. strcat(subQuery, tempString);
  77. showDialog(toplayerid, 1434, DIALOG_STYLE_MSGBOX, "Statistics", subQuery, "close", "");
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement