no save + kill script
Moderator: Core Staff
no save + kill script
ive tried making a kill script but it does not work - here it is:
room1trigger(){
thread killplayer();
trigger = getent("room1trig","targetname");
door = getent("door1","targetname");
exit = getent("room1exit","targetname");
kill = getent("room1kill","targetname");
while(true){
trigger waittill ("trigger", user );
door moveZ(150, 5, 3, 2);
exit moveZ(60, 10, 6, 4);
wait 10;
door moveZ(-150, 5, 3, 2);
exit moveZ(-60, 10, 6, 4);
wait 10;
}
}
killplayer(){
exit = getent("room1exit","targetname");
kill = getent("room1kill","targetname");
kill enablelinkto();
kill linkto (exit);
while(true){
kill waittill("trigger", user);
players = getEntArray("player", "classname");
for(i=0;i<players.size;i++){
if(players IsTouching(exit) ){
players suicide();
}
}
}
}
alos how would i go about making a no save script or area?
room1trigger(){
thread killplayer();
trigger = getent("room1trig","targetname");
door = getent("door1","targetname");
exit = getent("room1exit","targetname");
kill = getent("room1kill","targetname");
while(true){
trigger waittill ("trigger", user );
door moveZ(150, 5, 3, 2);
exit moveZ(60, 10, 6, 4);
wait 10;
door moveZ(-150, 5, 3, 2);
exit moveZ(-60, 10, 6, 4);
wait 10;
}
}
killplayer(){
exit = getent("room1exit","targetname");
kill = getent("room1kill","targetname");
kill enablelinkto();
kill linkto (exit);
while(true){
kill waittill("trigger", user);
players = getEntArray("player", "classname");
for(i=0;i<players.size;i++){
if(players IsTouching(exit) ){
players suicide();
}
}
}
}
alos how would i go about making a no save script or area?
Re: no save + kill script
If something isn't working, you should try and debug it. iPrintLnBold() is one of the best ways to do it.
-
- CJ Wannabe
- Posts: 34
- Joined: November 8th, 2012, 8:15 pm
- Gamertag: Original Lithy
- Location: France
Re: no save + kill script
No save script :
Code: Select all
main()
{
level.trig_stopsave=getent("nosave","targetname"); //the only brushmodel out of the 'no draw not solid' texture
level thread cunt();
}
cunt()
{
while(-1111111111111111111111111111111)
{
wait 0; //hopefully this will work. so the rest of the loop will run after the player may have saved their position. so it will be overriden within the same frame, not in .05 second.
players = getEntArray("player", "classname");
for (i = 0; i < players.size; i++)
{
if (players[i].sessionstate != "playing")
continue;
if (!players[i] isTouching(level.trig_stopsave))
{
if (isDefined(players[i].defloration))
players[i].defloration = undefined;
continue;
}
if (!isDefined(players[i].defloration))
for (a = 1; a < 4; a++)
{
players[i].defloration = 1;
players[i].cj["save_backup"]["org"+a]=players[i].cj["save"]["org"+a];
players[i].cj["save_backup"]["ang"+a]=players[i].cj["save"]["ang"+a];
}
else
for (a = 1; a < 4; a++)
if (players[i].cj["save"]["org"+a] != players[i].cj["save_backup"]["org"+a])
{
players[i].cj["save"]["org"+a] = players[i].cj["save_backup"]["org"+a];
players[i].cj["save"]["ang"+a] = players[i].cj["save_backup"]["ang"+a];
}
}
wait .05;
}
}
Re: no save + kill script
what is defloration?
Re: no save + kill script
thanks alot! i dont understand some things though, like defloration and some other things
Re: no save + kill script
it only works with a single trigger, not combined script_brushmodels
Re: no save + kill script
it doesnt work at all actuallly..
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: no save + kill script
No save zones are a built in feature to the CJ mod (3.12b).
viewtopic.php?f=29&t=14623&p=163011
Just set up the brush and the mod will do the rest.
As for your script, like Megazor said, enter some "else" and "iprintln" calls to your if statements and check to see what is going on.
Make sure you are using /developer 1 and if you have an error, post it.
viewtopic.php?f=29&t=14623&p=163011
Just set up the brush and the mod will do the rest.
As for your script, like Megazor said, enter some "else" and "iprintln" calls to your if statements and check to see what is going on.
Make sure you are using /developer 1 and if you have an error, post it.
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
Re: no save + kill script
okay thanks but can you explain what defloration is?
Re: no save + kill script
It is what you will experience some day.
Anyway, why didn't you ask what cunt() or while(-1111111111111111111111111111111) was for?
Ok, I'll explain.
At first, player.defloration is undefined.
Once the player has touched the no save entity, player.defloration becomes 1 (getting defined), plus the position of the player is backed up. From then, if the player is still in the no save zone, their saved positions are forced to the backed up ones. Once the player has left the no save zone, player.defloration gets undefined, and you can read my explanation again.
Anyway, why didn't you ask what cunt() or while(-1111111111111111111111111111111) was for?
Ok, I'll explain.
At first, player.defloration is undefined.
Once the player has touched the no save entity, player.defloration becomes 1 (getting defined), plus the position of the player is backed up. From then, if the player is still in the no save zone, their saved positions are forced to the backed up ones. Once the player has left the no save zone, player.defloration gets undefined, and you can read my explanation again.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: no save + kill script
Just to make sure you fully understand, the use of the terms "defloration" and "cunt" are not standard within CoDScript
Also, stop asking what defloration is, your parents should be explaining the birds and the bees, not CoDJumper.
Also, stop asking what defloration is, your parents should be explaining the birds and the bees, not CoDJumper.
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
Re: no save + kill script
i just wanted to make sure it wasnt an object variable :c, thanks for the explanation mega, it makes sense; i only know javascript, this stuff is pretty alienated to me.. im getting more accustomed to it
Who is online
Users browsing this forum: No registered users and 2 guests