/ma (making admin) help! BUG!!
#1

Hi i need help! when i use
Код:
 /ma 0 6
it tells me about the usage of cmd

pawn Код:
CMD:ma(playerid, pid[], lvl[])
{
    new string[128];
    if(PlayerInfo[playerid][Level] != 6) {
        return 1;
    }
    if(isnull(pid) || isnull(lvl)) {
        SendClientMessage(playerid, COLOR_GREY,"[USAGE] /ma [id] [level]");
        SendClientMessage(playerid, COLOR_GREY,"This will set player(id)'s level");
        return 1;
    }
    new id = strval(pid),level = strval(lvl);
    if(!IsPlayerConnected(id)) {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] Invalid ID");
        return 1;
    }
    new File[256]; format(File,256,"users/%s.sav",PlayerName(id));
    if(!fexist(File)) {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] Player is not registered, cannot setlevel");
        return 1;
    }
    if(PlayerInfo[id][LoggedIn] == 0) {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] Player need to be loggedin to get level");
        return 1;
    }
    if(PlayerInfo[id][Level] == level) {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] player is already on this level");
        return 1;
    }
    if(level > PlayerInfo[id][Level]) {
        GameTextForPlayer(id,"~b~Promoted", 1000, 4);
    }else {
        GameTextForPlayer(id,"~r~Demoted",1000,4);
    }
    if(level == 0) {
        format(string,128,"[ADMIN] %s has fired %s from AdminPannel (%s's Level: %d)",PlayerName(playerid),PlayerName(id),PlayerName(id),level);
    }else {
        format(string,128,"[ADMIN] %s has setted %s's Level: %d  (%s)",PlayerName(playerid),PlayerName(id),level,LevelName(level));
    }
    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
    dini_IntSet(File,"Level",level);
    PlayerInfo[id][Level] = level;
    return 1;
}
Please Help BTW i always make like this without strtok

EXP:
pawn Код:
CMD:setmytime(playerid, hour[], minute[]) //I dont know the command works or not :P
{
   if(isnull(hour) || isnull(minute)) return 1;
   SetPlayerTime(playerid, strval(hour),strval(minute));
   return 1;
}
Reply


Messages In This Thread
/ma (making admin) help! BUG!! - by dr.lozer - 10.12.2012, 13:30
Re: /ma (making admin) help! BUG!! - by Lordzy - 10.12.2012, 13:43
Re: /ma (making admin) help! BUG!! - by dr.lozer - 10.12.2012, 13:54
Re: /ma (making admin) help! BUG!! - by LarzI - 10.12.2012, 13:55
Re: /ma (making admin) help! BUG!! - by Konstantinos - 10.12.2012, 14:10
Re: /ma (making admin) help! BUG!! - by dr.lozer - 10.12.2012, 14:17
Re: /ma (making admin) help! BUG!! - by Mustafa6155 - 10.12.2012, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)