Информация о файле
В инишник забивается массив структур в стиле
VipList=(PlayerID="76561198051378",PlayerName="Sgt.McNeal",SpecialWeapon="KFMod.Katana")
Здесь PlayerID - ID игрока, SpecialWeapon - оружие, которое ему выдаётся при появлении в игре и после оживления, а PlayerName используется чисто для удобства. Чтобы не забывали кто же это под таким ID и с такой пушкой.
Можно добавлять сколько угодно (в пределах памяти) элементов массива с разными ID и пушками. Хоть всем игрокам по персональной пушке пропишите.
Можно прописать одному игроку несколько пушек - просто напишите
VipList=(PlayerID="76561198051378",PlayerName="Sgt.McNeal",SpecialWeapon="KFMod.Katana")
VipList=(PlayerID="76561198051378",PlayerName="Sgt.McNeal",SpecialWeapon="KFMod.Axe")
Код
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="Sgt.McNeal",SpecialWeapon="KFMod.Katana")
bAddToServerPackages=True
GroupName="KF-GiveWeaponByIDMut"
FriendlyName="GiveWeaponByIDMut"
Description="Give Weapon By ID"
Прописать как :
GiveWeaponByIDMut.GiveWeaponByIDMut