Hi, again XD, I was trying to add a inventory to a player, but I'm heaving some troubles switching from ut2k4 to ue3 =/
Here is the inventory code:
And I'm getting a error saying that there is no Pickup class...so I was wandering what is the actual header of the GiveTo function of a inventory.
I tried to search in Unreal Wiki, but could only find the ones from ut,ut2kx
Here is the inventory code:
Code:
class DelayedDmgInv extends Inventory;
var Controller InstigatorController;
var Pawn PawnOwner;
var int Modifier;
replication
{
reliable if (bNetInitial && Role == ROLE_Authority)
PawnOwner;
}
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
if (Instigator != None)
InstigatorController = Instigator.Controller;
SetTimer(1, true);
}
function GiveTo(Pawn Other, optional Pickup Pickup)
{
local Pawn OldInstigator;
if (InstigatorController == None)
InstigatorController = Other.DelayedDamageInstigatorController;
OldInstigator = Instigator;
Super.GiveTo(Other);
PawnOwner = Other;
Instigator = OldInstigator;
}
simulated function Timer()
{
if (Role == ROLE_Authority)
{
if (Owner == None)
{
Destroy();
return;
}
if (Instigator == None && InstigatorController != None)
Instigator = InstigatorController.Pawn;
PawnOwner.DelayedDamageInstigatorController = InstigatorController;
PawnOwner.TakeDamage(Modifier * 2, Instigator, PawnOwner.Location, vect(0,0,0), class'DamTypeXGun');
}
}
defaultproperties
{
bOnlyRelevantToOwner=false
}
I tried to search in Unreal Wiki, but could only find the ones from ut,ut2kx