Page 1 of 1

Im back again with a message question :)

Posted: Tue Aug 03, 2004 5:17 pm
by G3mInI
I have this script that fires a flak88. Got it from bdbodger I think. Well I have modified a bit and I am trying to get some instruction message to appear on the persons screen when that person and that person only is standing in the trigger.

What I have now just prints over and over while person is there.. I need a way to make this message only appear one time when the person is in the trigger, if person leaves, then I want it to appear again when they are in the trigger.

Code: Select all

//**************************************************************
get_ready_to_fire:

	
	for(local.playr=1;local.playr<= $player.size;local.playr++)
		{
		while($player[local.playr] istouching self)
			{
			local.instruction = $player[local.playr] waitthread instruct_use
			local.instructed = 1
			if($player[local.playr].useheld == 1)
				{
				local.shot_org = $player[local.playr] thread find_spot
    		self.target waitthread fire_cannon local.shot_org
				local.shot_org immediateremove
				wait 5
    		}
			waitframe
			}
		waitframe
		}
end

instruct_use:
	if(local.instructed == NIL)
	{
	local.key = getboundkey1 "+use"
	iprintlnbold_noloc (loc_convert_string "To fire the flak88 (press ") local.key (loc_convert_string " ).")
	wait 1
	iprintlnbold_noloc "Flak will fire wherever you are aimed at."
	}
end
//**************************************************************
This just keeps on printing over and over, quite annoying. Help anyone ?

G3mInI

Posted: Tue Aug 03, 2004 5:43 pm
by jv_map
You need to place it below an if like if(local.instructed != 1) and then do your message. Mind you that getboundkey is never gonna work properly for a mp game :(

Posted: Tue Aug 03, 2004 11:39 pm
by G3mInI
Thanks figured it out.... At first I couldnt figure out how to pass the variable to the other thread... but I got it now :)

G3mInI

Posted: Wed Aug 04, 2004 12:37 am
by lizardkid
so you can easily make new binds by ahving the user type in console for instance

Code: Select all

bind x mykey
and use

level.key = getboundkey1 "+mykey"

and have it in use for the whole map?

Posted: Wed Aug 04, 2004 1:39 am
by bdbodger
is this the flakfire script that I posted just a while ago ? I see you changed the fireheld to useheld and for some reason you are going through every player instead of just the player who trigger the trigger . The thread you posted if it is that script is called from above .

while(1)
{
local.trigger waittill trigger

local.trigger waitthread get_ready_to_fire
}

so put your message thread there instead and maybe just tell the player to use the use key .

while(1)
{
local.trigger waittill trigger
local.instruction = parm.other waitthread instruct_use // this or go through every player in the instuction thread
local.trigger waitthread get_ready_to_fire
}

Posted: Wed Aug 04, 2004 7:48 pm
by G3mInI
Thanks bdbodger that is exactly what I was looking for...just didnt know where to put it. And I changed it all back to the way it was...no more scanning everyone!

Thanks,
G3mInI