Problem with sscanf and zcmd
#1

Hi
I am trying to make an admin system
so i added a command called "/adminlevel" to set the admin level of player
but i am having problem
when i do the command it's just show the error syntex i mean correct usage.....

CODE:
Код:
CMD:adminlevel(playerid, params[])
{
		if(PlayerInfo[playerid][pAdmin] < 3&& !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not an admin.");
			new targetid,level;
			if(sscanf(params,"ui", targetid,level)) return SendClientMessage(playerid, COLOR_RED,"Correct usage: /adminlevel [PlayerID] [Level]");
			if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED,"That player is not connected to the server!");
			if(level <4)
			{
				PlayerInfo[targetid][pAdmin] = level;
				new msg[126],aname[MAX_PLAYER_NAME];
				GetPlayerName(playerid,aname,sizeof(aname));
				format(msg,sizeof(msg),"Admin ~r~%s ~w~Set You To Admin Level ~b~%i",aname,level);
				GameTextForPlayer(playerid, msg, 5000, 5);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED,"Level Must Be Between 1-3");
			}
		return 1;
}
Reply


Messages In This Thread
Problem with sscanf and zcmd - by akib - 05.05.2017, 02:59
Re: Problem with sscanf and zcmd - by akib - 05.05.2017, 03:03
Re: Problem with sscanf and zcmd - by Dayrion - 05.05.2017, 03:54
Re: Problem with sscanf and zcmd - by akib - 05.05.2017, 03:58
Re: Problem with sscanf and zcmd - by Hreesang - 05.05.2017, 04:02
Re: Problem with sscanf and zcmd - by Dayrion - 05.05.2017, 04:34
Re: Problem with sscanf and zcmd - by akib - 05.05.2017, 04:37
Re: Problem with sscanf and zcmd - by Dayrion - 05.05.2017, 04:38

Forum Jump:


Users browsing this thread: 1 Guest(s)