SA-MP Forums Archive
Server crash. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server crash. (/showthread.php?tid=611861)



Server crash. - canip0000 - 11.07.2016

pawn Код:
CMD:unban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new path[36], string[128], integer;
        if (isnull(params)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /unban [Account name]");
        format(path, sizeof(path), "Users/%s.ini", params);
        if(!fexist(path)) return SendClientMessage(playerid, COLOR_LIGHTRED, "[ ! ]{FFFFFF} User is not registered!");
        new INI:files = INI_Open(path);
        INI_SetTag(files,"data");
        INI_WriteInt(files, "Banned", 0);
        INI_Close(files);
//      format(string, sizeof(string), "%s has been unbanned by %s", File, GetName(playerid));
        SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: Community member %s has been successfully unbanned. Player stats reloaded & saved.");
    }
    else return SendClientMessage(playerid, COLOR_LIGHTRED, "[ ! ] You don't have access to this command. (Game Admins +1)");
    return 1;
}
My server is crashing whenever I try to unban a offline player. Any clues why?


Re: Server crash. - DarkSkull - 11.07.2016

Show you server log.


Re: Server crash. - Mencent - 11.07.2016

Hello!

Take the crashdetect plugin to get more information about the crash.
(https://sampforum.blast.hk/showthread.php?tid=262796)


Re: Server crash. - Konstantinos - 11.07.2016

Код:
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: Community member %s has been successfully unbanned. Player stats reloaded & saved.");
Using specifiers directly in client messages without format results to server crash.

---

On another note (in case you want to use it later), in the commented line says "File" instead of "params"


Re: Server crash. - canip0000 - 11.07.2016

Thanks guys!