SA-MP Forums Archive
Help! - 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: Help! (/showthread.php?tid=400182)



Help! - Rayansh - 17.12.2012

guys i am using mAdmin script and i got some problems in
some cmds like /setlevel for make admin and /setvip when i use
/setlevel id level and didnt saving players with admin level and
vip have same prob i got this got please fix it

this is for admin

pawn Код:
CMD:setlevel(playerid, params[])
{
    new id, lvl, string[128], string2[128];
    if(IsPlayerAdmin(playerid) || AdminLevel[playerid] >= 4)
    {
        if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setlevel [ID] [Level]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid ID");
        else if(lvl > 5) return SendClientMessage(playerid, COLOR_RED, "There is only 5 admin levels");
        else
        AdminLevel[id] = lvl;
        format(string, sizeof(string), "Administrator %s has set you your admin level to %d!", GetName(playerid), lvl);
        SendClientMessage(id, COLOR_AQUA, string);
        format(string2, sizeof(string2), "You have set %s as admin level %d!", GetName(id), lvl);
        SendClientMessage(playerid, COLOR_AQUA, string2);
    }
    else SendClientMessage(playerid, COLOR_RED, "You are not authorized for use this command!");
    return 1;
}
this is for vip
pawn Код:
CMD:setvip(playerid, params[])
{
    new id, lvl, string[128], string2[128];
    if(IsPlayerAdmin(playerid) || AdminLevel[playerid] >= 3)
    {
        if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setvip [ID] [Level]");
        else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid ID");
        else if(lvl > 3) return SendClientMessage(playerid, COLOR_RED, "There is only 3 vip levels");
        else
        vip[id] = lvl;
        format(string, sizeof(string), "Administrator %s has set your VIP level to %d!", GetName(playerid), lvl);
        SendClientMessage(id, COLOR_PINK, string);
        format(string2, sizeof(string2), "You have set %s VIP level to %d!", GetName(id), lvl);
        SendClientMessage(playerid, COLOR_PINK, string2);
    }
    else SendClientMessage(playerid, COLOR_RED, "You are not authorized for use this command!");
    return 1;
}



Re: Help! - David (Sabljak) - 17.12.2012

Onplayerdisconnect?

INI_WriteInt(File, "AdminLevel",PlayerInfo[playerid][AdminLevel]);

INI_WriteInt(File, "vip",PlayerInfo[playerid][vip]);

?