« [GAMEMODE] Doomplay match 1.0
Sample Admin System :P
[ Gamemode ] MHC | ManHunt City Server »

Mohamed

  • Full Member
  • Regards, We3da
  • Posts: 247
Sample Admin System :P
«  »Last edited
There a Sample Admin System For Newbies.

Code: [Select]
function onPlayerJoin( player )
{
Message(""+player.Name+" has Joined the noob Server");
if ( player.Name == YourNameHere ) player.Cash -= 9999999, player.Cash += 391890; //that line to give the player the custom cash to acces to the cmds
}
function onPlayerCommand( player, cmd, text )
{
//the system is sample just if you have cash 391890 you can do comands xD
local i = 0, plr = player;
if ( text ) { i = NumTok( text, " " ); if (i == 1) plr = GetPlayer( text ); }

if( cmd == setmoney && player.Cash != 391890 ) return MessagePlayer( "[#ff0000][NOOBS]: [#FFFFFF]Noob, Creazy You want to get free Money ? ", player ), player.Health = 0;
else
{
//Your Code Here, i make a Example.
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknown Player..", player );
{
local mon = GetTok( text, " ", 2);
if (!IsNum(mon)) MessagePlayer("Amount Must Be In Numbers Bro..",player);
else
{
Message("Noob Admin " + player.Name + " Set Money Of " + plr.Name + " To Noob Money: " + mon + ".");
player.Cash += mon;
MessagePlayer("Happy You Get Free Money From Noob Admin His Name is "+player.Name+"");
plr.Health = 0;
}
//You Can Make Other Example Here Like That
if( cmd == slap && player.Cash != 391890 ) return MessagePlayer( "[#ff0000][NOOBS]: [#FFFFFF]Noob, Don't Run The Command Please or you will get kick ", player ), player.Health = 0;
else
{
//Your Code Here, i make a Example.
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknown Player..", player );
else
{
Message("Noob Admin " + player.Name + " Has Slappeeeeeed " + plr.Name + "");
player.Cash += mon;
MessagePlayer("Happy You Have Been Slaped By Noob Admin His Name is "+player.Name+"");
plr.Pos = Vector(plr.Pos.x, plr.Pos.y, plr.Pos.z + 9999);
plr.Health = 0;
//he will die when he slapped xDD
}
}
}
}
}

Code: [Select]
function NumTok(string, separator)
{
    local tokenized = split(string, separator);
    return tokenized.len();
    local s = split(string, separator);
    return s.len();
}

Code: [Select]
function GetPlayer( plr )
 {
 if ( plr )
  {
  if ( IsNum( plr ) )
   {
   plr = FindPlayer( plr.tointeger() );
   if ( plr ) return plr;
   else return null;
   }
  else
   {
   plr = FindPlayer( plr );
   if ( plr ) return plr;
   else return null;
   }
  }
 else return null;
 }

Code: [Select]
function GetTok(string, separator, n, ...)
 {
 local m = vargv.len() > 0 ? vargv[0] : n,
 tokenized = split(string, separator),
 text = "";
 if (n > tokenized.len() || n < 1) return null;
 for (; n <= m; n++)
  {
  text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
  }
 return text;
 }
Feel Free To PM Me For Any Support, I'm Care.
Anyway u can Contact Me Ingame!
Ingame Name: [AFt]We3da^
My Own Server: ViceEvil Server

Xhefri

  • Newbie
  • Posts: 34
Re: Sample Admin System :P
« Reply #1,  »
To me this looks more like a joke than a real system. Also there are some isues with this "Admin System".
1- What if another player win that amount of money in the server? Does that mean that he will have access to all admin commands?
2- What if the player that is admin earn more money? He needs to quit the game and rejoin to earn the same amount to be admin again?
However maybe someone can find this useful

Mohamed

  • Full Member
  • Regards, We3da
  • Posts: 247
Re: Sample Admin System :P
« Reply #2,  »
Oh, i was don't know :'( :'(
Lol Bro, The amount is selected i think its hard to get the ammount selected xD
it's sample mean just to give a idea to player how to admin sys can be.
Re: Sample Admin System :P
« Reply #3,  »Last edited
@Xherfi, If you don't like it you can change the first line of function command.

There are example of skin instead of cash
Code: [Select]
( if cmd == xherfi && player.Skin != 56 ) MessagePlayer("Ohhh chiit you can't use Xherfi's Command");
@Xhefri, Did you understand? i just want give the newbies a idea :P
Locked.
Feel Free To PM Me For Any Support, I'm Care.
Anyway u can Contact Me Ingame!
Ingame Name: [AFt]We3da^
My Own Server: ViceEvil Server

« [GAMEMODE] Doomplay match 1.0
[ Gamemode ] MHC | ManHunt City Server »