/makeadmin, small problem.
#5

pawn Код:
CMD:makeadmin(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 1;

    new id, level, file[128];
    if(sscanf(params, "ri", id, level)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level 1-4]");


    //You need to format file here with the file path for their user data.
    format(file, sizeof(file), "Filepath/here");

    if(fexist(file))
    {
        format(file, sizeof(file), "You have been promoted to admin level %i!", level);
        SendClientMessage(playerid, COLOR_YELLOW, file);

        PlayerInfo[playerid][pAdminLevel] = level;
        dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][pAdminLevel]);
    }
    else SendClientMessage(playerid, 0xCC0000AA, "This user isn't registered!");
    return 1;
}
You don't need any elseifs at all really.
Reply


Messages In This Thread
/makeadmin, small problem. - by zClaw - 31.05.2013, 14:52
Re: /makeadmin, small problem. - by GiamPy. - 31.05.2013, 14:55
Re: /makeadmin, small problem. - by zClaw - 31.05.2013, 14:57
Re: /makeadmin, small problem. - by GiamPy. - 31.05.2013, 14:59
Re: /makeadmin, small problem. - by [ABK]Antonio - 31.05.2013, 15:05
Re: /makeadmin, small problem. - by zClaw - 31.05.2013, 15:45
Re: /makeadmin, small problem. - by Konstantinos - 31.05.2013, 15:47
Re: /makeadmin, small problem. - by [ABK]Antonio - 31.05.2013, 15:48
Re: /makeadmin, small problem. - by zClaw - 31.05.2013, 19:28
Re: /makeadmin, small problem. - by RalphHaro - 31.05.2013, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)