/setlevel yini
#9

Here is my code
pawn Code:
CMD:setlevel(playerid, params[])
{
    new INI:file = INI_Open(Path(playerid));
    if(!IsPlayerAdmin(playerid)) return 0;
    if(PlayerInfo[playerid][Padmin] < 5) return SendClientMessage(playerid, -1, "Your not a admin");
    new id, lvl, string[128], string2[128], string3[128];
    if(sscanf(params,"us", id , lvl)) return SendClientMessage(playerid, -1, "USAGE: /setlevel <id> <lvl>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Invalid playerid");
    format(string, sizeof(string), "You have set %s admin level to %d", PlayerName(id), lvl);
    SendClientMessage(playerid, -1, string);
    format(string2, sizeof(string), "Your level has been set to %d by %s", lvl, PlayerName(playerid));
    SendClientMessage(id, -1, string2);
    format(string3, sizeof(string), "%s is now admin level %d", PlayerName(id), lvl);
    SendClientMessageToAll(-1, string3);
    PlayerInfo[id][Padmin] = lvl;
    INI_WriteInt(file,"Padmin",lvl);
    INI_Close(file);
    return 1;
}
if i do /setlevel 0 1 it will say i set it to 49 and also it still doesnt write it in the file
Reply


Messages In This Thread
/setlevel yini - by thefatshizms - 07.07.2012, 16:04
Re: /setlevel yini - by zT KiNgKoNg - 07.07.2012, 16:12
Re: /setlevel yini - by coole210 - 07.07.2012, 16:16
Re: /setlevel yini - by thefatshizms - 07.07.2012, 16:19
Re: /setlevel yini - by coole210 - 07.07.2012, 16:21
Re: /setlevel yini - by thefatshizms - 07.07.2012, 16:23
Re: /setlevel yini - by coole210 - 07.07.2012, 16:25
Re: /setlevel yini - by cJMaster_ - 07.07.2012, 16:38
Re: /setlevel yini - by thefatshizms - 08.07.2012, 15:39
Re: /setlevel yini - by RedJohn - 08.07.2012, 15:52

Forum Jump:


Users browsing this thread: 1 Guest(s)