SA-MP Forums Archive
/makeadmin command Help - 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: /makeadmin command Help (/showthread.php?tid=443458)



/makeadmin command Help - San1 - 12.06.2013

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



Re: /makeadmin command Help - San1 - 12.06.2013

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


Re: /makeadmin command Help - San1 - 12.06.2013

Closed the thread i fixed it


Respuesta: /makeadmin command Help - JustBored - 12.06.2013

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