Page 1 of 1

Player movement held!

Posted: Tue Sep 02, 2003 9:51 am
by The Jackal
I am making an anti-dance script for those noobs with aimbots and trigger bots that frequent our servers and dances while they snipe.

What I am thinking is hurt them while they hold fire and moveleft or move right. My problem is I do not know if I can get that movement key action from players. Like I can with fireheld.

Here is what I came up with so far:

Code: Select all

dance:

while(1)
{

for(local.p = 1; local.p < $player.size+1;local.p++)
	{
	if($player[local.p].dmteam != "spectator" && $player[local.p].health > 0 && $player[local.p].fireheld == 1 && $player[local.p].???????)
		{
			$player[local.p] hurt 30
			wait 1
			$player[local.p] iprint "NO Dancers Allowed Here!"
		}
	}

wait (.1)
go to dance
}
end

MG

Posted: Tue Sep 02, 2003 12:06 pm
by tltrude
What about players that hold their trigger to fire a machine gun?

Posted: Tue Sep 02, 2003 12:59 pm
by The Jackal
lol I forgot to say it was a snipers only server!

Posted: Tue Sep 02, 2003 7:02 pm
by jv_map
if(($player[local.p] getmovement)[0] == r) // r(unning)

that'll do it 8-)

Your mod may be very annoying though :wink:

Posted: Tue Sep 02, 2003 9:35 pm
by The Jackal
Thanks JV.

Man you don't know the stress these kids give me. I got grey hairs in places I never had hair before. I did a force skin and no force models script for them. Only to find out that the damn neon skin pack uses the stock skins names too.

Just for the sake of definition. Please explain the use of the )
[0]
. What does the ")" mean in the statement? And the array zero?

Thanks

Posted: Tue Sep 02, 2003 9:59 pm
by Bjarne BZR
the statement $player[local.p] getmovement
Returns the string "running"

the [0] returns the first element of the array "running"
( thats the letter 'r' )

the line // r(unning) is just a comment
( anything after "//" is ignored by the script interpreter )

Posted: Tue Sep 02, 2003 11:31 pm
by The Jackal
Don't work people! I put this in my map script file

Code: Select all

waittill spawn
exec global/dancer.scr
And the dancer.scr looks like this:

Code: Select all

dance:

while(1)
{

for(local.p = 1; local.p < $player.size+1;local.p++)
	{
	if($player[local.p].dmteam != "spectator" && $player[local.p].health > 0 && $player[local.p].fireheld == 1 && $player[local.p] getmovement([0] == r))
		{
			$player[local.p] hurt 30
			wait 2
			$player[local.p] iprint "NO Dancing On This Server!"
		}
		
	}

wait (.1)
goto dance
}
end
What am I doing wrong? I really want break the legs of dancers. I have never seen Vasili Zaitsev or Carlos "The Jackal" dance while they snipe. So why the heck must I tolerate these noobs withs skins and aimbots?

Posted: Wed Sep 03, 2003 1:18 am
by bdbodger
you missed a (

$player[local.p] getmovement([0] == r))

should be

( $player[local.p] getmovement([0] == r))

Posted: Wed Sep 03, 2003 2:42 am
by Alcoholic
You don't need goto dance, the while loop does it for you. :wink:

Posted: Wed Sep 03, 2003 6:41 am
by jv_map
waittill spawn

should be

level waittill spawn

( $player[local.p] getmovement([0] == r))

should be

( $player[local.p] getmovement)[0] == r)

Posted: Tue Sep 09, 2003 7:01 am
by The Jackal
Thanks for the help fellas.
I will work on these corrections.

By the way. I never got any email notifications that an update was posted. My Notify box is checked by default. Just thought you would wanna know.

Posted: Tue Sep 09, 2003 4:04 pm
by jv_map
The Jackal wrote:By the way. I never got any email notifications that an update was posted. My Notify box is checked by default. Just thought you would wanna know.
Hmm I think more users experience this problem :? works fine for me though :?