I can get all the way nearly >.<KillerSam wrote:doubt it drofder...you will get through first door MAYBE, then u r screwed...i can swear that.
Key input?
Moderator: Core Staff
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London

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
Drofder, i've been trying to get a trigger to play a sound just for the user that triggers it but so far i can only get it to work for text.
here the code i used
It works for the text, but the sound just works as normal so if a player triggers it anyone in range of it also hears it
do u know how to make it work for sounds too?
here the code i used
Code: Select all
gap260()
{
gap260_trig = getent ("260_trig","targetname");
gap260_org = getent ("260_org", "targetname");
while (1)
{
players = getentarray("player", "classname");
for(i=0;i<players.size;i++)
{
gap260_trig waittill ("trigger",user);
user iprintlnbold ("Well done, you're a pro! Now go make a new record in the EXPERTZ ONLY section!");
user playsound("clap");
wait 3;
}
wait 3;
}
}

-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Code: Select all
gap260()
{
gap260_trig = getent ("260_trig","targetname");
gap260_org = getent ("260_org", "targetname");
while (1)
{
gap260_trig waittill ("trigger",user);
user iprintlnbold ("Well done, you're a pro! Now go make a new record in the EXPERTZ ONLY section!");
user playsound("clap");
wait 3;
}
}
Code: Select all
gap260()
{
gap260_trig = getent ("260_trig","targetname");
gap260_org = getent ("260_org", "targetname");
while (1)
{
gap260_trig waittill ("trigger",user);
user iprintlnbold ("Well done, you're a pro! Now go make a new record in the EXPERTZ ONLY section!");
user playlocalsound("clap");
wait 3;
}
}

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
Thanks, works 
Code: Select all
user playlocalsound

-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Yeh, I found it in my "command list" and it looked like the answer so I edittedLuke wrote:Thanks,worksCode: Select all
user playlocalsound


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
What about when its a differen't kind of trigger, like trigger damage. since it's triggered by damage and not the user, is it still possible to do the same thing?
If its possible could u try it on this plz?
If its possible could u try it on this plz?
Code: Select all
secret_door()
{
door1_trig = getent("door1_trig","targetname");
door1 = getent ("door1","targetname");
while (1)
{
door1_trig waittill ("damage", idamage);
if(idamage > 100)
{
user iprintlnbold ("Great Shot!");
door1 moveto ((0, 48, 0), 3,1,2);
door1 waittill ("movedone");
wait 3;
door1 moveto ((0, 0, 0), 3,1,2);
door1 waittill ("movedone");
wait 5;
}
else if(idamage < 100)
user iprintlnbold ("Try again");
}
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
The accumulating damage switch.
A run down on what this script does.
When the thread is started it sets accum to 0. (Accum can be named anything you want).
The "while" script is then set in motion, it will keep running, until accum becomes greater than 300.
While this is running, the door trigger is waiting until it takes damage, and it record the damage it takes as "iDamage" (this can also be renamed).
iDamage is then accumulated by this piece of code
How this works.
accum = 0 and iDamage = 50.
accum (0) + iDamage(50) = accum(now accum = 50 not 0).
accum(50) + iDamage(50) = accum(100)
accum(100)....
Once accum = 300+ the while script ends and the script continues.
The door opens and then closes again. (This can be any action, moving platform, door, etc)
The thread is restarted.
Accum is reset to 0.
Have Fun
Code: Select all
main()
{
thread door_trigger();
}
door_trigger()
{
door1_trig = getent("door1_trig","targetname");
door1 = getent ("door1","targetname");
accum = 0;
while (accum < 300)
{
door1_trig waittill ("damage", iDamage);
{
accum = accum + iDamage;
}
}
door1 movez(300, 1);
door1 waittill("movedone");
door1 movez(-300, 1);
door1 waittill("movedone");
thread door_trigger();
}
When the thread is started it sets accum to 0. (Accum can be named anything you want).
The "while" script is then set in motion, it will keep running, until accum becomes greater than 300.
While this is running, the door trigger is waiting until it takes damage, and it record the damage it takes as "iDamage" (this can also be renamed).
iDamage is then accumulated by this piece of code
Code: Select all
accum = accum + iDamage;
accum = 0 and iDamage = 50.
accum (0) + iDamage(50) = accum(now accum = 50 not 0).
accum(50) + iDamage(50) = accum(100)
accum(100)....
Once accum = 300+ the while script ends and the script continues.
Code: Select all
door1 movez(300, 1);
door1 waittill("movedone");
door1 movez(-300, 1);
door1 waittill("movedone");
Code: Select all
thread door_trigger();
Accum is reset to 0.
Have Fun


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
sweet! thanksDrofder2004 wrote:The accumulating damage switch.
A run down on what this script does.Code: Select all
main() { thread door_trigger(); } door_trigger() { door1_trig = getent("door1_trig","targetname"); door1 = getent ("door1","targetname"); accum = 0; while (accum < 300) { door1_trig waittill ("damage", iDamage); { accum = accum + iDamage; } } door1 movez(300, 1); door1 waittill("movedone"); door1 movez(-300, 1); door1 waittill("movedone"); thread door_trigger(); }
When the thread is started it sets accum to 0. (Accum can be named anything you want).
The "while" script is then set in motion, it will keep running, until accum becomes greater than 300.
While this is running, the door trigger is waiting until it takes damage, and it record the damage it takes as "iDamage" (this can also be renamed).
iDamage is then accumulated by this piece of codeHow this works.Code: Select all
accum = accum + iDamage;
accum = 0 and iDamage = 50.
accum (0) + iDamage(50) = accum(now accum = 50 not 0).
accum(50) + iDamage(50) = accum(100)
accum(100)....
Once accum = 300+ the while script ends and the script continues.The door opens and then closes again. (This can be any action, moving platform, door, etc)Code: Select all
door1 movez(300, 1); door1 waittill("movedone"); door1 movez(-300, 1); door1 waittill("movedone");
The thread is restarted.Code: Select all
thread door_trigger();
Accum is reset to 0.
Have Fun

-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Maybe you can fix the bug near the end that stops the platforms from being used only oncePedsdude wrote:Niiiiiiiiiiiiiiiice
By the way, I'm redesigning the secret room to stop people getting as close as they have done, so will rerelease a later version of peds_pace in the near future.

Also, maybe add something to the end to notify them they are finished.
Code: Select all
end_trig = getent("end_trig","targetname");
while(1)
{
end_trig waittill ("trigger",user);
user iprintlnbold("Congrats");
}

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
In one of the scripts i showed u for the text (which i found somewhere) it also had this peice of code after the while (1)Drofder2004 wrote:Maybe you can fix the bug near the end that stops the platforms from being used only oncePedsdude wrote:Niiiiiiiiiiiiiiiice
By the way, I'm redesigning the secret room to stop people getting as close as they have done, so will rerelease a later version of peds_pace in the near future.
Also, maybe add something to the end to notify them they are finished.
Code: Select all
end_trig = getent("end_trig","targetname"); while(1) { end_trig waittill ("trigger",user); user iprintlnbold("Congrats"); }
Code: Select all
players = getentarray("player", "classname");
for(i=0;i<players.size;i++)
{

-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
It took me a lot of reading and asking questions to find out what this done (I thank Ezekiel Victor for his help).Luke wrote: In one of the scripts i showed u for the text (which i found somewhere) it also had this peice of code after the while (1)I left that in there coz i thought maybe u forgot to add it in the new script you suggested, but u didn't add it for peds script either...so is that not needed? whats it for otherwiseCode: Select all
players = getentarray("player", "classname"); for(i=0;i<players.size;i++) {
So heres how I got to understand it (broken down).
Code: Select all
players = getentarray("player", "classname");
getEntArray means Get an Array of Entities.
In the code above, the array that is being looked for is a classname. A classname is given to most things, trigger_use, trigger_multiple, etc.
The classname player is given to... players.
So the script finds all the players on the server. Each player is then put into a list by the script.
The list:
Players (i meaning Integer [number])
so, if 3 players are on the server, each player is given a number.
Players[1]
Players[2]
Players[3]
Once it has found all the players it then starts the for statement.
Code: Select all
for(i=0;i<players.size;i++)
for(start value;while;task)
Code: Select all
i=0
Code: Select all
i<players.size
Code: Select all
While, 'i' is less than the amount of players.
Code: Select all
i++
i = i + 1 is the same as i++
So this is how the for loop is readin English.
Code: Select all
'i' equals 0. While 'i' is less than the amount of players, add 1 to 'i'
Code: Select all
players[i] thread dosomething();
This whole script will simply take every player on the server and make them each individually do a task.
I recommend NOT using this for loop in a map as it will not work correctly. The for loop will not detect players who join late, only players who are there when the loop is run. Stick to using the while loops.
Hope you understand that


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
Who is online
Users browsing this forum: No registered users and 2 guests