Always snap to grid

Legacy:CamperZone

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
... >> ZoneInfo >> CamperZone

I found a custom ZoneInfo that kills you when you stay in too long. Some of the comments are in french but the code itself works just fine. Also you can set the time in UnrealEd itself.

When you go in the zone you will see a timer in the chat saying how much time you have left.

This zone is the best for CTF campers or you can use it for a room with a limit time that you can enter like a redeemer room with lots of pickups.

class CamperZone extends ZoneInfo;
 
// Time to live once inside the zone
var() int  KillTimeR;
 
struct PlayerDansLaZone
{
	var Pawn P;        
	var int TempsSurvi;  //Set a maximum time they can sit there. Once it finishes they are killed.
};
var PlayerDansLaZone PZ[64];
 
function PostBeginPlay(){
	SetTimer(1,true);
}
event Timer(){
	local int i;
	for(i=0;i<64;i++)
		if( PZ[i].P != None ){
			PZ[i].TempsSurvi--;
			if( PZ[i].TempsSurvi == 0 ){
				if( Level.Game.bGameEnded ){
					PZ[i].P.PlayerReplicationInfo.Score+=4;
					SetTimer(0,false);
					}
				BroadcastMessage(""@PZ[i].P.PlayerReplicationInfo.PlayerName@"is now a Dead Camper ", false, 'CriticalEvent');
			    PZ[i].P.health = -1000;
				PZ[i].P.Died( None, '', PZ[i].P.Location );
			    PZ[i].P.PlayerReplicationInfo.Score-=0;
				}
			else
				PZ[i].P.ClientMessage("Time left to move your ass :"@(PZ[i].TempsSurvi));
 
		}
}
// Uses the function of the superclass to add to our list of people to kill in the zone
event ActorEntered( actor Other )
{
	// Executes the function from the superclass to prevent problems with the zone as a whole
	super.ActorEntered(Other);
	// Neither a bot nor a player : Reset and do nothing more
	if( !Other.IsA('TournamentPlayer') && !Other.IsA('Bot') )
		return;
	PZ[Pawn(Other).PlayerReplicationInfo.PlayerID].P=Pawn(Other);
	PZ[Pawn(Other).PlayerReplicationInfo.PlayerID].TempsSurvi=KillTimeR;
}
// Resets when the player/bot leaves the zone
event ActorLeaving( actor Other )
{
	super.ActorLeaving(Other);
	if( !Other.IsA('TournamentPlayer') && !Other.IsA('Bot') )
		return;
	PZ[Pawn(Other).PlayerReplicationInfo.PlayerID].P=none;
	PZ[Pawn(Other).PlayerReplicationInfo.PlayerID].TempsSurvi=0;
}

this is NOT my code i found it in a map called CTF-(SLv)DragonBall_AC.unr (used with rocketx or strangeloves)

[WJF]Cyborg

Tarquin: It might be a good idea to try to contact the author of that map & ask for permission to host the script here

Cyborg the map whas maked by OrgaZmo i cant find him anywhere