|
Hyper.nl Unreal Services The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
|
View previous topic :: View next topic |
Author |
Message |
TheGuyWhoGotOn
Joined: 21 Nov 2006 Posts: 40
|
Posted: Thu Nov 18, 2010 1:57 am Post subject: Restart Map On Death |
|
|
I was wondering if anyone has a mod or some uscript I could use to make it so if any players die that the server either re-loads the current map or re-loads a state so people would be back to their health, armour, and ammo after someone dies.
Thanks |
|
Back to top |
|
|
Zombie
Joined: 27 Jan 2004 Posts: 295
|
Posted: Sun Nov 28, 2010 10:39 pm Post subject: |
|
|
Since this question was answered and resolved from the Oldunreal forum I will post the working solution here below too.
227 GameRules + mutator code (by Dots):
Code: | class UnrealSurvival extends Mutator;
function PreBeginPlay()
{
local GameRules G;
G = Spawn(class'USGR');
if( Level.Game.GameRules==None )
Level.Game.GameRules = G;
else Level.Game.GameRules.AddRules(G);
Destroy();
} |
Code: | class USGR extends GameRules;
function NotifyKilled( Pawn Killed, Pawn Killer, name DamageType )
{
local Pawn P;
if(Killed.isA('PlayerPawn'))
{
for( P=Level.PawnList; P!=None; P=P.nextPawn )
if( P.bIsPlayer && P!=Killed && PlayerPawn(P)!=None && P.Health>0 && !P.PlayerReplicationInfo.bIsSpectator )
return;
Level.ServerTravel("?restart",false);
}
}
function bool CanRestartPlayer( PlayerPawn Other )
{
if( Other.Health<=0 )
Other.GoToState('PlayerSpectating');
return false;
}
defaultproperties
{
bHandleDeaths=true
bHandleMapEvents=true
} |
Note: For players to keep what is left of their inventory after every level restart with a gametype that retains inventory, change the Level.ServerTravel function call second parameter to true.
EDIT: 1/27/2011
Compiled by Gizzy with link: http://www.freewebs.com/unrealgizzy/UnrealSurvival.zip
Mutator: UnrealSurvival.UnrealSurvival
-Zombie _________________ GameType: JCoopZ1 - Build137 (11/30/12)
Mutator: DZMapM - 2.34 (12/15/11) |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|