Forum Jump :

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 61
In-game name: Kobayashi Maru

 
#184432 Posted at 2015-12-10 05:42        
     
I didn't test thiat but what I'll try:

First, identify specific lootboxes for each player :

a variable at each player's initialization ( initPlayerLocal.sqf is fine):
 plyr_loot = 0;

then in your script:
_Object = createVehicle ["LootBox", (player modelToWorld [0,1,0]),[], 0, "CAN_COLLIDE"];
player setVariable ["loot_"+ name player + str(plyr_loot), _object];
plyr_loot = plyr_loot + 1;
...

then further:
["someId", "onPlayerDisconnected", {
       for "_i" from 0 to plyr_loot do {
	 deleteVehicle  (player getvariable "loot_" + name player + str(_i) );
      };
}] call BIS_fnc_addStackedEventHandler;

Something like that. I'm not sure it's the best code ever written about your aim.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS