Server crash.
#1

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

Show you server log.
Reply
#3

Hello!

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

Код:
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"
Reply
#5

Thanks guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)