Setlevel

Started by PsyChO_KiLLeR, Mar 07, 2015, 06:17 AM

Previous topic - Next topic

PsyChO_KiLLeR

My Setlevel Command not working it always say lvl does not exist

else if ( cmd == "setlevel" )
{
                  if ( IsNoob( player, cmd ) ) return 0;
if ( !text ) ePrivMessage( "Syntax, / " + cmd + " <Nick/ID> <Level 3, 4 ,5> ", player );
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) ePrivMessage( "Unknown Player..", player );
else
{
   if (!IsNum(lvl)) ePrivMessage("Level Must Be In Numbers..",player);
   else
   {
   ePrivMessage(" Admin " + player.Name + " Set Level To " + plr.Name + ", Level: " + lvl + ".",player);
   QuerySQL(db,"UPDATE Account SET Level='" + lvl + "' WHERE Name='" + plr.Name.tolower() + "'");
   }
}
}

KingOfVC

else if ( cmd == "setlevel" )
   {
                  if ( IsNoob( player, cmd ) ) return 0;
    if ( !text ) ePrivMessage( "Syntax, / " + cmd + " <Nick/ID> <Level 3, 4 ,5> ", player );
   local plr = GetPlayer( GetTok( text, " ", 1 ) ), lvl = GetTok( text, " ", 2 );
   if ( !plr ) ePrivMessage( "Unknown Player..", player );
   else
   {
      if (!IsNum(lvl)) ePrivMessage("Level Must Be In Numbers..",player);
      else
      {
      ePrivMessage(" Admin " + player.Name + " Set Level To " + plr.Name + ", Level: " + lvl + ".",player);
      QuerySQL(db,"UPDATE Account SET Level='" + lvl + "' WHERE Name='" + plr.Name.tolower() + "'");
      }
   }
   }

PsyChO_KiLLeR