I wondered a while ago about how to properly create loadouts based on humanity. The problem is that in the server code server_playerLogin saves the inventory/backpack but doesn't have access to humanity. Server_playersetup has humanity, but no access to inventory/backpack.
My workarouns was to base loadout on skin, which is not perfect, but took people a while to notice. lol.
Anyway, I got some inspiration from the HeroPerks code here: http://epochmod.com/forum/index.php?/topic/11874-release-hero-perks-epoch-pre-configured/
It spawns a box and/or vehicle for heroes.
I'm having a had time with the vehicle spawns - I drive away and eventually - boom - and I'm dead. The original code looked incomplete, so I lifted some from DZMS, but still having the same issue - boom. Did I miss something obvious?
Also, here's a secondary thought - could I attach a handler to the vehicle so that only the player that it spawned with could be the driver? This would prevent "hero-vehicle-death-spamming" I'm thinking the axebus code that ejects you from the seat, assuming I can attach an arbitrary variable to the vehicle to compare player name or ID or something. On my list to check out.
My workarouns was to base loadout on skin, which is not perfect, but took people a while to notice. lol.
Anyway, I got some inspiration from the HeroPerks code here: http://epochmod.com/forum/index.php?/topic/11874-release-hero-perks-epoch-pre-configured/
It spawns a box and/or vehicle for heroes.
I'm having a had time with the vehicle spawns - I drive away and eventually - boom - and I'm dead. The original code looked incomplete, so I lifted some from DZMS, but still having the same issue - boom. Did I miss something obvious?
Also, here's a secondary thought - could I attach a handler to the vehicle so that only the player that it spawned with could be the driver? This would prevent "hero-vehicle-death-spamming" I'm thinking the axebus code that ejects you from the seat, assuming I can attach an arbitrary variable to the vehicle to compare player name or ID or something. On my list to check out.
Code:
_vehClass = _vehList call BIS_fnc_selectRandom;
_vehicle = createVehicle [_vehClass,[(_coords select 0) - 4, (_coords select 1) + 4,0],[], 0, "CAN_COLLIDE"];
_objectID = str(round(random 999999));
_vehicle setVariable ["ObjectID", _objectID, true];
_vehicle setVariable ["ObjectUID", _objectID, true];
_ranFuel = random 1;
if (_ranFuel < .25) then {_ranFuel = .25;};
_vehicle setFuel _ranFuel;
_vehicle setvelocity [0,0,1];
_vehicle setDir (round(random 360));
//_vehicle setVariable ["Mission",1,true];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
_vehicle setVehicleLock "UNLOCKED";