Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.72 KB | None | 0 0
  1.  
  2. if(!strcmp(cmd,"/info", true) || !strcmp(cmd,"/stats", true))
  3. {
  4. tmp = extract(cmdtext, 1);
  5. if(strlen(tmp)) { giveplayerid = strvalex(tmp); }
  6. else { giveplayerid = playerid; }
  7.  
  8. if(IsPlayerConnected(giveplayerid))
  9. {
  10. givename = GetName(giveplayerid);
  11. new giveplayerip[16];
  12. GetPlayerIp(giveplayerid, giveplayerip, sizeof giveplayerip);
  13. new TeamStatus[12];
  14. if(PlayerTeam[giveplayerid] == 0) { TeamStatus = NAME_TEAM_0; }
  15. if(PlayerTeam[giveplayerid] == 1) { TeamStatus = NAME_TEAM_1; }
  16. if(PlayerTeam[giveplayerid] == 2) { TeamStatus = NAME_TEAM_2; }
  17. if(PlayerTeam[giveplayerid] == 3) { TeamStatus = NAME_TEAM_3; }
  18. if(PlayerTeam[giveplayerid] == 4) { TeamStatus = NAME_TEAM_4; }
  19.  
  20. new AccountStatus[14];
  21. new TimePlayedStr[100];
  22. new TimePlayed;
  23. new PlayerLeaveTime = GetTimeInSeconds();
  24. new file[40];
  25. new Days, Hours, Minutes, Seconds, MilliSeconds;
  26. new GiveHealthStr[10];
  27. new GiveArmourStr[10];
  28. new RatioStr[8];
  29. new RoundRatioStr[8];
  30. new Status[23];
  31. new GiveRoundKillsStr[8];
  32. new GiveRoundDeathsStr[8];
  33. new GiveRoundScoreStr[8];
  34.  
  35. if(PlayerLoggedIn[giveplayerid] == true)
  36. {
  37. valstr(GiveRoundKillsStr, PlayerRoundKills[giveplayerid]);
  38. valstr(GiveRoundDeathsStr, PlayerRoundDeaths[giveplayerid]);
  39. valstr(GiveRoundScoreStr, PlayerRoundScore[giveplayerid]);
  40.  
  41. new Float:GiveHealth;
  42. GetPlayerHealth(giveplayerid, GiveHealth);
  43. format(GiveHealthStr, sizeof GiveHealthStr, "%.1f", GiveHealth);
  44. new Float:GiveArmour;
  45. GetPlayerArmour(giveplayerid, GiveArmour);
  46. format(GiveArmourStr, sizeof GiveArmourStr, "%.1f", GiveArmour);
  47.  
  48. AccountStatus = "Logged in";
  49. if(PlayerLeaveTime > PlayerJoinedTime[giveplayerid])
  50. {
  51. TimePlayed = PlayerLeaveTime-PlayerJoinedTime[giveplayerid];
  52. }
  53. if(PlayerLeaveTime < PlayerJoinedTime[giveplayerid])
  54. {
  55. TimePlayed = PlayerLeaveTime;
  56. TimePlayed += 86400-PlayerJoinedTime[giveplayerid];
  57. }
  58. file = GetPlayerFile(giveplayerid);
  59. TimePlayed = xini_int(file,"Vars","TimePlayed",false) + (TimePlayed/60);
  60. MSToTime(TimePlayed*60000, Days, Hours, Minutes, Seconds, MilliSeconds);
  61.  
  62. format(TimePlayedStr, sizeof TimePlayedStr, "%idays %02ihrs %02imin", Days, Hours, Minutes);
  63.  
  64. if(PlayerAlive[giveplayerid])
  65. {
  66. if(GodmodeTimertRunning[giveplayerid])
  67. {
  68. Status = "Just spawned (godmode)";
  69. GiveHealthStr = "Unlimited";
  70. GiveArmourStr = "Unlimited";
  71. }
  72. else
  73. {
  74. Status = "Alive";
  75. }
  76. }
  77. else
  78. {
  79. Status = "Dead";
  80. }
  81.  
  82. new Float:ratio;
  83. if(!PlayerDeaths[giveplayerid])
  84. {
  85. ratio = 0;
  86. }
  87. else
  88. {
  89. ratio = floatdiv(PlayerKills[giveplayerid], PlayerDeaths[giveplayerid]);
  90. }
  91. format(RatioStr, sizeof RatioStr, "%.1f", ratio);
  92.  
  93. new Float:roundratio;
  94. if(!PlayerRoundDeaths[giveplayerid])
  95. {
  96. roundratio = 0;
  97. }
  98. else
  99. {
  100. roundratio = floatdiv(PlayerRoundKills[giveplayerid], PlayerRoundDeaths[giveplayerid]);
  101. }
  102. format(RoundRatioStr, sizeof RoundRatioStr, "%.1f", roundratio);
  103. }
  104. else
  105. {
  106. TimePlayedStr = "Unknown";
  107. AccountStatus = "Not logged in";
  108. Status = "Not spawned";
  109. GiveHealthStr = "Unknown";
  110. GiveArmourStr = "Unknown";
  111. RatioStr = "Unknown";
  112. RoundRatioStr = "Unknown";
  113. GiveRoundKillsStr = "Unknown";
  114. GiveRoundKillsStr = "Unknown";
  115. GiveRoundScoreStr = "Unknown";
  116. }
  117.  
  118. new weaponid[13];
  119. new ammo[13];
  120. new bool:weaponslotused[13];
  121. new weaponname[13][20];
  122.  
  123. for(new slot; slot<13; slot++)
  124. {
  125. GetPlayerWeaponData(giveplayerid, slot, weaponid[slot], ammo[slot]);
  126. if(weaponid[slot] != 0) { weaponslotused[slot] = true; }
  127. weaponname[slot] = ReturnWeaponName(weaponid[slot]);
  128. }
  129.  
  130. new Caption[MAX_PLAYER_NAME+8];
  131. format(Caption, sizeof Caption, "{%x}%s's info:", COLOR_DIALOG_TITLE, givename);
  132.  
  133. new String1[1002];
  134.  
  135. new bool:Acces;
  136. if(PlayerRank[playerid] >= 2 || playerid == giveplayerid) { Acces = true; }
  137.  
  138. format(String1, sizeof String1, "%s{%x}Name:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, givename);
  139. format(String1, sizeof String1, "%s{%x}ID:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, giveplayerid);
  140. if(Acces) { format(String1, sizeof String1, "%s{%x}IP:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, giveplayerip); }
  141. format(String1, sizeof String1, "%s{%x}Rank:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerRank[giveplayerid]);
  142. format(String1, sizeof String1, "%s{%x}Time Played:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, TimePlayedStr);
  143. format(String1, sizeof String1, "%s{%x}Account:{%x}\t%s\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, AccountStatus);
  144. format(String1, sizeof String1, "%s{%x}Team:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, TeamStatus);
  145. if(Acces) { format(String1, sizeof String1, "%s{%x}Loadout:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, LoadoutName[PlayerLoadout[giveplayerid]-1]); }
  146. if(Acces) { format(String1, sizeof String1, "%s{%x}Weapon:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, ReturnWeaponName(GetPlayerWeapon(giveplayerid))); }
  147. if(Acces) { format(String1, sizeof String1, "%s{%x}Ammo:{%x}\t\t%i\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GetPlayerAmmo(giveplayerid)); }
  148.  
  149. if(Acces)
  150. {
  151. for(new slot; slot<13; slot++)
  152. {
  153. if(weaponslotused[slot])
  154. {
  155. format(String1, sizeof String1, "%s{%x}Inventory:{%x}\t\t%s\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, weaponname[slot], ammo[slot]);
  156. }
  157. }
  158. }
  159.  
  160. format(String1, sizeof String1, "%s\n", String1); //new line
  161. if(Acces) { format(String1, sizeof String1, "%s{%x}Health:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveHealthStr); }
  162. if(Acces) { format(String1, sizeof String1, "%s{%x}Armour:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveArmourStr); }
  163. format(String1, sizeof String1, "%s{%x}Money:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerMoney[giveplayerid]);
  164. format(String1, sizeof String1, "%s{%x}Score:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerScore[giveplayerid]);
  165. format(String1, sizeof String1, "%s{%x}Round Score:{%x}\t%s\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveRoundScoreStr);
  166. format(String1, sizeof String1, "%s{%x}Kills:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerKills[giveplayerid]);
  167. format(String1, sizeof String1, "%s{%x}Deaths:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerDeaths[giveplayerid]);
  168. format(String1, sizeof String1, "%s{%x}Round kills:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveRoundKillsStr);
  169. format(String1, sizeof String1, "%s{%x}Round deaths:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveRoundDeathsStr);
  170. format(String1, sizeof String1, "%s{%x}Ratio:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, RatioStr);
  171. format(String1, sizeof String1, "%s{%x}Round Ratio:{%x}\t%s\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, RoundRatioStr);
  172. format(String1, sizeof String1, "%s{%x}Status:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, Status);
  173.  
  174. ShowPlayerDialog(playerid, 10, 0, Caption, String1, "ok", "");
  175. }
  176. else
  177. {
  178. PlayerPlaySound(playerid, ErrorSound, 0.0, 0.0, 0.0);
  179. SendInfoText(playerid, 3000, 149, "~r~That_player_isn't_connected.");
  180. }
  181. return 1;
  182. }
Add Comment
Please, Sign In to add comment