Sign in to follow this  
SL么GHOST

camping script for leiizko mod

Recommended Posts

Is there anyone have camping script for leiizko mod?
i have tried this.but there is small thing to fix because if player is in gunship or manned power heli i want disable for camping check for that player

 

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;

AFK_Camp_Watcher()
{
	level waittill( "prematch_over" );
	self endon( "death" );
	my_camp_time = 0;
	have_i_been_warned = false;
	max_distance = 240;
	camp_time = 20;

	while( 1 )
	{
		old_position = self.origin;
		wait 1;
	
		new_position = self.origin;
		distance = distance2d( old_position, new_position );
	
		if( distance < max_distance )
			my_camp_time++;
		else
		{
			my_camp_time = 0;
			have_i_been_warned = false;
		}
	
		if( my_camp_time == camp_time && !have_i_been_warned )
		{
			self IprintLnBold("^7Stop ^1CAMP^7, noob!");
			self IprintLnBold("^710 seconds to move!");
			have_i_been_warned = true;
		}

		if( my_camp_time == ( camp_time + 10 ) && have_i_been_warned )
		{
			self IprintLnBold("^7You will be moved to spectators for ^1Camping^7!");
			wait 2;
			self.sessionteam = "spectator";
			self.sessionstate = "spectator";
			self [[level.spawnSpectator]]();
			iPrintln("^7" +self.name + " ^7was moved to spectators for ^1Camping^7!");
		}
	}
}

can anyone help me?
code from : https://cod4x.me/index.php?/forums/topic/1947-anti-camp/&do=findComment&comment=9148

 

Share this post


Link to post
Share on other sites

Looking at the code, I can see that he did 2 things that we can use to determine that the player is operating the AGM or AC130.

1. He defines a level variable: level.flyingPlane. Which tells all scripts that someone is operating a plane.

2. The previously mentioned variable doesn't give who is operating the plane. We see that once someone calls AGM/AC130, they are given a massive health boost so that they aren't killed easily. They are given a max health of 120000 for the duration.

 

We can use that info as such:

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;

AFK_Camp_Watcher()
{
	level waittill( "prematch_over" );
	self endon( "death" );
	my_camp_time = 0;
	have_i_been_warned = false;
	max_distance = 240;
	camp_time = 20;

	while( 1 ) {
		old_position = self.origin;
		wait 1;
	
		new_position = self.origin;
		distance = distance2d( old_position, new_position );
		
		if((distance > max_distance) || (isdefined(level.flyingPlane) && self.maxHealth == 120000)) {
			my_camp_time = 0;
			have_i_been_warned = false;
		}
		else {
			my_camp_time++;
		}
	
		if( my_camp_time == camp_time && !have_i_been_warned ) {
			self IprintLnBold("^7Stop ^1CAMP^7, noob!");
			self IprintLnBold("^710 seconds to move!");
			have_i_been_warned = true;
		}

		if( my_camp_time == ( camp_time + 10 ) && have_i_been_warned )
		{
			self IprintLnBold("^7You will be moved to spectators for ^1Camping^7!");
			wait 2;
			self.sessionteam = "spectator";
			self.sessionstate = "spectator";
			self [[level.spawnSpectator]]();
			iPrintln("^7" +self.name + " ^7was moved to spectators for ^1Camping^7!");
		}
	}
}

 

This is untested and meant to give you an idea of what you can do.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this