01.06.2010, 13:34
Little problem again. I dunno how to fix the problem that I only can see my stats. I want to see the stats from other players.
I also donґt know how to add that I must use /stats [ID] when I type something wrong.
Well, it seems easy I know. I only canґt find it. Maybe I am to tired
I also donґt know how to add that I must use /stats [ID] when I type something wrong.
Код:
dcmd_stats(playerid, params[])
{
new pName[24], PlayerFile[50], str[128], pDeaths[50], pKills[50], pMoney[50];
GetPlayerName(playerid, pName, sizeof(pName));
format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);
if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You aren't registered! Use /register to create an account.");
if(dini_Exists(PlayerFile))
{
pDeaths[24] = dini_Int(PlayerFile, "Deaths");
pKills[24] = dini_Int(PlayerFile, "Kills");
pMoney[24] = dini_Int(PlayerFile, "Money");
new Float:Ratio=floatdiv(pKills[24], pDeaths[24]);
format(str, sizeof(str), " ||%sґs Statistics ||", pName);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str, sizeof(str), "(Money): Money: %d", pMoney[24]);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str, sizeof(str), "(Stats): Kills: %d || Deaths: %d || Ratio: %.2f || Money: %d", pKills[24], pDeaths[24], Ratio, pMoney[24]);
SendClientMessage(playerid, COLOR_WHITE, str);
if(PlayerInfo[playerid][AdminLevel] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "You are a player on the server.");
}
if(PlayerInfo[playerid][AdminLevel] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You are a Administrator Level 1 on the server.");
}
if(PlayerInfo[playerid][AdminLevel] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You are an Administrator Level 2 on the server.");
}
if(PlayerInfo[playerid][AdminLevel] == 3)
{
SendClientMessage(playerid, COLOR_WHITE, "You are a Administrator Level 3 on the server.");
}
}
#pragma unused params
return 1;
}

