Page 1 of 1

Anti-save & Checkpoint

Posted: August 26th, 2006, 6:16 am
by profinuyasha
hey drofder, i tried to make Anti-save for if you do melee then you die to keep people lnot do save and other to make you to save if you are in checkpoint, you know?

here script i tried:

Code: Select all

main()
{
	thread antisave();
	//thread checkpoint();
}

antisave()
{
	as = getent("as","targetname");
	while (1)
	{
		as waittill ("trigger",player);
		if(player isTouching(as) && player meleeButtonPressed())
		{
			user suicide();
			user iprintlnbold("Anti-Save Zone!");
		}
	}
}

checkpoint() //WORKING ON..........
{
	checkpoint = getent("cps","targetname");
	while (1)
	{
		checkpoint waittill ("trigger",player);
		if(player isTouching(checkpoint) && player meleeButtonPressed())
		{
			(need know script to make server to force people to save
			user iprintlnbold("Checkpoint Zone!");
		}
	}
}
1st brushmodel
trigger_multiple
key: targetname
value: as

2nd brushmodel
trigger_multiple
key: targetname
value: cps

my friend tried it and it doesnt work....how can i make it work on trigger_multiple to detect people's melee

Posted: August 26th, 2006, 12:01 pm
by creator
like i said for 'anti save' make a trig_damage select everything except melee so it only be triggerd by melee
then make a trigger hurt or script that kills u if u bash it :P

Posted: August 26th, 2006, 1:24 pm
by Drofder2004
creator wrote:like i said for 'anti save' make a trig_damage select everything except melee so it only be triggerd by melee
then make a trigger hurt or script that kills u if u bash it :P
You have no idea what he means by anti save do you :P

Lets me quickly open up the codjumper mod and get the variables and I will reply back in 2 seconds.

Posted: August 26th, 2006, 1:33 pm
by creator
yes i do... but i mean u need to bash 2x to save so if he get triggers by 1 bash he cant save and dies

Posted: August 26th, 2006, 2:01 pm
by Drofder2004
To do...
Firstly make all your chckpoint triggers, trigger_use. this is important as when the player presses use, their save position will be changed.
Once you have done that, give ALL the checkpoint triggers a targetname of "checkpoint", this is very important.

---------
The main thread. This first loads up the "connect check" thread.
It then gets an array of all the checkpoint triggers, and sends them all to the "checkpoint check" thread.

Code: Select all

main()
{
thread check_connect();

check = getentarray("checkpoint","targetname");
for(i=0;i<check.size;i++)
{
   check[i] thread checkpoint_check();
}
}
This thread will simply keep running... If someone connects to your server, this player will be sent to the "no save" thread.

Code: Select all

check_connect()
{
while(1)
{
level waittill("connected",other);
other thread no_save();
}
}
The no save thread simply works on the same way as the jump mod works. First of all it sets a checkpoint (you need to change this to the start of your map). It then every 1/20 of a second, tells the server to set the saved origin to the checkpoints origin. So if a player saves, it is automatically rewritten to this position. when the checkpoint origin changes, the saved position will change.

Code: Select all

no_save()
{
if(!isDefined(self.checkpoint))
   self.checkpoint = (0,0,0); 

for(;;)
{
self.saved_origin = self.checkpoint;
wait 0.05;
}
}
This thread will be the thread that checks when a trigger is used. When a trigger is used the player then saves his position at his origin.

Code: Select all

checkpoint_check()
{
while(1)
{
self waittill("trigger",user);
user.checkpoint = user.origin;
}
}

Posted: August 26th, 2006, 2:02 pm
by Drofder2004
creator wrote:yes i do... but i mean u need to bash 2x to save so if he get triggers by 1 bash he cant save and dies
Trust me, you need to look at how the mod works before you just guess ;)

Posted: August 26th, 2006, 3:06 pm
by creator
i did... but i try'd to do that but there was something wrong so i was thinking i was wrong :P

Posted: August 26th, 2006, 3:39 pm
by profinuyasha
ah ty, gonna work on it, does it can work on map while it require jumpmod right but it will make people cannot save while jumpmod is on right?

Posted: August 26th, 2006, 3:58 pm
by profinuyasha
okay if i died....how can i load or i had to load myself right?

Posted: August 26th, 2006, 5:55 pm
by Drofder2004
The script requires the jump mod. all it does (if it works) is just changes the save position of each player. It does not stop the player saving, but when they save, their position is always reset to their checkpoint position. you should still be able to load fine with the mod.

Posted: August 26th, 2006, 10:08 pm
by profinuyasha
Anonymous wrote:all right, but i like to make a anti-save then they will unable to save until they press checkpoint then they can save, you know?
erm....delete that guest please, CJ suppose remember my username to login....it didnt! *growling @ codjumper*

Posted: August 27th, 2006, 11:35 pm
by Guest
i tested it...it doesnt work :'(