Anti-save & Checkpoint

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
profinuyasha
CJ Newbie
CJ Newbie
Posts: 88
Joined: February 21st, 2006, 1:06 am
Contact:

Anti-save & Checkpoint

Post by profinuyasha » August 26th, 2006, 6:16 am

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
Image
Image
DYOR :-)

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 26th, 2006, 12:01 pm

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
Cod 1 Mapper&Modder&Moddeler

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » August 26th, 2006, 1:24 pm

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.
Image
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 26th, 2006, 1:33 pm

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
Cod 1 Mapper&Modder&Moddeler

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » August 26th, 2006, 2:01 pm

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;
}
}
Image
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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » August 26th, 2006, 2:02 pm

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 ;)
Image
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 26th, 2006, 3:06 pm

i did... but i try'd to do that but there was something wrong so i was thinking i was wrong :P
Cod 1 Mapper&Modder&Moddeler

profinuyasha
CJ Newbie
CJ Newbie
Posts: 88
Joined: February 21st, 2006, 1:06 am
Contact:

Post by profinuyasha » August 26th, 2006, 3:39 pm

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?
Image
Image
DYOR :-)

profinuyasha
CJ Newbie
CJ Newbie
Posts: 88
Joined: February 21st, 2006, 1:06 am
Contact:

Post by profinuyasha » August 26th, 2006, 3:58 pm

okay if i died....how can i load or i had to load myself right?
Image
Image
DYOR :-)

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » August 26th, 2006, 5:55 pm

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.
Image
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

profinuyasha
CJ Newbie
CJ Newbie
Posts: 88
Joined: February 21st, 2006, 1:06 am
Contact:

Post by profinuyasha » August 26th, 2006, 10:08 pm

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*
Image
Image
DYOR :-)

Guest

Post by Guest » August 27th, 2006, 11:35 pm

i tested it...it doesnt work :'(

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests