Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Tajammul

#1

enum StreamType
{
   // Acknowledgement that a stream was received.
   ACK      =   500,
   
   // Check for speedhacks from the samples collected and reset state to 0th sample.
   VALIDATE   =   501,
   
   // Sample packet to check for speed hacks
   SPEEDCHECK      =   503,
   
   // Confirm that speed hack was detected
   CONFIRM         =   502
}


// Frequency at which packets are sent to players.(in mili seconds)
FREQUENCY      <- 2000;


// Number of samples the script takes before making a decision.
const SAMPLES      = 10;


// Percentage of speed increase to be forgiven
const SLACK      = 5.0;


// Array to store samples of time stamps when packets are received.
timeStamp      <- ::array( SAMPLES, null );


function CheckSpeedData( int )
{
   // Read what kind of data the server sent.
   switch( int )
   {
      case StreamType.VALIDATE:
      {
         ::ValidateSpeed();
         
         // Reset the samples
         ::timeStamp = ::array( SAMPLES, null );
      }
      
      default:
      {
         if ( int < 503 )
            return false;
         // Log the time stamp when the server sent the data.(5 samples)
         local index = int - 503;
         ::timeStamp[index] = Script.GetTicks();
         // Acknowledge to server that the packet was received.
         // local stream = Stream();
         // stream.WriteByte(StreamType.ACK);
         // Server.SendData(stream);
         
         break;
      }
   }
}
function ValidateSpeed()
{
   local duration      = array( SAMPLES - 1, null );
   local speedCount   = 0;
   local increase      = 0, maxIncrease = 0;
   for( local i = 0; i < SAMPLES - 1; i++ )
   {
      if( !timeStamp[i+1] || !timeStamp )
         return false;
         
      duration = timeStamp[i+1] - timeStamp;
      increase = ( ( duration - FREQUENCY ).tofloat()/FREQUENCY) * 100.0;
      maxIncrease = ( increase > maxIncrease ? increase : maxIncrease );
         
      if( maxIncrease > SLACK )   speedCount++;
   }
      
   if( speedCount > 0 )
   {
      local stream = Stream();
      stream.WriteInt(StreamType.CONFIRM);
      stream.WriteString(World.FindLocalPlayer().ID + "-" + speedCount + "-" + maxIncrease);
      Server.SendData(stream);
   }
}
#2
OOOO KING_AhSAN BRO!!!!!!!!
#3
Snippet Showroom / Re: Basic Ban System
Oct 21, 2018, 05:57 AM
Warcheif Ban System lol !!! xD
 :o 8)
#4
Enjoy Guys!!!!!!!!!!!!!!!!
#5
Link: <Link Removed>
#6
Snippet Showroom / Vcmp Admin Commands idea
Sep 28, 2018, 07:05 AM
Admin Commands Idea
[noae][noae][noae][noae]else if ( ( cmd == "admincmds" ) || ( cmd == "acmds" ) )
{
local lvl = GetLevel(player);
if ( lvl.tointeger() == 2 )
{
MessagePlayer(RED+"========== "+YELLOW+"Traner Commands Prefix To "+WHITE+"(/) "+RED+"<<==========", player );
MessagePlayer(RED+"  "+LGREEN+"admininfo, ann, setweather, clear, kick",player);
}
else if ( lvl.tointeger() == 3 )
{
MessagePlayer(RED+"========== "+YELLOW+"Moderator Commands Prefix To "+WHITE+"(/) "+RED+"<<==========", player );
MessagePlayer(RED+"  "+LGREEN+"admininfo, ann, setweather, clear, hideadmin, taxijump,",player);
MessagePlayer(RED+"  "+LGREEN+"kick, mute, unmute, warn, freeze, unfreeze, getip",player);
}
else if ( lvl.tointeger() == 4 )
{
MessagePlayer(RED+"========== "+YELLOW+"Admin Commands Prefix To "+WHITE+"(/) "+RED+"<<==========", player );
MessagePlayer(RED+"  "+LGREEN+"admininfo, ann, setweather, clear, hideadmin, stuntbike",player);
MessagePlayer(RED+"  "+LGREEN+"kick, mute, unmute, warn, freeze, unfreeze, getip, taxijump,",player);
MessagePlayer(RED+"  "+LGREEN+"drown, ban, unban, baninfo, healall, playerip, alias, jail,",player);
MessagePlayer(RED+"  "+LGREEN+"unjail, waterdrive",player);
}
else if ( lvl.tointeger() == 5 )
{
MessagePlayer(RED+"========== "+YELLOW+"Management Commands Prefix To "+WHITE+"(/) "+RED+"<<==========", player );
MessagePlayer(RED+"  "+LGREEN+"admininfo, ann, setweather, clear, hideadmin, carfly, get,",player);
MessagePlayer(RED+"  "+LGREEN+"kick, mute, unmute, warn, freeze, unfreeze, getip, taxijump,",player);
MessagePlayer(RED+"  "+LGREEN+"drown, ban, unban, baninfo, healall, playerip, alias, jail,",player);
MessagePlayer(RED+"  "+LGREEN+"unjail, waterdrive, stuntbike, slap, setskin, macban, unmacban,",player);
MessagePlayer(RED+"  "+LGREEN+"freezeall, unfreezeall, resetstats, shootinair",player);
}
else if ( lvl.tointeger() == 6 )
{
MessagePlayer(RED+"========== "+YELLOW+"Co-Owner Commands Prefix To "+WHITE+"(/) "+RED+"<<==========", player );
MessagePlayer(RED+"  "+LGREEN+"admininfo, ann, setweather, clear, hideadmin, carfly, get,",player);
MessagePlayer(RED+"  "+LGREEN+"kick, mute, unmute, warn, freeze, unfreeze, getip, taxijump,",player);
MessagePlayer(RED+"  "+LGREEN+"drown, ban, unban, baninfo, healall, playerip, alias, jail,",player);
MessagePlayer(RED+"  "+LGREEN+"unjail, waterdrive, stuntbike, slap, setskin, macban, unmacban,",player);
MessagePlayer(RED+"  "+LGREEN+"freezeall, unfreezeall, resetstats, shootinair, killplayer, setmon,",player);
MessagePlayer(RED+"  "+LGREEN+"getall, spawncar, macban2, unmacban2",player);
}
else if ( lvl.tointeger() == 7 )
{
MessagePlayer(RED+"========== "+YELLOW+"Server Owner Commands Prefix To "+WHITE+"(/) "+RED+"<<==========", player );
MessagePlayer(RED+"  "+LGREEN+"admininfo, ann, setweather, clear, hideadmin, carfly, get,",player);
MessagePlayer(RED+"  "+LGREEN+"kick, mute, unmute, warn, freeze, unfreeze, getip, taxijump,",player);
MessagePlayer(RED+"  "+LGREEN+"drown, ban, unban, baninfo, healall, playerip, alias, jail,",player);
MessagePlayer(RED+"  "+LGREEN+"unjail, waterdrive, stuntbike, slap, setskin, macban, unmacban,",player);
MessagePlayer(RED+"  "+LGREEN+"freezeall, unfreezeall, resetstats, shootinair, killplayer, setmon,",player);
MessagePlayer(RED+"  "+LGREEN+"getall, spawncar, macban2, unmacban2, addadmin, deladmin, setlevel,",player);
MessagePlayer(RED+"  "+LGREEN+"setkills, setkilleds, setdeaths, exec, setwlevel, playerimmunity, vehimmunity,disarmall,sethp,setarmour,pcg,chee",player);
}
}

}
[/noae][/noae][/noae][/noae]
#7
Snippet Showroom / Vcmp Admin Armour System
Sep 28, 2018, 06:59 AM
Admin Armour System
else if ( cmd == "setarmour" )
{
     
 if ( player.Name == "Name" || player.Name == "Name" || player.Name == "Name" )
{
      if( !text )
      MessagePlayer("Use /setarmour <plr> <hp>", player);
      local params = split( text, " " );
      if( params.len() < 1 ) MessagePlayer("Wrong no. of parameters.", player);
      else if( !IsNum( params[1] ) ) return MessagePlayer("Armour must be an integer.", player);
      else if( params[1].tointeger() > 250 || params[1].tointeger() < 0 ) return MessagePlayer("It can't be more than 250 or less than 0.", player);
      local plr = IsNum( params[0] ) ? FindPlayer( params[0].tointeger() ) : FindPlayer( params[0] );
      if( !plr ) return MessagePlayer( "Wrong player.", player );
     






 else plr.Armour = params[1].tointeger();


MessagePlayer(RED+""+player.Name+" Set Armour :[ "+plr.Name+" ]  .", player );

}
        else MessagePlayer( "[#00ff00] YOU ARE NOT ADMIN. " , player )
}
#8
Snippet Showroom / Vcmp Snippy
Sep 28, 2018, 06:58 AM
Admin Health System
else if( cmd == "sethp" )
{
       if ( player.Name == "Name" || player.Name == "Name" || player.Name == "Name" )
{
      if( !text )
      MessagePlayer("Use /sethp <plr> <hp>", player);
      local params = split( text, " " );
      if( params.len() < 1 ) MessagePlayer("Wrong no. of parameters.", player);
      else if( !IsNum( params[1] ) ) return MessagePlayer("HP must be an integer.", player);
      else if( params[1].tointeger() >250 || params[1].tointeger() < 0 ) return MessagePlayer("It can't be more than 250 or less than 0.", player);
      local plr = IsNum( params[0] ) ? FindPlayer( params[0].tointeger() ) : FindPlayer( params[0] );
      if( !plr ) return MessagePlayer( "Wrong player.", player );
     

else plr.Health = params[1].tointeger();

MessagePlayer(RED+""+player.Name+" Set Health :[ "+plr.Name+" ]  .", player );


}
        else MessagePlayer( "[#00ff00] YOU ARE NOT ADMIN. " , player )


}
#9
Snippet Showroom / Vcmp Snippy
Sep 28, 2018, 06:56 AM
Drunk , Undrunk System
else if ( cmd == "drunk" )
{
MessagePlayer(LBLUE+" "+player.Name+" Is Drunk Mode.  .", player );
player.IsDrunk=true;
}

else if ( cmd == "undrunk" )
{
MessagePlayer(LBLUE+" "+player.Name+" Exit Drunk Mode.  .", player );
player.IsDrunk=false;
}