Give Weapon By ID Mutator. Mutator for issuing weapons by ID Give Weapon By ID Mutator. Mutator for issuing weapons by ID Again - that mutator that is often kicked about I don’t like all these VIP bonuses, so let’s assume that the mutator is used for good purposes, for example,...
#1
Posted:
Give Weapon By ID Mutator. Mutator for issuing weapons by ID
Again - that mutator that is often kicked about I don’t like all these VIP bonuses, so let’s assume that the mutator is used for good purposes, for example, to please the birthday boy with a cool gun
I’ll describe a fairly simple, but quite functional option.
Settings:
An array of structures in the style is driven into the inishnik
VipList=(PlayerID="76561198051378",PlayerName="Flame",SpecialWeapon="KFMod.Katana")
Here PlayerID is the player’s ID, SpecialWeapon is the weapon that is given to him when he appears in the game and after being revived, and PlayerName is used purely for convenience. So that they don’t forget who it is with that ID and with that gun. You can add as many array elements with different IDs and guns as you like (within memory limits). At least give all players a personal gun)
You can assign several guns to one player - just write
VipList=(PlayerID="76561198051378",PlayerName="Flame",SpecialWeapon="KFMod.Katana")
VipList=(PlayerID="76561198051378",PlayerName="Flame",SpecialWeapon="KFMod.Axe")
Mutator code:
class GiveWeaponByIDMut extends Mutator config(GiveWeaponByIDMut);
struct VipStruct
{
var config string PlayerID;
var config string PlayerName;
var config string SpecialWeapon;
};
var config array<VipStruct> VipList;
function PostBeginPlay()
{
SaveConfig();
}
function ModifyPlayer(Pawn P)
{
Super.ModifyPlayer(P);
TryGiveSpecialWeapon(P);
}
function TryGiveSpecialWeapon(Pawn P)
{
local PlayerController PC;
local string Hash;
local int i;
if (P == None)
return;
PC = PlayerController(P.Controller);
if (PC == None)
return;
Hash = PC.GetPlayerIDHash();
for (i = 0; i < VipList.Length; i++)
{
if (VipList[i].PlayerID ~= Hash)
P.GiveWeapon(VipList[i].SpecialWeapon);
}
}
defaultproperties
{
VipList(0)=(PlayerID="76561198051378",PlayerName="Flame",SpecialWeapon="KFMod.Katana")
bAddToServerPackages=True
GroupName="KF-GiveWeaponByIDMut"
FriendlyName="GiveWeaponByIDMut"
Description="Give Weapon By ID"
}
Use it like:
GiveWeaponByIDMut.GiveWeaponByIDMut
Compiled version: https://yadi.sk/d/WmlI6VnMhi8c5
Author: Flame