SA-MP Forums Archive
Hi /makeadmin problem - 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: Hi /makeadmin problem (/showthread.php?tid=438483)



Hi /makeadmin problem - [L]azy[H]aze - 20.05.2013

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;
}



Re: Hi /makeadmin problem - seanny - 20.05.2013

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.


Re: Hi /makeadmin problem - SuperViper - 20.05.2013

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


Re: Hi /makeadmin problem - [L]azy[H]aze - 20.05.2013

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