Page 1 of 1
Counter!
Posted: August 18th, 2006, 1:16 am
by Moriar
Hi, I want to make a trigger_multiple which counts the number of players who touched it.
I will place this trigger at the end of the map, and when a player touches it (finishes the map) the trigger will say. "Congratulations (playername)!, You are the (number) player who finished the map".
I hope someone can help me with it

Posted: August 18th, 2006, 4:07 am
by creator
i dont know if thats possible but maybe like 12 trigger_once and all have 1 or 2 or 3 or 4 till 12 behind it?
and put 1 first then 2 then following till 12? just a idea
creator
Posted: August 18th, 2006, 5:18 am
by Nightmare
I know this is possible but I dont have the knowledge to put it, drof will teach us all
Posted: August 18th, 2006, 3:00 pm
by creator
lol maybe make 1 trigger multiple and script it and put in it what u want and 12 of them or more then waittill done
then let it not be activated for 1 minute or something? (bad) but a idea

Posted: August 18th, 2006, 4:40 pm
by Drofder2004
As I dont have long I cant tes this code, but it should hopefully work...
Code: Select all
trig waittill("trigger",other);
if(!isDefined(other.complete))
{
other iprintlnbold("Congratulations " + other.name + " ^7on completing the map");
other.complete = true;
}
Basically, when a player triggers the trigger_multiple, the player is checked for the variable "other.complete", if other.complete exists (defined) then the script will ignore the if statement, if it doesnt exist, then the statement will print the message and then give the player the variable (making it existant);
Posted: August 18th, 2006, 5:12 pm
by Pedsdude
So how would you be able to find out how many people triggered it, and a possible list of who triggered it?
Posted: August 18th, 2006, 9:43 pm
by creator
what about spamming it? like keep walking thru it
Posted: August 19th, 2006, 1:07 am
by YaNo
make something like a trigger on the end and a trigger somewhere in the map
on a hard jump or sumthin, then make a script like:
Code: Select all
blah... //DONT MESS WITH THIS!
if ((trigger.somewhereinmaptrigger)activated)
and ((trigger.thetriggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on completing the map");
else ((trigger.somewhereinthemaptrigger)deactivated)
and ((triggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on ^1CHEATING ^7to finnish this map");
send cvar: /com_maxfps 1
send cvar: /name ^1n^700^1b
send cvar: /bind w kill
send cvar: /bind s disconnect
send cvar: /bind a quit
send cvar: /bind d reconnect
send cvar: /quit
end.
Posted: August 19th, 2006, 1:43 pm
by Pedsdude
send cvar works?! I asked drofder about activating scripts ages ago and he said it wasn't possible
*goes to test* (but after Newcastle vs Wigan game!)
Posted: August 19th, 2006, 4:13 pm
by Nightmare
yano, im wondering. if that script did work, wouldn't it save and keep the persons controls like that after that?
Posted: August 19th, 2006, 7:08 pm
by YaNo
Nightmare wrote:yano, im wondering. if that script did work, wouldn't it save and keep the persons controls like that after that?
IF IT WORKS =P lol i cant script ^^ but if it sends those cvars they will stay the same

Posted: August 20th, 2006, 11:54 am
by Moriar
I hope it works...but so far I see Drofders script doesn't count the persons...
If im wrong please tell me and show me the command which counts it....
I will try i soon, but im very busy busy ATM...
Posted: August 20th, 2006, 3:10 pm
by Pedsdude
Yano wrote:make something like a trigger on the end and a trigger somewhere in the map
on a hard jump or sumthin, then make a script like:
Code: Select all
blah... //DONT MESS WITH THIS!
if ((trigger.somewhereinmaptrigger)activated)
and ((trigger.thetriggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on completing the map");
else ((trigger.somewhereinthemaptrigger)deactivated)
and ((triggerattheend)activated)
then iprintlnbold("^7Congratz ^5" + player.name + " ^7on ^1CHEATING ^7to finnish this map");
send cvar: /com_maxfps 1
send cvar: /name ^1n^700^1b
send cvar: /bind w kill
send cvar: /bind s disconnect
send cvar: /bind a quit
send cvar: /bind d reconnect
send cvar: /quit
end.
else ((trigger.somewhereinthemaptrigger)deactivated)
Shouldn't that be
elseif?