Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_respawned.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Sets the player up if he/she used the respawn option.
  8. */
  9. private ["_handle"];
  10. //Reset our weight and other stuff
  11.  
  12. life_action_inUse = false;
  13. life_use_atm = true;
  14. life_hunger = 100;
  15. life_thirst = 100;
  16. life_carryWeight = 0;
  17. CASH = 0; //Make sure we don't get our cash back.
  18. life_respawned = false;
  19. player playMove "AmovPercMstpSnonWnonDnon";
  20.  
  21. life_corpse setVariable ["Revive",nil,true];
  22. life_corpse setVariable ["name",nil,true];
  23. life_corpse setVariable ["Reviving",nil,true];
  24. player setVariable ["Revive",nil,true];
  25. player setVariable ["name",nil,true];
  26. player setVariable ["Reviving",nil,true];
  27.  
  28. //Load gear for a 'new life'
  29. switch (playerSide) do
  30. {
  31. case west: {
  32. _handle = [] spawn life_fnc_copLoadout;
  33. };
  34. case civilian: {
  35. _handle = [] spawn life_fnc_civLoadout;
  36. };
  37. case independent: {
  38. _handle = [] spawn life_fnc_medicLoadout;
  39. };
  40. waitUntil {scriptDone _handle};
  41. };
  42.  
  43. //Cleanup of weapon containers near the body & hide it.
  44. if (!isNull life_corpse) then {
  45. private "_containers";
  46. life_corpse setVariable ["Revive",true,true];
  47. _containers = nearestObjects[life_corpse,["WeaponHolderSimulated"],5];
  48. {deleteVehicle _x;} forEach _containers; //Delete the containers.
  49. deleteVehicle life_corpse;
  50. };
  51.  
  52. //Destroy our camera...
  53. life_deathCamera cameraEffect ["TERMINATE","BACK"];
  54. camDestroy life_deathCamera;
  55.  
  56. //Bad boy
  57. if (life_is_arrested) exitWith {
  58. hint localize "STR_Jail_Suicide";
  59. life_is_arrested = false;
  60. [player,true] spawn life_fnc_jail;
  61. [] call SOCK_fnc_updateRequest;
  62. };
  63.  
  64. //Johnny law got me but didn't let the EMS revive me, reward them half the bounty.
  65. if (!isNil "life_copRecieve") then {
  66.  
  67. if (life_HC_isActive) then {
  68. [getPlayerUID player,player,life_copRecieve,true] remoteExecCall ["HC_fnc_wantedBounty",HC_Life];
  69. } else {
  70. [getPlayerUID player,player,life_copRecieve,true] remoteExecCall ["life_fnc_wantedBounty",RSERV];
  71. };
  72.  
  73. life_copRecieve = nil;
  74. };
  75.  
  76. //So I guess a fellow gang member, cop or myself killed myself so get me off that Altis Most Wanted
  77. if (life_removeWanted) then {
  78.  
  79. if (life_HC_isActive) then {
  80. [getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
  81. } else {
  82. [getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
  83. };
  84.  
  85. };
  86.  
  87. [] call SOCK_fnc_updateRequest;
  88. [] call life_fnc_hudUpdate; //Request update of hud.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement