I'm trying to make a mission script for Deranged mod that removes the player inventory items at the first game map (player receives Pistol, Prod and medkit), but it doesn't seen to be working!
Here is the code:
- Code: Select all
class DerangedMissionScript expands MissionScript;
var DRHuman DRPlayer;
function FirstFrame()
{
DRPlayer = DRHuman(GetPlayerPawn());
Super.FirstFrame();
if (localURL == "54_Deranged_Training")
{
DRPlayer.DRKillInventory();
}
}
DRKillInventory function is at player class (DRHuman) and it is like this:
- Code: Select all
function DRKillInventory()
{
local inventory anItem;
//Original from ResetPlayerToDefaults() in DeusExPlayer class!
while(Inventory != None)
{
anItem = Inventory;
DeleteInventory(anItem);
anItem.Destroy();
if (DeusExRootWindow(rootWindow) != None)
DeusExRootWindow(rootWindow).hud.belt.ClearBelt();
GiveInitialInventory();
}
}
Any ideas?