Disable function script

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Disable function script

Post by iCYsoldier » May 29th, 2010, 8:24 am

Hey everyone,

Is there any way that I can disable a button when a player enters a trigger? For example, hypothetically, when someone enters a trigger, they can't move forward. Is this possible?

Thanks :)
Last edited by iCYsoldier on May 30th, 2010, 1:22 am, edited 1 time in total.

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Re: Disable button script

Post by Soviet » May 29th, 2010, 8:29 am

Code: Select all

while(trigger);
level.player freezeControls(true);
That would theoretically freeze all controls. I just randomly threw it together though, not guaranteeing it will work.

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: Disable button script

Post by iCYsoldier » May 29th, 2010, 8:56 am

Soviet wrote:

Code: Select all

while(trigger);
level.player freezeControls(true);
That would theoretically freeze all controls. I just randomly threw it together though, not guaranteeing it will work.
Thanks

But is there a way to disable a specific button, like '+forward' or something?

thanks again

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Disable button script

Post by Drofder2004 » May 29th, 2010, 5:33 pm

Yes and No.

Not directly disable buttons, but you can disable functions...

For example, you could stop them pushing forward by simply stopping forward movement, but the script would be a little messy...

I would seek an alternate idea.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: Disable button script

Post by iCYsoldier » May 30th, 2010, 1:21 am

Drofder2004 wrote:Yes and No.

Not directly disable buttons, but you can disable functions...

For example, you could stop them pushing forward by simply stopping forward movement, but the script would be a little messy...

I would seek an alternate idea.
Ah yeh, that is what I was after. I'd like to disable the "+forward", "+melee" or something.

But if anyone does have a script or another effective idea, that would be really good :)

Thanks again..

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest