Command Problem !
#1

I have a problem in /setlevel cmd. When i log in to rcon and writes /setlevel 0(my id) 5(level) it says player is not connected.
here is the command↓

pawn Код:
CMD:setlevel(playerid, params[])
{
    new targetid, level, string[100];
    if(pInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "[ERROR] You are not authorised to use this command");
    if(sscanf(params, "ud", targetid, level)) return SCM(playerid, COLOR_RED, "[USAGE] /setlevel <playerid/part of name> <level>");
    if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected");
    pInfo[targetid][pAdmin] = level;
    format(string, sizeof(string), "Admin %s has set your admin level to %d", GetName(playerid), level);
    SCM(targetid, COLOR_GREEN, string);
    format(string, sizeof(string), "You have successfully set %s's level to %d", GetName(targetid), level);
    SCM(playerid, COLOR_GREEN, string);
    return 1;
}
help me plz..
Reply
#2

pawn Код:
CMD:setlevel(playerid, params[])
{
    new targetid, level, string[100];
    if(pInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "[ERROR] You are not authorised to use this command");
    if(sscanf(params, "ud", targetid, level)) return SCM(playerid, COLOR_RED, "[USAGE] /setlevel <playerid/part of name> <level>");
    if(IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected");
    pInfo[targetid][pAdmin] = level;
    format(string, sizeof(string), "Admin %s has set your admin level to %d", GetName(playerid), level);
    SCM(targetid, COLOR_GREEN, string);
    format(string, sizeof(string), "You have successfully set %s's level to %d", GetName(targetid), level);
    SCM(playerid, COLOR_GREEN, string);
    return 1;
}
Try this
Reply
#3

must work dude

Код:
CMD:setlevel(playerid, params[])
{
    new targetid, level, string[100];
    if(pInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "[ERROR] You are not authorised to use this command");
    if(sscanf(params, "ud", targetid, level)) return SCM(playerid, COLOR_RED, "[USAGE] /setlevel <playerid/part of name> <level>");
    if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected");
if(level < 1 || level > 5) return SCM(playerid, COLOR_RED, "The range of levels is 1 - 5");
else
{
    pInfo[targetid][pAdmin] = level;
    format(string, sizeof(string), "Admin %s has set your admin level to %d", GetName(playerid), level);
    SCM(targetid, COLOR_GREEN, string);
    format(string, sizeof(string), "You have successfully set %s's level to %d", GetName(targetid), level);
    SCM(playerid, COLOR_GREEN, string);
}
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)