PDA

View Full Version : Server crash.


canip0000
11/07/2016, 06:15 PM
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?

DarkSkull
11/07/2016, 06:22 PM
Show you server log.

Mencent
11/07/2016, 06:29 PM
Hello!

Take the crashdetect plugin to get more information about the crash.
(http://forum.sa-mp.com/showthread.php?t=262796)

Konstantinos
11/07/2016, 06:31 PM
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"

canip0000
11/07/2016, 06:41 PM
Thanks guys!