aeroson

Untitled

Sep 9th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. // add to init.sqf
  2. // keep player gear on respawn
  3.  
  4. [] spawn {
  5.  
  6. waitUntil {
  7. !isNil{player} &&
  8. {player == player}
  9. };
  10.  
  11. lastPlayerLoadout = [];
  12. player addEventHandler ["respawn", {
  13. private _loadout = lastPlayerLoadout;
  14. if(count _loadout > 0) then {
  15. _loadout spawn {
  16. waitUntil {
  17. !isNull findDisplay 46 &&
  18. !isNull player &&
  19. player == player &&
  20. alive player
  21. };
  22. sleep 1;
  23. player setUnitLoadout[_this, true];
  24. };
  25. };
  26. }];
  27.  
  28. while{true} do {
  29. sleep 10;
  30. if(!isNil{player} && {player == player} && {alive player}) then {
  31. lastPlayerLoadout = getUnitLoadout player;
  32. };
  33. };
  34.  
  35. };
Advertisement
Add Comment
Please, Sign In to add comment