server closes when do /stats (target a player)
#1

Hi I don't know why its always close the server when someone do /stats and target the player ID or name. But when I do /stats without any number nor name. It shows my stats and thats good.

Код:
CMD:stats(playerid,params[])
{
    SendClientMessage(playerid, whitestamp, "{FFFF00}Usage: /stats <Player ID/Part of Name>");
    new id, h, m, d;
    new pName[24], pName2[24];
    GetPlayerName(playerid, pName, sizeof(pName)), GetPlayerName(id, pName2, sizeof(pName));
    sscanf(params, "u", id);
    if (isnull(params))
    {
        new str[512];
        new status[2][25] = {"{FF0000}Disabled", "{1AFF00}Enabled{A9C4E4}"};
        new seconds = gettime() - pInfo[playerid][ConnectedTime] + pInfo[playerid][TotalSecs];
        format(JLstring, sizeof(JLstring), "{09F7DF}%s (ID:%d) {09F7DF}", pName, playerid);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\n\nGeneral: {FFFFFF} \nLogged In: %d{FFFFFF} ", pInfo[playerid][Logged]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nAdmin Level: %d", pInfo[playerid][pLevel]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nVIP Level: %d", pInfo[playerid][Donator]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nPing: %d", GetPlayerPing(playerid));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nTime Login: %s {09F7DF}", ConvertTime(seconds,m,h,d));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\n\nScores: {FFFFFF}\nDM Score: %d ", pInfo[playerid][Kills]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nK/D Ratio: %0.2f ", Float:pInfo[playerid][Kills]/Float:pInfo[playerid][Deaths]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nMoney: $%d {09F7DF}", GetPlayerMoney(playerid));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\n\nGame: {FFFFFF}\nVirtual World: %d", GetPlayerVirtualWorld(playerid));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nInterior: %d", GetPlayerInterior(playerid));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nWanted Level: %d", GetPlayerWantedLevel(playerid));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nSkin: %d", GetPlayerSkin(playerid));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nJailed: %d", pInfo[playerid][Jailed]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nMuted: %d", pInfo[playerid][Muted]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nFrozen: %d", pInfo[playerid][Frozen]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nPM's: %s {FFFFFF}", status[GetPVarInt(playerid, "PMEnabled")]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nGo's: %s {FFFFFF}", status[GetPVarInt(playerid, "GotoEnabled")]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nGod: %s", status[GetPVarInt(playerid, "GodMode")]);
        strcat(str, JLstring);
        return ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{09F7DF}AoG - Player Statistics", str, "Close", "");
    }
    else if(IsPlayerConnected(id))
    {
        new seconds = gettime() - pInfo[id][ConnectedTime] + pInfo[id][TotalSecs];
        format(JLstring, sizeof(JLstring), "{09F7DF}%s (ID:%d) {09F7DF}", pName2, id);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\n\nGeneral: {FFFFFF} \nLogged In: %d{FFFFFF} ", pInfo[id][Logged]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nAdmin Level: %d", pInfo[id][pLevel]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nVIP Level: %d", pInfo[id][Donator]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nPing: %d", GetPlayerPing(id));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nTime Login: %s {09F7DF}", ConvertTime(seconds,m,h,d));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\n\nScores: {FFFFFF}\nDM Score: %d ", pInfo[id][Kills]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nK/D Ratio: %0.2f ", Float:pInfo[id][Kills]/Float:pInfo[id][Deaths]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nMoney: $%d {09F7DF}", GetPlayerMoney(id));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\n\nGame: {FFFFFF}\nVirtual World: %d", GetPlayerVirtualWorld(id));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nInterior: %d", GetPlayerInterior(id));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nWanted Level: %d", GetPlayerWantedLevel(id));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nSkin: %d", GetPlayerSkin(id));
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nJailed: %d", pInfo[id][Jailed]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nMuted: %d", pInfo[id][Muted]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nFrozen: %d", pInfo[id][Frozen]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nPM's: %s {FFFFFF}", status[GetPVarInt(id, "PMEnabled")]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nGo's: %s {FFFFFF}", status[GetPVarInt(id, "GotoEnabled")]);
        strcat(str, JLstring);
        format(JLstring, sizeof(JLstring), "\nGod: %s", status[GetPVarInt(id, "GodMode")]);
        strcat(str, JLstring);
        return ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{09F7DF}AoG - Player Statistics",Jstring,"Close","");
    }
    else return ShowPlayerDialog(playerid, DIALOG_STATS2, DIALOG_STYLE_MSGBOX,"{09F7DF}AoG - Player Statistics", "{ffd700}Player is not connected", "Close", "");
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)