SA-MP Forums Archive
OnPlayerUpdate - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerUpdate (/showthread.php?tid=418898)



OnPlayerUpdate - MiGu3X - 26.02.2013

Is it possible to update Admin Level? Cauz when i do /setlevel 0 5 the level for the player doesn't get's saved. maybe i need to add sth in OnPlayerupdate? please help me...

Here: SetLevel of me

pawn Код:
CMD:setlevel(playerid, params[])
{
    new levels,str[128],ID;
    if(!IsPlayerAdmin(playerid)) return 0;
    if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid, DEEPPINK, "USAGE: /setlevel <ID> <Level 1-5>");
    if(levels > 5) return SendClientMessage(playerid, DEEPPINK,"ERROR: Levels Available 1-5");
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid, DEEPPINK,"ERROR: Player is not connected.");
    if(PlayerInfo[playerid][pAdmin] == levels) return SendClientMessage(playerid, DEEPPINK, "ERROR: Player is already this admin level.");

    new lvl = PlayerInfo[playerid][pAdmin];

    if(levels < lvl)
        GameTextForPlayer(ID, "~y~DEMOTED", 3000, 4);
    else
        GameTextForPlayer(ID, "~g~PROMOTED", 3000, 4);

    format(str, sizeof(str),"%s has set your Admin level to %d.",GetName(playerid),levels);
    SendClientMessage(ID,GREEN,str);
    format(str, sizeof(str),"You have set %s's Admin level to %d.",GetName(ID),levels);
    SendClientMessage(playerid,ORANGE,str);
    PlayerInfo[playerid][pAdmin] = levels;
    return 1;
}



Re: OnPlayerUpdate - mittukuttan - 26.02.2013

save it in dini folder


Re: OnPlayerUpdate - Scrillex - 26.02.2013

Quote:
Originally Posted by mittukuttan
Посмотреть сообщение
save it in dini folder
LOL it ain't dini.. it is using ini...

Something with this.. now I will try to find the thing..
PlayerInfo[playerid][pAdmin] = levels;