ZCMD Makeadmin
#1

So I figured somehow out this code:
pawn Код:
COMMAND:makeadmin(playerid, params[])
    {
            tmp = strtok(params, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREY, "[USAGE:] /makeadmin [playerid] [adminlevel]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(params, idx);
            level = strval(tmp);
            if (PlayerInfo[playerid][pAdminLevel] >= 5 || IsPlayerAdmin(playerid))
            {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        PlayerInfo[para1][pAdminLevel] = level;
                        new name[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, name, sizeof(name));
                        new string[128];
                        format(string, sizeof(string), "[INFO:] %s has just made you administrator level: %d.", name,level);
                        SendClientMessage(para1, COLOR_WHITE, string);
                        format(string, sizeof(string), "[INFO:] You have made %s an administrator - Level: %d.", name,level);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                    }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "[ERROR:] Your not an administrator/correct level.");
            }
        return 1;
    }
Now I know where the problem itself SHOULD be:
pawn Код:
tmp = strtok(params, idx);
What should i replace params with? Using zcmd and sscanf. By the way if I do /makeadmin it keeps telling me the form how to do it.
Reply


Messages In This Thread
ZCMD Makeadmin - by Spiral - 11.02.2011, 19:27
Re: ZCMD Makeadmin - by admantis - 11.02.2011, 19:31
Re: ZCMD Makeadmin - by Spiral - 11.02.2011, 19:37

Forum Jump:


Users browsing this thread: 1 Guest(s)