Author Topic: [VBS] Setlevel not work...  (Read 1448 times)

Merkel

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +4/-10
    • View Profile
[VBS] Setlevel not work...
« on: May 20, 2013, 08:30:04 pm »
The setlevel of VBS not work. For my Vip system, need setlevel, please, fix the command D;
Westwood Studios

The best studios company in strategy videogames.

GTASAnek

  • Newbie
  • *
  • Posts: 15
  • Karma: +4/-0
    • View Profile
Re: [VBS] Setlevel not work...
« Reply #1 on: July 08, 2013, 09:31:57 pm »
Code: [Select]
else if ( cmd == "setlevel" )
{
if ( level >= GetCmdLevel( cmd ) )
{
if ( ( args ) && ( numArgs == 2 ) )
{
local plrText = GetTok( args, " ", 1 );
local setLvl = GetTok( args, " ", 2 );

local plr2 = null;

if ( IsNum( plrText ) ) plr2 = FindPlayer( plrText.tointeger() );
else plr2 = FindPlayer( plrText );

if ( plr2 )
{
if ( plr2.ID != plr.ID )
{
                                                if ( GetPlayerLevel( plr2 ) > LVL_UNREGISTERED )
                                                {
              if ( setLvl.tointeger() > LVL_UNREGISTERED )
              {
        if ( setLvl.tointeger() < level )
              {
              local oldLevel = GetPlayerLevel( plr2 ); 
              if ( oldLevel < level )
              {
              if ( oldLevel < setLvl.tointeger() )
Message( "Admin " + plr + " has promoted player " + plr2 + " to level " + setLvl );
              else
Message( "Admin " + plr + " has demoted player " + plr2 + " to level " + setLvl );

                  SetPlayerLevel( plr2.Name, setLvl );
        }
            else MessagePlayer( "You cannot set the level of higher or equal level admins", plr, COL_CMDERROR );
              }
            else MessagePlayer( "You cannot set a level higher or equal to your own", plr, COL_CMDERROR );
          }
          else MessagePlayer( "Invalid level", plr, COL_CMDERROR );
                                                }
                                                else MessagePlayer( plr2 + " is not a registered nickname.", plr, COL_CMDERROR );
              }
else MessagePlayer( "You cannot set your own level", plr, COL_CMDERROR );
}
else MessagePlayer( "Invalid player", plr, COL_CMDERROR );
}
else MessagePlayer( "Invalid arguments (/setlevel <player> <level>)", plr, COL_CMDERROR );
}
else MessagePlayer( "You must be a level " + GetCmdLevel( cmd ) + " admin to use this command", plr, COL_CMDERROR );

return true;
} // End of 'setlevel' function

 

© Liberty Unleashed Team.