46
Feedback & Suggestions / Re: info about crusade
« on: Thursday, March 10, 2016, 15:45:22 PM »
I have made contact, Thanks vanoke for helping with your post.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
class NewRespawn extends Mutator;
var bool bJoinedLate;
event PreBeginPlay()
{
Level.Game.BaseMutator.AddMutator(self);
Log("This mod is property of The -iVg^ Instant Velocity Gaming Community ",'RespawnMod');
Log("Original Mod by -{DG}-Crusade (aka 999) Reworked by LEEFFM",'RespawnMod');
Log("LEEFFM's Respawn Mod Is Loaded",'RespawnMod');
Level.bAllowRespawn = true;
Level.bUnlimitedRespawn = true;
Level.bAllowLateJoin = true;
SetTimer(10.0,True);
}
function respawn (PlayerController aPlayer)
{
if (aPlayer.StartSpot == none)
{
bJoinedLate = true;
log("Player Joined Late... Atempting to spawn NewPlayer!",'LEEFFM');
respawn_NewPlayer (aPlayer);
} else
{
respawn_ExsistingPlayer (aPlayer);
}
}
function respawn_NewPlayer (PlayerController aPlayer)
{
local array<AGP_PlayerStart> Spots;
local AGP_PlayerStart StartSpot;
local class<SoldierClass> sclass ;
local class<Pawn> DefaultPlayerClass;
local int i ;
i = 0;
foreach Level.AllActors(Class'AGP_PlayerStart',StartSpot)
{
if (StartSpot.TeamNumber == aPlayer.PlayerReplicationInfo.Team.TeamIndex)
{
Spots[i] = StartSpot;
i++;
}
}
StartSpot = Spots[ Rand(Spots.Length) ];
aPlayer.StartSpot = StartSpot;
StartSpot.UsePlayerStart();
aPlayer.PawnClass = AGP_GameTeamObjective(Level.Game).GetDefaultPlayerClass(aPlayer);
if ( aPlayer.PawnClass != None )
aPlayer.Pawn = Spawn(aPlayer.PawnClass,,,startSpot.Location,startSpot.Rotation);
if( aPlayer.Pawn==None )
{
DefaultPlayerClass = Level.Game.GetDefaultPlayerClass(aPlayer);
aPlayer.Pawn = Spawn(DefaultPlayerClass,,,startSpot.Location,startSpot.Rotation);
}
if ( aPlayer.Pawn == None )
{
log("Couldn't spawn player of type "$aPlayer.PawnClass$" at "$StartSpot);
aPlayer.GotoState('Dead');
return;
}
aPlayer.Pawn.Anchor = StartSpot;
aPlayer.Pawn.LastStartSpot = StartSpot;
aPlayer.Pawn.LastStartTime = Level.TimeSeconds;
aPlayer.PreviousPawnClass = aPlayer.Pawn.Class;
aPlayer.Possess(aPlayer.Pawn);
aPlayer.PawnClass = aPlayer.Pawn.Class;
aPlayer.Pawn.PlayTeleportEffect(true, true);
aPlayer.ClientSetRotation(aPlayer.Pawn.Rotation);
TriggerEvent( StartSpot.Event, StartSpot, aPlayer.Pawn);
sclass = StartSpot.SpawnClass;
HumanController(aPlayer).newTeamClass (sclass) ;
aPlayer.bGodMode = true;
aPlayer.ClientMessage("ÿ[RespawnMod] Spawn Protection Active! You Cannot Take Damage!");
}
function respawn_ExsistingPlayer ( PlayerController aPlayer )
{
local NavigationPoint startSpot;
local class<Pawn> DefaultPlayerClass;
local class<SoldierClass> sclass ;
startSpot = aPlayer.StartSpot;
if ( aPlayer.PawnClass != None )
aPlayer.Pawn = Spawn(aPlayer.PawnClass,,,startSpot.Location,startSpot.Rotation);
if( aPlayer.Pawn==None )
{
DefaultPlayerClass = Level.Game.GetDefaultPlayerClass(aPlayer);
aPlayer.Pawn = Spawn(DefaultPlayerClass,,,startSpot.Location,startSpot.Rotation);
}
if ( aPlayer.Pawn == None )
{
log("Couldn't spawn player of type "$aPlayer.PawnClass$" at "$StartSpot);
aPlayer.GotoState('Dead');
return;
}
aPlayer.Pawn.Anchor = startSpot;
aPlayer.Pawn.LastStartSpot = AGP_PlayerStart(startSpot);
aPlayer.Pawn.LastStartTime = Level.TimeSeconds;
aPlayer.PreviousPawnClass = aPlayer.Pawn.Class;
aPlayer.Possess(aPlayer.Pawn);
aPlayer.PawnClass = aPlayer.Pawn.Class;
aPlayer.Pawn.PlayTeleportEffect(true, true);
aPlayer.ClientSetRotation(aPlayer.Pawn.Rotation);
TriggerEvent( StartSpot.Event, StartSpot, aPlayer.Pawn);
aPlayer.PlayerReplicationInfo.bDead = false;
aPlayer.PlayerReplicationInfo.bOnlySpectator = false;
aPlayer.PlayerReplicationInfo.bOutOfLives = false;
aPlayer.PlayerReplicationInfo.bIsSpectator = false;
HumanController(aPlayer).SetStartupStage(STAGE_MatchInProgress);
AGP_Character(aPlayer.Pawn).GotoState('');
if (bJoinedLate && Level.Game.IsInState('MatchInProgress'))
{
sclass = AGP_PlayerStart(startSpot).SpawnClass;
HumanController(aPlayer).newTeamClass (sclass) ;
} else
{
bJoinedLate = false;
}
aPlayer.bGodMode = true;
aPlayer.ClientMessage("ÿ[RespawnMod] Spawn Protection Active! You Cannot Take Damage!");
}
function Mutate (string MutateString, PlayerController Sender)
{
local array<string> Parts ;
local string Command ;
local string Option ;
Split( MutateString, " ", Parts);
Command = caps(Parts[0]) ;
Option = caps(Parts[1]) ;
switch (Command)
{
case "endgame":
AdminEndGame(HumanController(Sender));
break;
default:
HumanController(Sender).ClientMessage("Invalid Mutate Command!");
break;
}
}
function AdminEndGame (HumanController HC)
{
if (HC.PlayerReplicationInfo.bAdmin)
{
privateset("AGP_GameMultiPlayer bMPCheatsEnabled 1");
HC.ConsoleCommand("Mpcheat silent endgame");
privateset("AGP_GameMultiPlayer bMPCheatsEnabled 0");
}
}
event Timer()
{
local PlayerController PC;
foreach Level.DynamicActors(Class'PlayerController',PC)
{
if (PC != None)
{
if (Level.Game.IsInState('MatchInProgress'))
{
if(PC.PlayerReplicationInfo != None)
{
if (PC.PlayerReplicationInfo.bDead || PC.PlayerReplicationInfo.bOnlySpectator || PC.PlayerReplicationInfo.bIsSpectator)
{
if (PC.StartSpot != none)
{
PC.Pawn.Destroy();
PC.UnPossess();
respawn(PC);
PC.PlayerReplicationInfo.bDead = false;
PC.PlayerReplicationInfo.bOutOfLives = false;
PC.PlayerReplicationInfo.bIsSpectator = false;
} else
{
if (HumanController(PC).bLatecomer)
{
HumanController(PC).bLatecomer = false;
HumanController(PC).NotifyAdminMessage ("You Joined the Server late!, You will be Automatically assigned a team and be Spawned into game!");
} else
{
if (Level.Game.GameReplicationInfo.Teams[0].Size == Level.Game.GameReplicationInfo.Teams[1].Size)
{
ChangeTeam(PC,0);
} else if (Level.Game.GameReplicationInfo.Teams[0].Size < Level.Game.GameReplicationInfo.Teams[1].Size)
{
ChangeTeam(PC,0);
} else if (Level.Game.GameReplicationInfo.Teams[0].Size > Level.Game.GameReplicationInfo.Teams[1].Size)
{
ChangeTeam(PC,1);
}
respawn(PC);
PC.PlayerReplicationInfo.bDead = false;
PC.PlayerReplicationInfo.bOutOfLives = false;
PC.PlayerReplicationInfo.bIsSpectator = false;
}
}
} else if (PC.bGodMode)
{
PC.bGodMode = false;
PC.ClientMessage("ÿ[RespawnMod] Spawn Protection Is No Longer Active!");
}
}
}
}
}
}
function ChangeTeam (PlayerController C, int Team)
{
local int OldTeam;
local int NewTeam;
if (Team < 2)
{
OldTeam = C.PlayerReplicationInfo.Team.TeamIndex ;
NewTeam = Team;
} else
{
return;
}
if (C.PlayerReplicationInfo.Team.TeamIndex == NewTeam)
{
return;
}
C.StartSpot= none;
if (C.PlayerReplicationInfo.Team != None)
{
HumanController(C).PlayerReplicationInfo.Team.RemoveFromTeam(C);
HumanController(C).RequestChangeTeam(NewTeam);
}
if (Level.Game.GameReplicationInfo.Teams[NewTeam].AddToTeam(C))
{
}
}
class SOCOMPlayerController extends HumanController;
var SOCOMGameM SGM; //added
replication
{
reliable if ( Role < 4 )
respawn;
}
event PreBeginPlay () //added
{
super.PreBeginPlay();
SGM=Spawn(Class'SOCOMGameM');
}
exec function respawn ()
{
if (PlayerReplicationInfo.bDead)
{
UnPossess ();
Pawn.Destroy ();
Pawn = Spawn(PawnClass,,,StartSpot.Location,StartSpot.Rotation);
Possess (Pawn) ;
PawnClass = Pawn.Class;
ClientSetRotation(Pawn.Rotation);
if(Pawn.Class != None)
{
PlayerReplicationInfo.bDead = false;
PlayerReplicationInfo.bOutOfLives = false;
PlayerReplicationInfo.bIsSpectator = false;
SetStartupStage(6);
bGodMode = True; // added
SGM.settimer(10,false); //added
}
}
}
class SOCOMGameM extends Mutator;
event PreBeginPlay ()
{
Level.Game.BaseMutator.AddMutator(self);
}
function Timer ()
{
local PlayerController PC;
foreach Level.AllActors(Class'PlayerController',PC)
{
PC.bGodMode = false;
}
}
[Engine.Engine]
DefaultServerGame=Assist_GamePlay.AGP_GameTeamObjectiveRespawn
[Engine.GameEngine]
ServerActors=Assist_GamePlay.Respawn_Main
class AGP_GameTeamObjectiveRespawn extends AGP_GameTeamObjective;
state MatchInProgress
{
function CheckScore(PlayerReplicationInfo Scorer)
{
super(AGP_GameDeathMatch).CheckScore(Scorer); // allows respawn
}
}
class Respawn_HumanController extends HumanController;
var Respawn_main RM;
event PreBeginPlay ()
{
super.PreBeginPlay();
RM=Spawn(Class'Respawn_Main');
Level.bAllowRespawn = true;
}
state Dead
{
function BeginState()
{
super.BeginState();
Level.bAllowRespawn = false;
RM.settimer(5,false);
}
}
class Respawn_Main extends Mutator;
var array<AGP_PlayerStart> Spots;
event PreBeginPlay()
{
Level.Game.BaseMutator.AddMutator(self);
Level.Game.PlayerControllerClassName="Assist_GamePlay.Respawn_HumanController";
Log("Original Mod by -{DG}-Crusade Modified by BnA.^ LEEFFM",'RespawnMod');
Log("Respawn_Main Loaded",'RespawnMod');
Level.bAllowRespawn = true;
}
function respawn(PlayerController Sender)
{
local AGP_PlayerStart StartSpot;
local byte i;
i = 0;
foreach Level.AllActors(Class'AGP_PlayerStart',StartSpot)
{
if (StartSpot.TeamNumber == Sender.PlayerReplicationInfo.Team.TeamIndex)
{
Spots[i] = StartSpot;
i++;
}
}
StartSpot = Spots[ Rand(Spots.Length) ];
if ( (Sender.PlayerReplicationInfo.bDead && Level.bAllowRespawn) || (Sender.PlayerReplicationInfo.bOnlySpectator) && Level.bAllowRespawn )
{
Sender.Pawn.Destroy();
Sender.Pawn = Spawn(Sender.PawnClass,,,StartSpot.Location,StartSpot.Rotation);
Sender.PlayerReplicationInfo.bOnlySpectator = false;
Sender.Possess(Sender.Pawn);
Sender.PawnClass = Sender.Pawn.Class;
Sender.ClientSetRotation(Sender.Pawn.Rotation);
if(Sender.Pawn.Class != None)
{
Sender.PlayerReplicationInfo.bDead = false;
Sender.PlayerReplicationInfo.bOutOfLives = false;
Sender.PlayerReplicationInfo.bIsSpectator = false;
HumanController(Sender).SetStartupStage(1);
Sender.bGodMode = True;
settimer(10,false);
enable('Tick');
}
}
}
function Timer()
{
local PlayerController PC;
foreach Level.AllActors(Class'PlayerController',PC)
{
if (PC.PlayerReplicationInfo.bDead)
{
Level.bAllowRespawn = true;
respawn(PC);
}else if (PC.bGodMode)
{
PC.bGodMode = false;
}
}
}