Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!strcmp(cmd,"/info", true) || !strcmp(cmd,"/stats", true))
- {
- tmp = extract(cmdtext, 1);
- if(strlen(tmp)) { giveplayerid = strvalex(tmp); }
- else { giveplayerid = playerid; }
- if(IsPlayerConnected(giveplayerid))
- {
- givename = GetName(giveplayerid);
- new giveplayerip[16];
- GetPlayerIp(giveplayerid, giveplayerip, sizeof giveplayerip);
- new TeamStatus[12];
- if(PlayerTeam[giveplayerid] == 0) { TeamStatus = NAME_TEAM_0; }
- if(PlayerTeam[giveplayerid] == 1) { TeamStatus = NAME_TEAM_1; }
- if(PlayerTeam[giveplayerid] == 2) { TeamStatus = NAME_TEAM_2; }
- if(PlayerTeam[giveplayerid] == 3) { TeamStatus = NAME_TEAM_3; }
- if(PlayerTeam[giveplayerid] == 4) { TeamStatus = NAME_TEAM_4; }
- new AccountStatus[14];
- new TimePlayedStr[100];
- new TimePlayed;
- new PlayerLeaveTime = GetTimeInSeconds();
- new file[40];
- new Days, Hours, Minutes, Seconds, MilliSeconds;
- new GiveHealthStr[10];
- new GiveArmourStr[10];
- new RatioStr[8];
- new RoundRatioStr[8];
- new Status[23];
- new GiveRoundKillsStr[8];
- new GiveRoundDeathsStr[8];
- new GiveRoundScoreStr[8];
- if(PlayerLoggedIn[giveplayerid] == true)
- {
- valstr(GiveRoundKillsStr, PlayerRoundKills[giveplayerid]);
- valstr(GiveRoundDeathsStr, PlayerRoundDeaths[giveplayerid]);
- valstr(GiveRoundScoreStr, PlayerRoundScore[giveplayerid]);
- new Float:GiveHealth;
- GetPlayerHealth(giveplayerid, GiveHealth);
- format(GiveHealthStr, sizeof GiveHealthStr, "%.1f", GiveHealth);
- new Float:GiveArmour;
- GetPlayerArmour(giveplayerid, GiveArmour);
- format(GiveArmourStr, sizeof GiveArmourStr, "%.1f", GiveArmour);
- AccountStatus = "Logged in";
- if(PlayerLeaveTime > PlayerJoinedTime[giveplayerid])
- {
- TimePlayed = PlayerLeaveTime-PlayerJoinedTime[giveplayerid];
- }
- if(PlayerLeaveTime < PlayerJoinedTime[giveplayerid])
- {
- TimePlayed = PlayerLeaveTime;
- TimePlayed += 86400-PlayerJoinedTime[giveplayerid];
- }
- file = GetPlayerFile(giveplayerid);
- TimePlayed = xini_int(file,"Vars","TimePlayed",false) + (TimePlayed/60);
- MSToTime(TimePlayed*60000, Days, Hours, Minutes, Seconds, MilliSeconds);
- format(TimePlayedStr, sizeof TimePlayedStr, "%idays %02ihrs %02imin", Days, Hours, Minutes);
- if(PlayerAlive[giveplayerid])
- {
- if(GodmodeTimertRunning[giveplayerid])
- {
- Status = "Just spawned (godmode)";
- GiveHealthStr = "Unlimited";
- GiveArmourStr = "Unlimited";
- }
- else
- {
- Status = "Alive";
- }
- }
- else
- {
- Status = "Dead";
- }
- new Float:ratio;
- if(!PlayerDeaths[giveplayerid])
- {
- ratio = 0;
- }
- else
- {
- ratio = floatdiv(PlayerKills[giveplayerid], PlayerDeaths[giveplayerid]);
- }
- format(RatioStr, sizeof RatioStr, "%.1f", ratio);
- new Float:roundratio;
- if(!PlayerRoundDeaths[giveplayerid])
- {
- roundratio = 0;
- }
- else
- {
- roundratio = floatdiv(PlayerRoundKills[giveplayerid], PlayerRoundDeaths[giveplayerid]);
- }
- format(RoundRatioStr, sizeof RoundRatioStr, "%.1f", roundratio);
- }
- else
- {
- TimePlayedStr = "Unknown";
- AccountStatus = "Not logged in";
- Status = "Not spawned";
- GiveHealthStr = "Unknown";
- GiveArmourStr = "Unknown";
- RatioStr = "Unknown";
- RoundRatioStr = "Unknown";
- GiveRoundKillsStr = "Unknown";
- GiveRoundKillsStr = "Unknown";
- GiveRoundScoreStr = "Unknown";
- }
- new weaponid[13];
- new ammo[13];
- new bool:weaponslotused[13];
- new weaponname[13][20];
- for(new slot; slot<13; slot++)
- {
- GetPlayerWeaponData(giveplayerid, slot, weaponid[slot], ammo[slot]);
- if(weaponid[slot] != 0) { weaponslotused[slot] = true; }
- weaponname[slot] = ReturnWeaponName(weaponid[slot]);
- }
- new Caption[MAX_PLAYER_NAME+8];
- format(Caption, sizeof Caption, "{%x}%s's info:", COLOR_DIALOG_TITLE, givename);
- new String1[1002];
- new bool:Acces;
- if(PlayerRank[playerid] >= 2 || playerid == giveplayerid) { Acces = true; }
- format(String1, sizeof String1, "%s{%x}Name:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, givename);
- format(String1, sizeof String1, "%s{%x}ID:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, giveplayerid);
- if(Acces) { format(String1, sizeof String1, "%s{%x}IP:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, giveplayerip); }
- format(String1, sizeof String1, "%s{%x}Rank:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerRank[giveplayerid]);
- format(String1, sizeof String1, "%s{%x}Time Played:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, TimePlayedStr);
- format(String1, sizeof String1, "%s{%x}Account:{%x}\t%s\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, AccountStatus);
- format(String1, sizeof String1, "%s{%x}Team:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, TeamStatus);
- if(Acces) { format(String1, sizeof String1, "%s{%x}Loadout:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, LoadoutName[PlayerLoadout[giveplayerid]-1]); }
- if(Acces) { format(String1, sizeof String1, "%s{%x}Weapon:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, ReturnWeaponName(GetPlayerWeapon(giveplayerid))); }
- if(Acces) { format(String1, sizeof String1, "%s{%x}Ammo:{%x}\t\t%i\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GetPlayerAmmo(giveplayerid)); }
- if(Acces)
- {
- for(new slot; slot<13; slot++)
- {
- if(weaponslotused[slot])
- {
- 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]);
- }
- }
- }
- format(String1, sizeof String1, "%s\n", String1); //new line
- if(Acces) { format(String1, sizeof String1, "%s{%x}Health:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveHealthStr); }
- if(Acces) { format(String1, sizeof String1, "%s{%x}Armour:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveArmourStr); }
- format(String1, sizeof String1, "%s{%x}Money:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerMoney[giveplayerid]);
- format(String1, sizeof String1, "%s{%x}Score:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerScore[giveplayerid]);
- format(String1, sizeof String1, "%s{%x}Round Score:{%x}\t%s\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveRoundScoreStr);
- format(String1, sizeof String1, "%s{%x}Kills:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerKills[giveplayerid]);
- format(String1, sizeof String1, "%s{%x}Deaths:{%x}\t\t%i\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, PlayerDeaths[giveplayerid]);
- format(String1, sizeof String1, "%s{%x}Round kills:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveRoundKillsStr);
- format(String1, sizeof String1, "%s{%x}Round deaths:{%x}\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, GiveRoundDeathsStr);
- format(String1, sizeof String1, "%s{%x}Ratio:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, RatioStr);
- format(String1, sizeof String1, "%s{%x}Round Ratio:{%x}\t%s\n\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, RoundRatioStr);
- format(String1, sizeof String1, "%s{%x}Status:{%x}\t\t%s\n", String1, COLOR_DIALOG_TEXT1, COLOR_DIALOG_TEXT2, Status);
- ShowPlayerDialog(playerid, 10, 0, Caption, String1, "ok", "");
- }
- else
- {
- PlayerPlaySound(playerid, ErrorSound, 0.0, 0.0, 0.0);
- SendInfoText(playerid, 3000, 149, "~r~That_player_isn't_connected.");
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment