Code:
DisplayStats(playerid, targetid = INVALID_PLAYER_ID)
{
if(targetid == INVALID_PLAYER_ID) targetid = playerid;
new name[24], gender[8], faction[48], facrank[32], gang[32], gangrank[32], division[32], Float:health, Float:armor, Float:maxarmor;
if(playerid == MAX_PLAYERS)
{
strcpy(name, PlayerInfo[playerid][pUsername]);
}
else
{
strcat(name, GetPlayerRPName(playerid));
}
if(PlayerInfo[playerid][pGender] == 1) gender = "Male";
else if(PlayerInfo[playerid][pGender] == 2) gender = "Female";
if(PlayerInfo[playerid][pFaction] >= 0)
{
strcpy(faction, FactionInfo[PlayerInfo[playerid][pFaction]][fName]);
strcpy(facrank, FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]]);
if(PlayerInfo[playerid][pDivision] >= 0)
{
strcpy(division, FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]]);
}
else
{
division = "None";
}
}
else
{
faction = "None";
facrank = "N/A";
division = "None";
}
if(PlayerInfo[playerid][pGang] >= 0)
{
strcpy(gang, GangInfo[PlayerInfo[playerid][pGang]][gName]);
strcpy(gangrank, GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]]);
}
else
{
gang = "None";
gangrank = "N/A";
}
switch(PlayerInfo[playerid][pVIPPackage])
{
case 0:
maxarmor = 100.0;
case 1, 2:
maxarmor = 125.0;
case 3:
maxarmor = 150.0;
}
if(playerid == MAX_PLAYERS)
{
health = PlayerInfo[playerid][pHealth];
armor = PlayerInfo[playerid][pArmor];
}
else
{
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armor);
}
new string[1024];
format(string, sizeof(string),"{00BFFF}|____ %s's statistics on Liberty City Roleplay [%s] ____|\n", name, GetDate());
format(string, sizeof(string),"%s{00BFFF}[Account]{B4B5B7}Level: %i - Gender: %s - Age: %i - Cash: $%i - Bank: $%i - Hours: %i - Ph: %i\n", string, PlayerInfo[playerid][pLevel], gender, PlayerInfo[playerid][pAge], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pBank], PlayerInfo[playerid][pHours], PlayerInfo[playerid][pPhone]);
format(string, sizeof(string),"%s{00BFFF}[Details]{B4B5B7}Total Wealth: $%i - Experience: %i/%i - Next Level: $%i - Upgrade Points: %i\n", string, PlayerInfo[playerid][pCash] + PlayerInfo[playerid][pBank], PlayerInfo[playerid][pEXP], (PlayerInfo[playerid][pLevel] * 4), (PlayerInfo[playerid][pLevel] + 1) * 5000, PlayerInfo[playerid][pUpgradePoints]);
format(string, sizeof(string),"%s{00BFFF}[Details]{B4B5B7}Inventory Upgrade: %i/5 - Addict Upgrade: %i/3 - Trader Upgrade: %i/3 - Asset Upgrade: %i/4\n", string, PlayerInfo[playerid][pInventoryUpgrade], PlayerInfo[playerid][pAddictUpgrade], PlayerInfo[playerid][pTraderUpgrade], PlayerInfo[playerid][pAssetUpgrade]);
format(string, sizeof(string),"%s{00BFFF}[Records]{B4B5B7}Job: %s - Job Level: %i - Crimes Commited: %i - Arrested: %i - Wanted Level: %i\n", string, GetJobName(PlayerInfo[playerid][pJob]), GetJobLevel(playerid, PlayerInfo[playerid][pJob]), PlayerInfo[playerid][pCrimes], PlayerInfo[playerid][pArrested], PlayerInfo[playerid][pWantedLevel]);
format(string, sizeof(string),"%s{00BFFF}[Records]{B4B5B7}Warnings: %i - Spawn Health: %.1f/100.0 - Spawn Armor: %.1f/%.1f - Jail Time: %i seconds\n", string, PlayerInfo[playerid][pWarnings], PlayerInfo[playerid][pSpawnHealth], PlayerInfo[playerid][pSpawnArmor], maxarmor, PlayerInfo[playerid][pJailTime]);
format(string, sizeof(string),"%s{00BFFF}[Records]{B4B5B7}Faction: %s - Rank: %s (%i) - Division: %s - Gang: %s - Rank: %s (%i)\n", string, faction, facrank, PlayerInfo[playerid][pFactionRank], division, gang, gangrank, PlayerInfo[playerid][pGangRank]);
format(string, sizeof(string),"%s{00BFFF}[Account]{B4B5B7}Paycheck: $%i - Channel: %i - Cookies: %i - Helper: %s - VIP Package: %s\n", string, PlayerInfo[playerid][pPaycheck], PlayerInfo[playerid][pChannel], PlayerInfo[playerid][pCookies], GetHelperRank(playerid), GetVIPRank(PlayerInfo[playerid][pVIPPackage]));
format(string, sizeof(string),"%s{00BFFF}[Account]{B4B5B7}Second Job: %s - DM Warnings: %i/5 - Report Warnings: %i/3 - Weapon Restriction: %i hours\n", string, GetJobName(PlayerInfo[playerid][pSecondJob]), PlayerInfo[playerid][pDMWarnings], PlayerInfo[playerid][pReportWarns], PlayerInfo[playerid][pWeaponRestricted]);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, " - Statistics - ", string, "OK", "");
if(PlayerInfo[targetid][pAdmin] > 0)
{
SendClientMessageEx(targetid, COLOR_LIGHTRED, "{00BFFF}[Admin Info]{B4B5B7}Interior: %i - Virtual: %i - FPS: %i - AFK: %s - Reports: %i - Help Requests: %i", (playerid == MAX_PLAYERS) ? (PlayerInfo[playerid][pInterior]) : (GetPlayerInterior(playerid)), (playerid == MAX_PLAYERS) ? (PlayerInfo[playerid][pWorld]) : (GetPlayerVirtualWorld(playerid)), (playerid == MAX_PLAYERS) ? (0) : (PlayerInfo[playerid][pFPS]), (playerid == MAX_PLAYERS) ? ("No") : ((PlayerInfo[playerid][pAFK]) ? ("Yes") : ("No")),
PlayerInfo[playerid][pReports], PlayerInfo[playerid][pHelpRequests]);
}
if(playerid == targetid) {
SendClientMessage(targetid, COLOR_LIGHTORANGE, "** For a list of items and their capacities in your inventory, use /(inv)entory.");
} else if(playerid != MAX_PLAYERS) {
SendClientMessageEx(targetid, COLOR_LIGHTORANGE, "** For a list of items and their capacities in their inventory, use /checkinv %i.", playerid);
}
}
Code:
CMD:stats(playerid, params[])
{
DisplayStats(playerid);
return 1;
}
Code:
CMD:check(playerid, params[])
{
new targetid;
if(PlayerInfo[playerid][pAdmin] < 1)
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
if(sscanf(params, "u", targetid))
{
return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /check [playerid]");
}
if(!IsPlayerConnected(targetid))
{
return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected.");
}
if(!PlayerInfo[targetid][pLogged])
{
return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet.");
}
DisplayStats(targetid, playerid);
return 1;
}
Code:
CMD:ocheck(playerid, params[])
{
new name[24];
if(PlayerInfo[playerid][pAdmin] < 1)
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
if(sscanf(params, "s[24]", name))
{
return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /ocheck [username]");
}
mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM users WHERE username = '%e'", name);
mysql_tquery(connectionID, queryBuffer, "OnAdminOfflineCheck", "is", playerid, name);
return 1;
}