Advertisement
jimbouk1977

fn_deploy.sqf

Mar 16th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.99 KB | None | 0 0
  1. span class="re5"> params[
  2.     ["_vehicleClass","",["",[]]],
  3.     ["_itemNeeded","",[""]],
  4.     ["_poptabs",0,[0]],
  5.     ["_respect",0,[0]],
  6.     ["_needBambi",false,[false]],
  7.     ["_canRepack",false,[false]],
  8.     ["_onlyOnce",false,[false]]
  9. ];
  10. if(_itemNeeded in assignedItems player || _itemNeeded in (magazines player) || _itemNeeded isEqualTo "")then {
  11.     _deployedVehicles = player getVariable ["deployedVehicles",[]];
  12.     if(_onlyOnce && (_vehicleClass in _deployedVehicles))exitWith{
  13.         ["ErrorTitleAndText", ["infiSTAR deploy", "You can only deploy once in a lifetime!"]] spawn ExileClient_gui_toaster_addTemplateToast;
  14.     };
  15.     if(!ExileClientPlayerIsBambi && _needBambi)exitWith{
  16.         ["ErrorTitleAndText", ["infiSTAR deploy", "Only a Bambi can use this!"]] spawn ExileClient_gui_toaster_addTemplateToast;
  17.     };
  18.     if(player getVariable ["ExileLocker", 0] < _poptabs)exitWith{
  19.         ["ErrorTitleAndText", ["infiSTAR deploy", format["You need at least %1 PopTabs in your Locker!",_poptabs]]] spawn ExileClient_gui_toaster_addTemplateToast;
  20.     };
  21.     if(ExileClientPlayerScore < _respect)exitWith{
  22.         ["ErrorTitleAndText", ["infiSTAR deploy", format["You need at least %1 Respect!",_respect]]] spawn ExileClient_gui_toaster_addTemplateToast;
  23.     };
  24.    
  25.     if(_needBambi)then{call ExileClient_object_player_bambiStateEnd;};
  26.     if!(_itemNeeded isEqualTo "")then{
  27.         player removeItem _itemNeeded;
  28.         player unassignItem _itemNeeded;
  29.     };
  30.     if(_onlyOnce)then{
  31.         _deployedVehicles pushBackUnique _vehicleClass;
  32.         player setVariable ["deployedVehicles",_deployedVehicles];
  33.     };
  34.    
  35.     [player,"deployRequest",[_vehicleClass,_poptabs,_respect,_canRepack,_itemNeeded]] remoteExecCall ["fn_xm8apps_server", 2, false];
  36. } else {
  37.     _displayName = getText(configFile >> "CfgWeapons" >> _itemNeeded >> "displayName");
  38.     if(_displayName isEqualTo "")then{_displayName = getText(configFile >> "CfgMagazines" >> _itemNeeded >> "displayName");};
  39.     ["ErrorTitleAndText", ["infiSTAR deploy", format["You need a %1 to deploy this object!",_displayName]]] spawn ExileClient_gui_toaster_addTemplateToast;
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement