Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 |
//============================================================================= // Trigger_ASForcePlayerRespawn //============================================================================= // Triggered Actor that will respawn the Instigator. //============================================================================= class Trigger_ASForcePlayerRespawn extends Triggers; var() enum EPSM_AssaultTeam { EPSM_Attackers, EPSM_Defenders, } AssaultTeam; var() enum EFTR_Constraint { EFTRC_All, EFTRC_PawnClass, } Constraint; var() class<Pawn> ConstraintPawnClass; // Trigger will only be relevant to a specific Pawn class ? var() name PSM_OverrideTag; // force player to use a specific PlayerStartManager var() bool bTryToRepossess; // Try to repossess old Pawn instead of Spawning a new one (when driving a vehicle...) event Trigger( Actor Other, Pawn EventInstigator ) { local Controller C; if ( Role < Role_Authority || !Level.Game.IsA('ASGameInfo') ) return; if ( EventInstigator == None ) return; C = EventInstigator.Controller; if ( (C!=None) && (C.PlayerReplicationInfo != None) && !C.PlayerReplicationInfo.bOnlySpectator && ApprovePlayerTeam(C.PlayerReplicationInfo.Team.TeamIndex) ) { // Pawn class constraint if ( Constraint == EFTRC_PawnClass && ConstraintPawnClass != None && C.PawnClass != ConstraintPawnClass ) return; // Force player to use a specific PlayerSpawnManager if ( PSM_OverrideTag != '' && PSM_OverrideTag != 'None' ) C.Event = PSM_OverrideTag; // Try to repossess OldPawn if possible if ( bTryToRepossess && EventInstigator.IsA('Vehicle') ) Vehicle(EventInstigator).KDriverLeave( true ); ASGameInfo(Level.Game).RespawnPlayer( C, false ); } } // Check if a Team is valid function bool ApprovePlayerTeam(byte Team) { if ( Level.Game.IsA('ASGameInfo') ) { if ( AssaultTeam == EPSM_Attackers ) { if ( ASGameInfo(Level.Game).IsAttackingTeam(Team) ) return true; } else if ( !ASGameInfo(Level.Game).IsAttackingTeam(Team) ) return true; } return false; } //============================================================================= // defaultproperties //============================================================================= defaultproperties { bTryToRepossess=Wahr bCollideActors=Falsch } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |