30.05.2010, 12:28
pawn Код:
dcmd_stats(playerid, params[])
{
new pName[24], PlayerFile[50], str[128], pDeaths[50], pKills[50];
GetPlayerName(playerid, pName, sizeof(pName));
format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);
if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "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");
new Float:Ratio=floatdiv(pKills[24], pDeaths[24]);
format(str, sizeof(str), "Deaths: %d || Kills: %d || Ratio: %.2f", pDeaths[24], pKills[24], Ratio);
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 moderator on the server.");
}
if(PlayerInfo[playerid][AdminLevel] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You are an administrator on the server.");
}
if(PlayerInfo[playerid][AdminLevel] == 3)
{
SendClientMessage(playerid, COLOR_WHITE, "You are a management member on the server.");
}
}
#pragma unused params
return 1;
}
What are the error messages?