/makeadmin cmd
#1

So I found a /makeadmin cmd. When I type this, it doesn't response..It just appears the same message.



Код:
CMD:makeadmin(playerid, params[])
{
	if(pInfo[playerid][AdminLevel] >= 6 || IsPlayerAdmin(playerid))
	{
		new id, level, string[126];

		if(sscanf(params, "ud", id, level))
			return SendClientMessage(playerid, -1, "Syntax: /makeadmin [playerid] [level]");

		if(pInfo[playerid][AdminLevel] > pInfo[id][AdminLevel])
		{
			pInfo[id][AdminLevel] = level;

			format(string, sizeof(string), "%s has made you admin level %d", GetNameEx(playerid), level);
			SendClientMessage(id, -1, string);

			format(string, sizeof(string), "You have made %s an admin level %d", GetNameEx(id), level);
			SendClientMessage(playerid, -1, string);
		}
	}
	return 1;
}
Reply
#2

try to change from
PHP код:
if(sscanf(params"ud"idlevel))
            return 
SendClientMessage(playerid, -1"Syntax: /makeadmin [playerid] [level]"); 
To
PHP код:
if( sscanf params"ud"idlevel)) return SendClientMessage(playerid,-1"[PlayerID/PartOfName] [adminlvl]"); 
Reply
#3

PHP код:
COMMAND:makeadmin(playeridparams[])
{
    if(
GetAdminLevel(playerid) < 11 && !IsPlayerAdmin(playerid)) return SendClientError(playeridCANT_USE_CMD);
    new 
iPlayeriLevel;
    if( 
sscanf params"ud"iPlayeriLevel)) return SCP(playerid"[PlayerID/PartOfName] [adminlvl]");
    if(!
IsPlayerConnected(iPlayer)) return SendClientError(playeridPLAYER_NOT_FOUND);
    
pInfo[playerid][AdminLevel] = iLevel
    SendClientMSG
(playeridCOLOR_WHITE"Player %s (%d) is now admin level %d!"RPName(iPlayer), iPlayeriLevel);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)