Worst-case scenario: the UEd Goblin wipes the map and burns down your house.

User:OlympusMons/UTInfo Weapon

From Unreal Wiki, The Unreal Engine Documentation Site

Jump to: navigation, search

Code

UT3 Actor >> UTInfo >> UTInfo_Weapon (custom)

Contents

Package: 
MutatorFramework
No known subclasses.

Functions

GetWeapProps

reliable server function GetWeapProps (UTWeapon W)

GetWeapProps

reliable client function SetWeapProps (UTWeapon W)

PostBeginPlay

simulated event PostBeginPlay ()

SetPropsTimer

function SetPropsTimer ()

Source

//===================================================
//	Class: UTInfo_Weapon
//	Creation date: 13/12/2008 18:00
//	Last updated: 23/12/2008 00:28
//	Contributors: OlympusMons(/d!b\)
//---------------------------------------------------
//This class gets attached to the weapon and makes adjustments.
//===================================================
class UTInfo_Weapon extends UTInfo;
 
var array<class<UTWeapon> > cUseforWeaps;
 
/** Weapon class so we can check owner is right type and set vars */
var UTWeapon Weap;
 
/** Gets the times from the weapons and sets them to the replicated variables */
reliable server function GetWeapProps(UTWeapon W);
 
/** Sets the clients weapon to use the replicated variables */
reliable client function SetWeapProps(UTWeapon W);
 
/** Make sure we have an owner and its the right type before moving on */
simulated event PostBeginPlay(){
	local int i;
 
	if(Owner == None)		Destroy();
 
	Weap = UTWeapon(Owner);
	if(Weap != None)
	{
		for (i==0;i<cUseforWeapon.length;i++)
			if(W.IsA(cUseforWeaps()){
				if (WorldInfo.NetMode != NM_Client)
					GetWeapProps(Weap);
 
				SetTimer(0.01, false, 'SetPropsTimer');
			}else				Destroy();
	}else		Destroy();
}
 
function SetPropsTimer(){
	SetWeapProps(Weap);
}
 
defaultproperties
{
	RemoteRole=ROLE_SimulatedProxy
	bAlwaysRelevant=True
}
Personal tools