/Admin /setlevel /drown /healall /level /time

Started by [TkD]MarineForce123, Jun 11, 2017, 12:38 AM

Previous topic - Next topic

[TkD]MarineForce123

else if ( ( cmd == "admin" ) || ( cmd == "admins" ) )
   {
      local plr, b;
      for( local i = 0; i <= GetMaxPlayers(); i++ )
      {
       plr = FindPlayer( i );
      if ( ( plr ) && ( Stats[ plr.ID ].Level >= 4) )
       {
      if ( b ) b = b + ", " + plr.Name + " (Level: " + Stats[ plr.ID ].Level + ")"
      else b = plr.Name + " Level: " + Stats[ plr.ID ].Level + ")"
       }


if ( cmd == "drown" )
{
if ( !text ) MessagePlayer("[#ffffff]**pm >> Error - Usage: /"+cmd+" [Nick/ID] [Reason]", player );
else if ( Stats[ player.ID ].Logged == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] Whether you're logged in", player );
else if ( Stats[ player.ID ].Reg == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] You are not registered", player );
else if ( Stats[ player.ID ].Level < 3 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer("[#228B22]**pm >> [#FF0000][Error] Invalid player.", player );
else {
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer("[#FF0000][Erro] put reason.", player );
else {
Message( "[#ffffff]Admin[#FF0000][[#ffffff]"+player.Name+"[#FF0000]][#ffffff] Dio drown a [#FF0000][[#ffffff]"+plr.Name+"[#FF0000]][#ffffff]  razon [#FF0000][[#ffffff]"+reason+"[#FF0000]][#ffffff]");
            plr.Pos = Vector( -227.231, -545.897,5.56816);
}
}
}
}


if ( cmd == "healall" )
{
if ( Stats[ player.ID ].Level < 7 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else if ( Stats[ player.ID ].Level < 7 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else if ( Stats[ player.ID ].Logged == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] Whether you're logged in", player );
else if ( Stats[ player.ID ].Reg == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] You are not registered", player );
else{
Message( "[#FF0000]**[#FFFFFF] Admin [#FF0000]" + player.Name+  " [##00FFFF]set health 100% to all players!");
for (local i=0; i<GetMaxPlayers(); i++)
{
local p=FindPlayer(i);
if(p)
{
p.Health = 100.0;
}
}
}
}

if ( cmd == "level" )
{
 if ( !text ) MessagePlayer( "[#008000]**pm Error[#00FFFF] ~ Use /" + cmd + " <Nick/ID> ", player );

else if ( Stats[ player.ID ].Logged == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] you're not logged in", player );
else if ( Stats[ player.ID ].Reg == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] You are not registred", player );else
{
local plr = GetPlayer( text );
if ( !plr ) MessagePlayer( "[#228B22]**pm >> [#FF0000][Error] Invalid player.", player );
else if ( Stats[ plr.ID ].Reg==false ) MessagePlayer( "[#FF0000]The Player is not Registered..", player );
else MessagePlayer( "[#00FFFF]["+plr.Name +"'s] Level: [" + GetLevel(plr) + " ] State:[" + GetLevelTag(plr) + "]", player );
}
}
}

if ( cmd == "time" )
{
local now = date();
Message( "[#ffffff]The time is currently[#FF0000] " + now.day + "/" + now.month + "/" + now.year + " " + now.hour + ":" + now.min + ":" + now.sec + "" );
}

if ( cmd == "setlevel" || cmd == "darlevel")
{
if ( !text ) MessagePlayer("[#ffffff]** pm >> Error - Usage: /"+cmd+" [Nick/ID] [Level]", player );
else if ( NumTok( text, " " ) < 2 ) MessagePlayer("** pm >> Error - Usage: /"+cmd+" [Nick/ID] [Level]", player );
else if ( Stats[ player.ID ].Level < 0 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr )  MessagePlayer("[#228B22]**pm >> [#FF0000][Error] Invalid player.", player );
else if ( Stats[ plr.ID ].Level == 7 ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] no puedes tocar a Developer", player );

else
{
local lvl = GetTok( text, " ", 2);
if (!IsNum(lvl)) MessagePlayer("[#00FF00][Error] [#FF4500] - Only numbers.",player);
else if ( Stats[ plr.ID ].Level > 5 ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] no puedes tocar al creador del server", player );
else
{
MessagePlayer("[#ffffff]Admin [#FF0000][[#ffffff]" + player.Name + "[#FF0000]] [#ffffff]Cambio el Level[#FF0000]/[#ffffff]Nivel a[#FF0000] [[#ffffff]" + plr.Name + "[#FF0000]] [#ffffff]Level[#FF0000]/[#ffffff]Nivel: [#FF0000][[#ffffff]" + lvl + "[#FF0000]]",player);
local q = QuerySQL( Registros, "SELECT * FROM Cuenta WHERE Nombre LIKE '" + plr.Name + "'" );
Stats[ plr.ID ].Level = GetSQLColumnData( q, 3 );
Stats[ plr.ID ].Level =lvl;
QuerySQL( Registros, "UPDATE Cuenta SET Level='" + Stats[ plr.ID ].Level + "' WHERE Nombre LIKE '" + plr.Name + "'" );
local q = QuerySQL( Registros, "SELECT * FROM Cuenta WHERE Nombre LIKE '" + plr.Name + "'" );
Stats[ plr.ID ].Level = GetSQLColumnData( q, 3 );
}
}
}
}

kennedyarz


MatheuS

Quote from: kennedyarz on Jun 11, 2017, 12:48 AMman, stop

He's just trying to help someone.



You can't just use the commands, they will not work, for them to work you need to put all your login/register system, that is where the registry data is stored. (Example: Level and others)

PS: Check out other posts and see how you can post something that really works.
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

Hendrix

Quote from: [TkD]MarineForce123 on Jun 11, 2017, 12:38 AMelse if ( ( cmd == "admin" ) || ( cmd == "admins" ) )
   {
      local plr, b;
      for( local i = 0; i <= GetMaxPlayers(); i++ )
      {
       plr = FindPlayer( i );
      if ( ( plr ) && ( Stats[ plr.ID ].Level >= 4) )
       {
      if ( b ) b = b + ", " + plr.Name + " (Level: " + Stats[ plr.ID ].Level + ")"
      else b = plr.Name + " Level: " + Stats[ plr.ID ].Level + ")"
       }


if ( cmd == "drown" )
{
if ( !text ) MessagePlayer("[#ffffff]**pm >> Error - Usage: /"+cmd+" [Nick/ID] [Reason]", player );
else if ( Stats[ player.ID ].Logged == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] Whether you're logged in", player );
else if ( Stats[ player.ID ].Reg == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] You are not registered", player );
else if ( Stats[ player.ID ].Level < 3 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer("[#228B22]**pm >> [#FF0000][Error] Invalid player.", player );
else {
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer("[#FF0000][Erro] put reason.", player );
else {
Message( "[#ffffff]Admin[#FF0000][[#ffffff]"+player.Name+"[#FF0000]][#ffffff] Dio drown a [#FF0000][[#ffffff]"+plr.Name+"[#FF0000]][#ffffff]  razon [#FF0000][[#ffffff]"+reason+"[#FF0000]][#ffffff]");
            plr.Pos = Vector( -227.231, -545.897,5.56816);
}
}
}
}


if ( cmd == "healall" )
{
if ( Stats[ player.ID ].Level < 7 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else if ( Stats[ player.ID ].Level < 7 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else if ( Stats[ player.ID ].Logged == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] Whether you're logged in", player );
else if ( Stats[ player.ID ].Reg == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] You are not registered", player );
else{
Message( "[#FF0000]**[#FFFFFF] Admin [#FF0000]" + player.Name+  " [##00FFFF]set health 100% to all players!");
for (local i=0; i<GetMaxPlayers(); i++)
{
local p=FindPlayer(i);
if(p)
{
p.Health = 100.0;
}
}
}
}

if ( cmd == "level" )
{
 if ( !text ) MessagePlayer( "[#008000]**pm Error[#00FFFF] ~ Use /" + cmd + " <Nick/ID> ", player );

else if ( Stats[ player.ID ].Logged == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] you're not logged in", player );
else if ( Stats[ player.ID ].Reg == false ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] You are not registred", player );else
{
local plr = GetPlayer( text );
if ( !plr ) MessagePlayer( "[#228B22]**pm >> [#FF0000][Error] Invalid player.", player );
else if ( Stats[ plr.ID ].Reg==false ) MessagePlayer( "[#FF0000]The Player is not Registered..", player );
else MessagePlayer( "[#00FFFF]["+plr.Name +"'s] Level: [" + GetLevel(plr) + " ] State:[" + GetLevelTag(plr) + "]", player );
}
}
}

if ( cmd == "time" )
{
local now = date();
Message( "[#ffffff]The time is currently[#FF0000] " + now.day + "/" + now.month + "/" + now.year + " " + now.hour + ":" + now.min + ":" + now.sec + "" );
}

if ( cmd == "setlevel" || cmd == "darlevel")
{
if ( !text ) MessagePlayer("[#ffffff]** pm >> Error - Usage: /"+cmd+" [Nick/ID] [Level]", player );
else if ( NumTok( text, " " ) < 2 ) MessagePlayer("** pm >> Error - Usage: /"+cmd+" [Nick/ID] [Level]", player );
else if ( Stats[ player.ID ].Level < 0 ) MessagePlayer( "[#008000]**pm >> [#FF0000]You are not authorized to use this command.", player );
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr )  MessagePlayer("[#228B22]**pm >> [#FF0000][Error] Invalid player.", player );
else if ( Stats[ plr.ID ].Level == 7 ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] no puedes tocar a Developer", player );

else
{
local lvl = GetTok( text, " ", 2);
if (!IsNum(lvl)) MessagePlayer("[#00FF00][Error] [#FF4500] - Only numbers.",player);
else if ( Stats[ plr.ID ].Level > 5 ) MessagePlayer( "[#00FF00][Error] [#FF4500]-[#FFFF00] no puedes tocar al creador del server", player );
else
{
MessagePlayer("[#ffffff]Admin [#FF0000][[#ffffff]" + player.Name + "[#FF0000]] [#ffffff]Cambio el Level[#FF0000]/[#ffffff]Nivel a[#FF0000] [[#ffffff]" + plr.Name + "[#FF0000]] [#ffffff]Level[#FF0000]/[#ffffff]Nivel: [#FF0000][[#ffffff]" + lvl + "[#FF0000]]",player);
local q = QuerySQL( Registros, "SELECT * FROM Cuenta WHERE Nombre LIKE '" + plr.Name + "'" );
Stats[ plr.ID ].Level = GetSQLColumnData( q, 3 );
Stats[ plr.ID ].Level =lvl;
QuerySQL( Registros, "UPDATE Cuenta SET Level='" + Stats[ plr.ID ].Level + "' WHERE Nombre LIKE '" + plr.Name + "'" );
local q = QuerySQL( Registros, "SELECT * FROM Cuenta WHERE Nombre LIKE '" + plr.Name + "'" );
Stats[ plr.ID ].Level = GetSQLColumnData( q, 3 );
}
}
}
}

You can do the function: getall and killall

SAzEe21