Post your scripting questions / solutions here
Moderator: Moderators
Barttje
Sergeant Major
Posts: 111 Joined: Sat Aug 20, 2005 8:52 pm
Post
by Barttje » Tue Feb 07, 2006 2:53 pm
Hi all
How can I remove a trigger for only one player
so the rest can use the triger (once)
tnx
Old nickname: Bartjerambo
New nickname: Barttje
LeBabouin
Lance Corporal
Posts: 22 Joined: Tue Jun 21, 2005 11:10 pm
Post
by LeBabouin » Tue Feb 07, 2006 11:47 pm
Which player? anyone? You? What distinguishes that player from the others? And what game for?
Barttje
Sergeant Major
Posts: 111 Joined: Sat Aug 20, 2005 8:52 pm
Post
by Barttje » Wed Feb 08, 2006 1:44 pm
anyone can use it once, is it possible?
(oh BTW, i'm scripting in notepad so not in mohradaint or whaterver)
bdbodger
Moderator
Posts: 2596 Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:
Post
by bdbodger » Thu Feb 09, 2006 10:01 am
The usually way of doing it is to give a player a value after they have triggered the trigger once then in the thread for the trigger you check if that player has had the value set
mythread:
while(1)
{
$mytrigger waittill trigger
local.player = parm.other
if(local.player.somevalue == 1) // check if value is set yet
end // if value is set thread will end
local.player.somevalue = 1 // if thread didn't end set the vaue for next time
.....
.....
}
end
Barttje
Sergeant Major
Posts: 111 Joined: Sat Aug 20, 2005 8:52 pm
Post
by Barttje » Thu Feb 09, 2006 12:05 pm
(The 2 post up here are wrong posted,,, srry
) - Fixed bdbodger
Tnx bdbodger it works
but if i walk again in to the trigger he is saying the trigger message:
Code: Select all
local.trigger message ".... Blabla ...."
can i disable it to?
bdbodger
Moderator
Posts: 2596 Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:
Post
by bdbodger » Fri Feb 10, 2006 3:57 am
No don't think you can but you and add a iprintln statement to your thread instead of the message key on the trigger or local.player println I think will print a line only to that one player .
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Fri Feb 10, 2006 6:01 am
Doesn't "println" only print to the console and not the screen?
Tom Trude,
bdbodger
Moderator
Posts: 2596 Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:
Post
by bdbodger » Fri Feb 10, 2006 9:19 am
According to a couple of our fine members here at .map it is actually iprint
/forum/viewtopic.php?t=9450&highlight=local+player+print
I knew it was one of the print statements . Backed up by the SDK Docs
iprint( String string, [ Integer bold ] )
prints a string to the player, optionally in bold
Barttje
Sergeant Major
Posts: 111 Joined: Sat Aug 20, 2005 8:52 pm
Post
by Barttje » Fri Feb 10, 2006 2:10 pm
okeey ill do that, Tnx all