Advertisement
NyxGrimlock

player_wearClothes.sqf

Aug 11th, 2014
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. private ["_item","_onLadder","_hasclothesitem","_config","_text","_myModel","_itemNew","_currentSex","_newSex","_model","_playerNear"];
  2.  
  3. zupa_cid =player getVariable ["CharacterID","0"];
  4. _bankMoney = player getVariable ["bankMoney", 0];
  5. _cashMoney = player getVariable ["cashMoney", 0];
  6.  
  7. if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_83") , "PLAIN DOWN"] };
  8. DZE_ActionInProgress = true;
  9.  
  10. _item = _this;
  11. call gear_ui_init;
  12.  
  13. _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
  14. if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
  15.  
  16. _hasclothesitem = _this in magazines player;
  17. _config = configFile >> "CfgMagazines";
  18. _text = getText (_config >> _item >> "displayName");
  19.  
  20. if (!_hasclothesitem) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
  21.  
  22. if (vehicle player != player) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_85"), "PLAIN DOWN"]};
  23.  
  24. //if (!isNull (unitBackpack player)) exitWith { DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_9"), "PLAIN DOWN"] };
  25.  
  26. if ("CSGAS" in (magazines player)) exitWith { DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_10"), "PLAIN DOWN"] };
  27.  
  28. _myModel = (typeOf player);
  29. _itemNew = "Skin_" + _myModel;
  30.  
  31. //diag_log ("Debug Clothes: model In: " + str(_itemNew) + " Out: " + str(_item));
  32.  
  33. if ( (isClass(_config >> _itemNew)) ) then {
  34. if ( (isClass(_config >> _item)) ) then {
  35. // Current sex of player skin
  36.  
  37. _currentSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _itemNew >> "sex");
  38. // Sex of new skin
  39. _newSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "sex");
  40. //diag_log ("Debug Clothes: sex In: " + str(_currentSex) + " Out: " + str(_newSex));
  41.  
  42. if(_currentSex == _newSex) then {
  43. // Get model name from config
  44. _model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
  45. if (_model != _myModel) then {
  46. if(([player,_item] call BIS_fnc_invRemove) == 1) then {
  47. player addMagazine _itemNew;
  48. player setVariable["cashMoney",_cashMoney,true];
  49. player setVariable["bankMoney",_bankMoney,true];
  50. player setVariable["CharacterID",zupa_cid,true];
  51. [dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
  52. player setVariable["cashMoney",_cashMoney,true];
  53. player setVariable["bankMoney",_bankMoney,true];
  54. player setVariable["CharacterID",zupa_cid,true];
  55. };
  56. };
  57. player setVariable["cashMoney",_cashMoney,true];
  58. player setVariable["bankMoney",_bankMoney,true];
  59. player setVariable["CharacterID",zupa_cid,true];
  60.  
  61. } else {
  62. cutText [(localize "str_epoch_player_86"), "PLAIN DOWN"];
  63. };
  64. player setVariable["cashMoney",_cashMoney,true];
  65. player setVariable["bankMoney",_bankMoney,true];
  66. player setVariable["CharacterID",zupa_cid,true];
  67. };
  68. player setVariable["cashMoney",_cashMoney,true];
  69. player setVariable["bankMoney",_bankMoney,true];
  70. player setVariable["CharacterID",zupa_cid,true];
  71. };
  72. player setVariable["cashMoney",_cashMoney,true];
  73. player setVariable["bankMoney",_bankMoney,true];
  74. player setVariable["CharacterID",zupa_cid,true];
  75. DZE_ActionInProgress = false;
  76. player setVariable["cashMoney",_cashMoney,true];
  77. player setVariable["bankMoney",_bankMoney,true];
  78. player setVariable["CharacterID",zupa_cid,true];
  79. sleep 2;
  80. player setVariable["CharacterID",zupa_cid,true];
  81. player setVariable["bankMoney",_bankMoney,true];
  82. player setVariable["cashMoney",_cashMoney,true];
  83. sleep 2;
  84. player setVariable["CharacterID",zupa_cid,true];
  85. player setVariable["bankMoney",_bankMoney,true];
  86. player setVariable["cashMoney",_cashMoney,true];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement