Setadmin help
#1

The CMD doesnt work for RCON but also does not display error messages
Код:
COMMAND:setadminlevel(playerid, params[])
{
	if(IsPlayerAdmin(playerid)){
 		new targetid, level;
 		if(sscanf(params, "ui", targetid, level)) return SendClientMessage(playerid, -1,"USAGE: /setadmin [ID] [LEVEL]");
 		else pInfo[targetid][Adminlevel] = level;
	}else SendClientMessage(playerid, -1,"ERROR: You are not permitted to use this command.");
	return 1;
}
Reply
#2

Basically your sscanf line is messed up

pawn Код:
COMMAND:setadminlevel(playerid, params[])
{
    new targetid, level;
    if(!sscanf(params, "ui", targetid, level)) return SendClientMessage(playerid, -1, "USAGE: /setadminlevel [ID] [LEVEL]");
    if(IsPlayerAdmin(playerid))
    {
        pInfo[targetid][Adminlevel] = level;
        // HI YOU MADE SOMEONE ADMIN
    }
    else return SendClientMessage(playerid, -1, "ERROR: You are not permitted to use this command.");
    return 1;
}
Try that, report any errors/problems
Reply
#3

Quote:
Originally Posted by MikeLovesToHelp
Посмотреть сообщение
Basically your sscanf line is messed up

pawn Код:
COMMAND:setadminlevel(playerid, params[])
{
    new targetid, level;
    if(!sscanf(params, "ui", targetid, level)) return SendClientMessage(playerid, -1, "USAGE: /setadminlevel [ID] [LEVEL]");
    if(IsPlayerAdmin(playerid))
    {
        pInfo[targetid][Adminlevel] = level;
        // HI YOU MADE SOMEONE ADMIN
    }
    else return SendClientMessage(playerid, -1, "ERROR: You are not permitted to use this command.");
    return 1;
}
Try that, report any errors/problems
Thanks ! REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)