MySQL /setlevel problem
#1

Hello.Today I started making my new admin system.And i got problem with /setlevel.This is my second time about scripting MySQL system.So when I type in game /setlevel It`s shows me /setlevel <id> <level>.It`s good.But when I type /setlevel 0 5.It`s shows me again /setlevel <id> <level>.I don`t know in what is problem..anyone can help?

here is code:

pawn Код:
CMD:setlevel(playerid,params[])
{
    new Level,playerid2,Query[500],string[160];
    if(AdminL[playerid] == 5)return SendClientMessage(playerid,0xFFFFFFFF,""COL_RED"[ADMIN]{FFFFFF}You are not allowed to use this command!");
    if(sscanf(params, "ud", playerid2, Level)) return SendClientMessage(playerid,0xFFFFFFFF, "Usage: /setlevel <id> <level>");
    if (Level < 0 || Level > 5) return SendClientMessage(playerid,0xFFFFFFFF, "Admin levels are between 1 - 5");
    format(Query, sizeof(Query), "UPDATE `playerdata` SET `level` = %d  WHERE `user` = '%s'", Level, PlayerName(playerid2));
    mysql_query(Query);
    mysql_free_result();
    format(string, sizeof(string), "You have set {FF00AA}%s(%d){FFFFFF} admin level to %d", PlayerName(playerid2), playerid2, Level);
    SendClientMessage(playerid, 0xFFFFFF, string);
    if(AdminL[playerid] < Level) format(string, sizeof(string), "You have been {CC00FF}promoted{FFFFFF} to level %d admin by admin %s(%d)", Level, PlayerName(playerid), playerid);
    if(AdminL[playerid] > Level) format(string, sizeof(string), "You have been {FF00AA}demoted{FFFFFF} to level %d admin by admin %s(%d)", Level, PlayerName(playerid), playerid);
    SendClientMessage(playerid2, 0xFFFFFF, string);
    AdminL[playerid] = Level;
    return 1;
}
Reply


Messages In This Thread
MySQL /setlevel problem - by Sanady - 16.07.2012, 11:07
Re: MySQL /setlevel problem - by Sanady - 17.07.2012, 10:50
Re: MySQL /setlevel problem - by kelvin22 - 18.07.2012, 10:39

Forum Jump:


Users browsing this thread: 1 Guest(s)