Forum

ASSIST, AMERICA'S ARMY COMMUNITY


Author Topic: RespawnMod v1.2 [Release]  (Read 53625 times)

0 Members and 1 Guest are viewing this topic.

Offline LEEFFM

RespawnMod v1.2 [Release]
« on: Monday, February 15, 2016, 23:03:49 PM »
You can download the RespawnMod v1.2 from http://downloads.fallen-ones.net/AA/25/respawnmod%20v1-2.zip
Features:
- Unlimited Respawn!
- Join Mid-game!
- Automatic Respawn | Credit to Possessed for Automating the Respawn!
- 10 second Spawn Protection/God Mode!

Known Bugs:
- After Respawning SAI(Radar) doesnt work.
- Once in a while you will be stuck in spectator unable to respawn and you have to reconnect to the server or wait till the end of the round to respawn.

Things To Be Added and/or Fixed:
-Fix SAI not working after respawn.
-Fix Ocasionally not being able to respawn.

Assist Sever Name: *** The Fallen Ones | Anti-DDOS | Respawn Server ***

you can email me @ [email protected] with any questions or any bugs you discover that are not already listed here.

NewRespawn.uc:
Code: [Select]
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))
    {
    }
}
« Last Edit: Friday, July 13, 2018, 06:55:54 AM by LEEFFM »

Offline Vanoke

  • Epic Poster
  • ******
  • Posts: 1,757
  • Real war is to a GAME!!
    • View Profile
  • AA: =PUF=Vanoke
Re: RespawnMod [ServerMod]
« Reply #1 on: Tuesday, February 16, 2016, 03:39:34 AM »
Thx!!!!!

Offline Vanoke

  • Epic Poster
  • ******
  • Posts: 1,757
  • Real war is to a GAME!!
    • View Profile
  • AA: =PUF=Vanoke
Re: RespawnMod [ServerMod]
« Reply #2 on: Tuesday, February 16, 2016, 16:06:59 PM »
is it working with  3v3 ore 4v4  . i got it in server all i did had 1 feeling of respawn but than nothing . i got 9 players but no respawn need better info i see in downlode also classes doc and make.ini    ??
« Last Edit: Tuesday, February 16, 2016, 16:42:54 PM by Vanoke »

Offline LEEFFM

Re: RespawnMod [ServerMod]
« Reply #3 on: Friday, November 25, 2016, 14:14:15 PM »
***UPDATE Check First Post!!***

Offline Possessed

  • bWpnRecoil == False;
  • Administrator
  • Epic Poster
  • *
  • Posts: 3,478
  • You suffer, but why?!
    • View Profile
    • nsfw
  • AA: Possessed
Re: RespawnMod [ServerMod]
« Reply #4 on: Friday, November 25, 2016, 16:51:21 PM »
store the last weapon the player had > check if the player has a weapon > if not give him one.
why you have set respawn attached with a mutate command??
can you show the source code ^^?
These things I have spoken unto you, that in me ye might have peace. In the world ye shall have tribulation: but be of good cheer; I have overcome the world.
John 16:33


Offline LEEFFM

RespawnMod v1.2 [Release]
« Reply #5 on: Tuesday, November 29, 2016, 01:17:12 AM »
Some Bugs Fixed!
Mod and Source Code Released!
***Please Check Main Post***

Offline Vanoke

  • Epic Poster
  • ******
  • Posts: 1,757
  • Real war is to a GAME!!
    • View Profile
  • AA: =PUF=Vanoke
Re: RespawnMod v1.2 [Release]
« Reply #6 on: Tuesday, November 29, 2016, 15:13:16 PM »
I did puth it in server 11 leefm but I end up above the field.

Offline LEEFFM

Re: RespawnMod v1.2 [Release]
« Reply #7 on: Tuesday, November 29, 2016, 22:37:00 PM »
***Download and Source Code have been updated***

Offline LEEFFM

Re: RespawnMod v1.2 [Release]
« Reply #8 on: Friday, July 13, 2018, 06:56:51 AM »
***Original Post and Download Link Updated***
***Check Original Post***

 

Download Assist

×

Download Game Client


Download Server Manager