/makeadmin command Help
#1

The problem is that the message is not appearing rite.
How can someone fix it where it shows the correct Value and Correct Name like it does in the first msg
Screen:
Код:
CMD:makeadmin(playerid, params[])
{
	new levels, adminname[MAX_PLAYER_NAME],playername[MAX_PLAYER_NAME],string[128],targetid;
	if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 6) return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
	if(sscanf(params,"ui", targetid, levels)) return SCM(playerid, COLOR_FADE1, "CMD:makeadmin [Playerid] [Level]");
	if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "invalid player id");
	if(levels > 6) return SCM(playerid, COLOR_RED, "Levels Available 1-6");
	GetPlayerName(playerid,adminname, MAX_PLAYER_NAME);
	GetPlayerName(targetid,playername, MAX_PLAYER_NAME);
	if(levels == 0)
	{
	    format(string, sizeof(string), "%s have set your Admin level to %d.",adminname,levels);
	    SCM(targetid, COLOR_LIGHTBLUE,string);
	    format(string, sizeof(string), "You have set %s's Admin level to %d.",playername,levels);
	    SCM(playerid, COLOR_LIGHTBLUE,string);
	    PlayerInfo[targetid][pAdmin] = levels;
	    return 1;
 	}
 	format(string, sizeof(string), "%s have promoted you to Admin level to %d.",adminname, levels);
 	SCM(targetid, COLOR_LIGHTBLUE,string);
	format(string, sizeof(string), "You have promoted %'s Admin level to %d.",playername, levels);
	SCM(playerid, COLOR_LIGHTBLUE,string);
	PlayerInfo[targetid][pAdmin] = levels;
	return 1;
}
Reply
#2

I fixed the Name msg now the levels is still coming up at 86, any reason or help why? it only does it when i promote someone thats lvl 1 or higher
Reply
#3

Closed the thread i fixed it
Reply
#4

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new levels, adminname[MAX_PLAYER_NAME],playername[MAX_PLAYER_NAME],string[128],targetid;
    if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 6) return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
    if(sscanf(params,"ui", targetid, levels)) return SCM(playerid, COLOR_FADE1, "CMD:makeadmin [Playerid] [Level]");
    if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "invalid player id");
    if(levels > 6) return SCM(playerid, COLOR_RED, "Levels Available 1-6");
    GetPlayerName(playerid,adminname, MAX_PLAYER_NAME);
    GetPlayerName(targetid,playername, MAX_PLAYER_NAME);
    if(levels == 0)
    {
        format(string, sizeof(string), "%s have set your Admin level to %d.",adminname,levels);
        SCM(targetid, COLOR_LIGHTBLUE,string);
        format(string, sizeof(string), "You have set %s's Admin level to %d.",playername,levels);
        SCM(playerid, COLOR_LIGHTBLUE,string);
        PlayerInfo[targetid][pAdmin] = levels;
        return 1;
    }
    format(string, sizeof(string), "%s have promoted you to Admin level to %d.",adminname, levels);
    SCM(targetid, COLOR_LIGHTBLUE,string);
    format(string, sizeof(string), "You have promoted %s's Admin level to %d.",playername, levels);
    SCM(playerid, COLOR_LIGHTBLUE,string);
    PlayerInfo[targetid][pAdmin] = levels;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)