/setadmin problem.
#7

you may try:

pawn Код:
CMD:setadmin(playerid, params[])
{
    new pID, value;
    if(PlayerInfo[playerid][pAdmin] < 1338 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, NOTADMIN);
    else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, 0xFF0000AA, "Kasutus: /setadmin [playerid/partofname] [level 1-1338]"); //how to use it.
    else if (value < 0 || value > 1338) return SendClientMessage(playerid, 0xFF0000AA, "Vale level! Levelid: 0-1338"); //wrong level
    else
    {
        if(IsPlayerConnected(playerid)) {
            new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            GetPlayerName(pID, tName, MAX_PLAYER_NAME);
            format(string, sizeof(string), "Sa muutsid %s'i admini leveli %i peale.", tName, value); //you changed %s's alevel to %i.
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(string, sizeof(string), "Su adminlevel on nььd %i.", value); //your adminlevel is...
            SendClientMessage(pID, COLOR_WHITE, string);
            PlayerInfo[pID][pAdmin] = value;
        }
        else {
            return SendClientMessage(playerid, COLOR_GREY,"Vale ID."); //wrong id
        }
    }
    return 1;
}
Reply


Messages In This Thread
/setadmin problem. - by vent - 01.01.2012, 10:37
Re: /setadmin problem. - by rinori - 01.01.2012, 10:52
Re: /setadmin problem. - by vent - 01.01.2012, 10:56
Re: /setadmin problem. - by fordawinzz - 01.01.2012, 11:49
Re: /setadmin problem. - by Arnold_Collins - 01.01.2012, 12:24
Re: /setadmin problem. - by Artix - 01.01.2012, 12:48
Re: /setadmin problem. - by BrandyPenguin - 01.01.2012, 13:37
Re: /setadmin problem. - by vent - 01.01.2012, 19:42
Re: /setadmin problem. - by Face9000 - 01.01.2012, 19:45

Forum Jump:


Users browsing this thread: 1 Guest(s)