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
#2

Do you mean server crash? If so, load crashdetect plugin for more details.
Reply
#3

Maybe some of files or folders of server not created or deleted? This cause closing server sometimes
Just check them, if everything fine it may be another problem
Reply
#4

pawn Код:
CMD:stats(playerid,params[])
{
    new id, h, m, d;
    new pName[24], pName2[24];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, whitestamp, "{FFFF00}Usage: /stats <Player ID/Part of Name>");
    GetPlayerName(playerid, pName, sizeof(pName)), GetPlayerName(id, pName2, sizeof(pName));
    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
#5

Sorry but it still close the server if I do target someone's id. The only reason the server close is becuase of this command nothing else. Hope to fix this. thanks!
Reply
#6

If the server gets crashed when you type that command, then download and load crashdetect. The link can be found on my previous post (above).

Load the plugin and run your server, execute the command with someone's ID and show us what it printed in the console/server log (if it crashed).
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If the server gets crashed when you type that command, then download and load crashdetect. The link can be found on my previous post (above).

Load the plugin and run your server, execute the command with someone's ID and show us what it printed in the console/server log (if it crashed).
I got the following after I do the command that crash my server.

Код:
[21:16:38] [debug] AMX backtrace:
[21:16:38] [debug] #0 native strcat () [004063a0] from samp-server.exe
[21:16:38] [debug] #1 00083d10 in public cmd_stats (0x00000000, 0x01146e7c) from JLadmin.amx
[21:16:38] [debug] #2 native CallLocalFunction () [00471ef0] from samp-server.exe
[21:16:38] [debug] #3 00016664 in ?? (0x00000000, 0x01146e58) from JLadmin.amx
[21:16:38] [debug] #4 00005a6c in public OnPlayerCommandText (0x00000000, 0x01146e58) from JLadmin.amx
[21:16:38] [debug] Native backtrace:
[21:16:38] [debug] #0 004063ee in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
[21:16:38] [debug] #1 66a45f2a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #2 66a4822e in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #3 66a3ff6f in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #4 66a45f7a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #5 004721fe in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
[21:16:38] [debug] #6 004010b6 in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
[21:16:38] [debug] #7 66a45f2a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #8 66a4822e in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #9 66a3ff6f in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #10 66a45f7a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:16:38] [debug] #11 0046a798 in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
Reply
#8

Okay. One last thing please to help us find the problem faster.

Goto pawno directory and create a file pawn.cfg
Open it and write in it:
pawn Код:
-d3
Save it and re-compile JLadmin.pwn
Run your server and type the command again with someone's ID.

Let's now hope, it will give the line caused it or more information related to the crash.
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Okay. One last thing please to help us find the problem faster.

Goto pawno directory and create a file pawn.cfg
Open it and write in it:
pawn Код:
-d3
Save it and re-compile JLadmin.pwn
Run your server and type the command again with someone's ID.

Let's now hope, it will give the line caused it or more information related to the crash.
Result.. EDIT: you are just awesome man

Код:
[21:25:11] [debug] AMX backtrace:
[21:25:11] [debug] #0 native strcat () [004063a0] from samp-server.exe
[21:25:11] [debug] #1 000a01d8 in public cmd_stats (playerid=0, params[]=@0x01146e7c "0") at D:\Compressed\SA-MP Files Servers\test\filterscripts\JLadmin.pwn:11095
[21:25:11] [debug] #2 native CallLocalFunction () [00471ef0] from samp-server.exe
[21:25:11] [debug] #3 0001a968 in ?? (... <2 arguments>) at D:\Compressed\SA-MP Files Servers\test\pawno\include\zcmd.inc:110
[21:25:11] [debug] #4 00006a9c in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x01146e58 "/stats 0") at D:\Compressed\SA-MP Files Servers\test\pawno\include\YSI\y_hooks/impl.inc:918
[21:25:11] [debug] Native backtrace:
[21:25:11] [debug] #0 004063ee in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
[21:25:11] [debug] #1 6af75f2a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #2 6af7822e in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #3 6af6ff6f in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #4 6af75f7a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #5 004721fe in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
[21:25:11] [debug] #6 004010b6 in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
[21:25:11] [debug] #7 6af75f2a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #8 6af7822e in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #9 6af6ff6f in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #10 6af75f7a in ?? () from D:\Compressed\SA-MP Files Servers\test\plugins\crashdetect.DLL
[21:25:11] [debug] #11 0046a798 in ?? () from D:\Compressed\SA-MP Files Servers\test\samp-server.exe
Reply
#10

Show us the line 11095 from JLadmin.pwn

This is the line crashes the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)