• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

KF Weapon code change

oldschool

Active member
May 1, 2015
375
37
28
NYC
osghc.com
I was using this before update 1043...I'm trying to figure out what changes were made to KFGame.KFWeapon.uc that is causing it not to work in game?

Code:
class cmdRestoreAmmo extends cmdBase;

static function doCmd(PlayerController Sender, array<string> CmdList)
{
    local array<PlayerController> PC;
    local KFWeapon KFW;
    local int i;
    

    PC = FindPlayers(Sender,CmdList[0],true);

    if (PC[0] == none)
    {
        Sender.ReceiveLocalizedMessage(class'AdminMessages',201); //Player not found msg
        return;
    }

    for (i = 0; i < PC.Length; i++)
    {
           ForEach PC[i].Pawn.InvManager.InventoryActors(class'KFWeapon', KFW)
       {
               KFW.AmmoCount[0] = KFW.MagazineCapacity[0];
            KFW.AddAmmo(KFW.MaxSpareAmmo[0]);
            KFW.AddSecondaryAmmo(KFW.MagazineCapacity[1]);
           }

        if( KFInventoryManager(PC[i].Pawn.InvManager) != none )
            KFInventoryManager(PC[i].Pawn.InvManager).GrenadeCount = KFPawn(PC[i].Pawn).GetPerk().MaxGrenadeCount;
        
        PC[i].ClientMessage("**AMMO HAS BEEN RESTORED**");
    }

}

defaultproperties
{
    cmdName="RestoreAmmo"
    cmdHelp="RestoreAmmo <player> - Restores ammo to <player>"
}