Hi /makeadmin problem
#1

Hi iv'e a problem /makeadmin command makes my server crash i don't know how does it happen. Here is the code of the cmd
Код:
CMD:makeadmin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GRAD1, "Stop!");
    new giveid, admlvl, str[128];
	if(sscanf(params, "ui", giveid, admlvl)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [1-6]");
	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [1-6]");
	PlayerInfo[giveid][pAdmin] = admlvl;
	format(str, sizeof(str), "%s has been made a level %i admin by %s.", GetName(giveid), PlayerInfo[giveid][pAdmin], GetName(playerid));
	SendClientMessageToAdmins(COLOR_LIGHTRED, str, 1);
	Log("logs/makeadmin.txt", str);
    return 1;
}
Reply
#2

Quote:
Originally Posted by Kefir
Посмотреть сообщение
Hi iv'e a problem /makeadmin command makes my server crash i don't know how does it happen. Here is the code of the cmd
Код:
CMD:makeadmin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GRAD1, "Stop!");
    new giveid, admlvl, str[128];
	if(sscanf(params, "ui", giveid, admlvl)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [1-6]");
	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [1-6]");
	PlayerInfo[giveid][pAdmin] = admlvl;
	format(str, sizeof(str), "%s has been made a level %i admin by %s.", GetName(giveid), PlayerInfo[giveid][pAdmin], GetName(playerid));
	SendClientMessageToAdmins(COLOR_LIGHTRED, str, 1);
	Log("logs/makeadmin.txt", str);
    return 1;
}
Make sure in the server scriptfiles that the Logs folder is in there and make sure you have makeadmin.txt aswell.
Reply
#3

It has to do with your Log function most likely, post it here.
Reply
#4

Well i looked at the logs folder there is chat.txt cmd.txt moneytrace.txt i added the makeadmin.txt still it crashes.
And in cmd.txt there is no makeadmin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)