I have a script that gives different default loadout based on whether you are a regular player or an admin. Or so it should... I had it working fine on a Nitrado server a few days back, but now when I try to implement it on a Vilayer server, it doesn't seem to work properly. It looks like this:
_playerUID = getPlayerUID player; _admins = ["<MY_PLAYER_ID>","<MY_PLAYER_ID>"]; switch(true)do { case (_playerUID in _admins): // Admins startgear { DefaultMagazines = ["Skin_Rocket_DZ","ItemSodaCoke","FoodSteakCooked","ItemAntibiotic","ItemMorphine","ItemPainkiller","20Rnd_556x45_Stanag","20Rnd_556x45_Stanag","20Rnd_556x45_Stanag","ItemBandage","ItemBandage","ItemBandage","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17"]; DefaultWeapons = ["M4A1_HWS_GL","glock17_EP1","NVGoggles","Binocular","ItemCompass","ItemGPS","ItemToolbox","ItemCompass","ItemFlashlightRed","ItemEtool","ItemCrowbar","ItemKeyKit","ItemKnife","ItemMatchbox_DZE"]; DefaultBackpack = "DZ_LargeGunBag_EP1"; DefaultBackpackItems = ["DMR_DZ","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR"]; }; default // Standard startgear { DefaultMagazines = ["ItemSodaCoke","ItemPainkiller","FoodCanBakedBeans","8Rnd_9x18_Makarov","ItemBandage","ItemBandage"]; DefaultWeapons = ["Makarov","ItemMap","ItemToolbox"]; DefaultBackpack = "DZ_Patrol_Pack_EP1"; DefaultBackpackItems = [""]; }; };
It seems to work for non-admins, because even though I am admin, I spawn with the items regular players should have. I also get the error "No entry 'bin\config.bin/CfgMagazines.'." whenever I spawn, and prior to that, I get the male/female selector every time. That's not right, is it? Like I said, it was working on Nitrado, but maybe I need to pay attention to something on Vilayer? And what does that CfgMagazine-thing mean? Am I trying to spawn something "wrong" to admins, and thus reverting to the regular loadout?
Also, I am aware that <MY_PLAYER_ID> is stated twice, and that's deliberate. According to the forum I found this, you need to specify at least 2 admins for it to work, and I have tried both 00000000000000000 and my player ID repeated, but the outcome is the same.
Can anyone spot the error, or recommend a better script than this?
Thank you ;)