Disable Thread!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
chrisjbooth2001
Colour Sergeant
Posts: 77
Joined: Thu Dec 18, 2003 12:57 am

Disable Thread!

Post by chrisjbooth2001 »

Ok ive got a thread, which is turned on at round start..

I need to know is there a command where i can disable a thread, like

(threadname) disablethread?
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

why whould you want to create a thread, and then disable it
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

what does the thread do?

Can you just let it end when whatever circumstance makes it irrelevant happen?

Or if its called more then once, why not use a if loop to determine whether it should run?
When I am king, you will be first against the wall~
Image
chrisjbooth2001
Colour Sergeant
Posts: 77
Joined: Thu Dec 18, 2003 12:57 am

Post by chrisjbooth2001 »

Ok im still playing but the box that the script is will make the axis lose all guns and become immune when they touch it.. But i need to use a trigger which will disable it...

This is my script..

//------------------------------------------
axis_end:
//------------------------------------------

while (parm.other.dmteam == "axis" isTouching $axisend)
{
parm.other immune suicide falling explosion explodewall thrownobject grenade rocket impact
parm.other immune bullet fast_bullet vehicle fire flashbang on_fire gib impale bash
parm.other immune shotgun aagun landmine
parm.other takeall
}
end

Where have i gone wrong, and are there any opposite commands i can do?

Opposite meaning, takeall - giveall

immune - unimmune? is it a word? lol
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

The way I would do it is this

local.player = parm.other

local.player nodamage

while((local.player.dmteam == "axis")&&(local.player istouching $axisend))
waitframe

local.player takedamage

end
Image
chrisjbooth2001
Colour Sergeant
Posts: 77
Joined: Thu Dec 18, 2003 12:57 am

Post by chrisjbooth2001 »

And any suggestion for give/take weapons? But I want it so i use the trigger and the area with the box then lets you have weapons.. Ie by disabling the thread..
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Code: Select all

while (parm.other.dmteam == axis && parm.other isTouching $axisend)
{
// Bla bla bla
}
end
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I would not use parm.other in while loops :wink:
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

True in that loop if an allies player triggers the trigger the while will no longer be true .
Image
kai0ty
Brigadier General
Posts: 507
Joined: Fri Mar 19, 2004 1:45 am

Post by kai0ty »

u could just dissable the trigger..........
There are only 10 kinds of people in this world; those who know what binary is, and those who don't.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

kai0ty wrote:u could just dissable the trigger..........
The triggering of any trigger in the map would have that same effect :wink:
Image
kai0ty
Brigadier General
Posts: 507
Joined: Fri Mar 19, 2004 1:45 am

Post by kai0ty »

couldnt u just disable the trigger?
There are only 10 kinds of people in this world; those who know what binary is, and those who don't.
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Post by dcoshea »

chrisjbooth2001 wrote:And any suggestion for give/take weapons?
We already discussed this in your "Immune" thread.
But I want it so i use the trigger and the area with the box then lets you have weapons.. Ie by disabling the thread..
If a thread does something, you can't just "disable" it and everything the thread does/did gets automatically reversed. You need to reverse all those actions the thread took. In the thread I linked to above there are quite a few suggestions about what to do regarding weapons. The last one is to continually force the player to holster their weapon. Of course, when you stop doing that the player could unholster, so disabling the thread lets them unholster, but it would be best to unholster for them, which you'd have to do yourself - it won't be done for you by "disabling the thread".

Regards,
David
Post Reply