Player movement held!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Player movement held!

Post 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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

MG

Post by tltrude »

What about players that hold their trigger to fire a machine gun?
Tom Trude,

Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

lol I forgot to say it was a snipers only server!
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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:
Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post 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
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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 )
Admin .MAP Forums
Image
Head above heels.
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post 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?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

you missed a (

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

should be

( $player[local.p] getmovement([0] == r))
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

You don't need goto dance, the while loop does it for you. :wink:
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

waittill spawn

should be

level waittill spawn

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

should be

( $player[local.p] getmovement)[0] == r)
Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :?
Image
Post Reply