Help with dcmd_stats
#4

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]);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(str), "|| % Statistics ||", pName);
        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;
}
That should work
Reply


Messages In This Thread
Help with dcmd_stats - by Flashy - 30.05.2010, 12:24
Re: Help with dcmd_stats - by ~Ricky~ - 30.05.2010, 12:28
Re: Help with dcmd_stats - by Flashy - 30.05.2010, 12:39
Re: Help with dcmd_stats - by ~Ricky~ - 30.05.2010, 16:22
Re: Help with dcmd_stats - by Flashy - 30.05.2010, 16:30
Re: Help with dcmd_stats - by kamalhood - 28.07.2010, 14:59

Forum Jump:


Users browsing this thread: 2 Guest(s)