Crypto to Ground

This commit is contained in:
He-Man 2019-03-23 21:51:23 +01:00
parent 84d071f1fd
commit ff7367a79d
8 changed files with 146 additions and 8 deletions

View File

@ -1 +1 @@
5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_(checkplayer|save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player) \[.+\]" !="epoch_server_((upgrade|updateplayer|inviteplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(upgrade_vehicle|knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" !="epoch_server_(setfinalplayerpos|defusebomb) \[.+\]"
5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_(checkplayer|save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player) \[.+\]" !="epoch_server_((upgrade|updateplayer|inviteplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(upgrade_vehicle|knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]" !="epoch_server_(setfinalplayerpos|defusebomb|putcrypto) \[.+\]"

View File

@ -29,7 +29,7 @@
5 setMarker !="CBA_fnc_setMarkerPersistent\"" !="\\fnc_setMarkerPersistent" !="\"setMarkerPersistent" !="_mName setMarkerShapeLocal _mShape;" !="_mName setMarkerTypeLocal _mType;" !="(_x select 0) setMarkerPosLocal (position player);" !="_zoomMarker setMarkerSizeLocal"
5 createMarker !="CBA_fnc_createMarker\"" !="\\fnc_createMarker" !="\"createMarker" !="cba_fCreateMarker" !="createMarkerLocal [_mName, _mPos];"
5 assignItem !="axeVIP assignItem _item;" !="unassignItem"
5 ctrlSetEventHandler !="ctrlSetEventHandler [\"mouseButtonDown\", _action];" !="_ctrlButtonOK ctrlseteventhandler [\"buttonclick\"," !="ctrlSetEventHandler ['LBDblClick', '_this call" !="_buttonRespawn ctrlseteventhandler [\"buttonclick\",\"with uinamespace do {['buttonRespawn'," !="_ctrl ctrlSetEventHandler [\"mouseEnter\"" !="_ctrlBtn ctrlSetEventHandler [\"MouseButtonDblClick\", _verAct];" !="_button_gen ctrlSetEventHandler [\"ButtonClick\",_btn_code + \"(uiNamespace getVariable [\"" !="t \"#(rgb,8,8,3)color(1,1,1,0.1)\";\n_c ctrlCommit 0;\n_c ctrlSetEventHandler [\"MouseButtonUp\",format[\"['remove',%1,(_this select 1)"
5 ctrlSetEventHandler !="ctrlSetEventHandler [\"mouseButtonDown\", _action];" !="_ctrlButtonOK ctrlseteventhandler [\"buttonclick\"," !="ctrlSetEventHandler ['LBDblClick', '_this call" !="_buttonRespawn ctrlseteventhandler [\"buttonclick\",\"with uinamespace do {['buttonRespawn'," !="_ctrl ctrlSetEventHandler [\"mouseEnter\"" !="_ctrlBtn ctrlSetEventHandler [\"MouseButtonDblClick\", _verAct];" !="_button_gen ctrlSetEventHandler [\"ButtonClick\",_btn_code + \"(uiNamespace getVariable [\"" !="t \"#(rgb,8,8,3)color(1,1,1,0.1)\";\n_c ctrlCommit 0;\n_c ctrlSetEventHandler [\"MouseButtonUp\",format[\"['remove',%1,(_this select 1)" !="ctrlSetEventHandler [\"ButtonClick\",\"_slider = ((finddisplay 602) displayCtrl 654001);"
5 addEventHandler !"displayAddEventHandler" !"ctrlAddEventHandler" !="player addeventhandler [\"PostReset\",{BIS_EnginePPReset = true;} ];" !="player addEventHandler [_x,([\"CfgEpochClient\", _x, \"\"] call EPOCH_fnc_returnConfigEntryV2)];" !="\"CBA_fnc_addEventHandler\"" !="\\fnc_addEventHandler" !="\"addEventHandler" !="_eventFunc = _eventFunc + \"(_this select 0) addEventHandler ['Respawn', \" + str _eventFunc + \"];\";" !="_unit addEventHandler [\"hitpart\"," !="CBA_fnc_addEventHandler" !="_unit addEventHandler [_x, format ['call cba_xeh_fnc_%1', _x]];" !="_ship addEventHandler [\"AttributesChanged3DEN\"" !="addEventHandler [\"HandleDamage\",bis_fnc_reviveOnPlayerHandleDamage];" !="_unit addEventHandler [\"FiredNear\"" !="_smokeEH = _plyr addEventHandler [\"FiredNear\", \"airDropHandle setFSMVariable" !="_onContactEH = _currentTarget addEventHandler[\"EpeContactStart"" !="_object addeventhandler [\"local\",{[[_this select 0],\"bis_fnc_objectVar\""
5 displayAddEventHandler !="(findDisplay 46) displayAddEventHandler [\"KeyDown\",\"true\"];" !="displayAddEventHandler [_x,([\"CfgEpochClient\", _x, \"\"] call EPOCH_fnc_returnConfigEntryV2)];" !="displayaddeventhandler [\"mousemoving\"," !="_display displayaddeventhandler [\"unload\",\"uinamespace setvariable ['BIS_fnc_guiMess" !="findDisplay -1337 displayAddEventHandler ['Unload'" !="_display displayaddeventhandler [\"keydown\",\"with uinamespace do {['keyDown'" !="_display displayaddeventhandler [_x,_fnc_animate];" !="Development\") then\n{\n_display displayaddeventhandler [\n\"keydown\"" !="CBA_fnc_addDisplayHandler" !="_display displayAddEventHandler [\"MouseMoving" !="private _handler = _display displayAddEventHandler [_key, _code];" !="_display displayAddEventHandler [\"KeyDown\", \"_this call cba_keybinding_fnc_onKeyDown\"" !="isplay 602};\n\n_display = (findDisplay 602);\n_display displayAddEventHandler [\"MouseButtonUp\",\"[] spawn {rmx_var_fav_selected = f" !="displayaddeventhandler\n[\n\"mousemoving\"" !="_ctrlBohemia ctrlcommit 0;\n\n\n_display displayaddeventhandler"
5 ctrlAddEventHandler !="_control = _display displayctrl 37305; \n_control ctrladdeventhandler" !="_ctrlMap = _display displayctrl 101;\n_ctrlMap ctrladdeventhandler" !="_display displayctrl 21995;\n_assetsButton ctrladdeventhandler [\"buttonclick\"," !="_display displayctrl 2406; \n_control ctrladdeventhandler [\"buttonclick\"," !="_display displayctrl 2400;\n_control ctrladdeventhandler [\"buttonclick\"," !="ctrladdeventhandler [\"lbselchanged\"," !="ctrladdeventhandler [\n\"lbselchanged\"," !="_ButtonGeneral ctrladdeventhandler [\"buttonclick\"," !="_ctrlExecuteLocal ctrladdeventhandler [\"buttonclick\"," !="_bg ctrlAddEventHandler [\"MouseEnter\"," !="_container ctrlAddEventHandler [\"LBDblClick\",\"_this call EPOCH_itemInteractClick\"];" !="(uiNamespace getVariable 'ESP_map') ctrlAddEventHandler['Draw', '_esp_targets = EPOCH_ESPMAP_TARGETS;" !="ctrlAddEventHandler ['MouseButtonDown'" !="_ctrl ctrlSetEventHandler [\"mouseEnter\", (format [\"_c = _this select 0;" !="_ctrl ctrlSetEventHandler [\"mouseExit\", (format [\"_c = _this select 0;" !="_ctrl ctrlSetEventHandler [\"mouseButtonDown\", (format [\"call %1;\",(_buttonSettings select _e select 2)])];" !="_prevButton ctrlAddEventHandler [\"MouseButtonUp\", {_this call cba_diagnostic_fnc_debug" !="BIS_RscRespawnControlsMap_ctrlHeaderRespawnButton ctrlAddEventhandler [\"ButtonDown\"" !="_control = _display displayctrl 105;\n_control ctrladdeventhandler [\"MouseButtonUp\"" !="ctrlHeaderRespawnButton\", controlNull]) ctrlAddEventhandler [\"ButtonDown\"" !="_selected = false;\n{\n_c = _display displayCtrl _x;\n_c ctrlAddEventHandler [\"LBDrag\",\"rmx_var_favBar_Item = (_this call epoch_fav" !="_ctrlMouseArea ctrladdeventhandler [\"setfocus\",{with uinamespace do {[\"dlcClear\",[ctrlpar" !="13484 ctrlAddEventHandler [\"ButtonClick\", {[\"executeButton\"," !="_ctrlButtonPurchase ctrladdeventhandler"

View File

@ -52,14 +52,17 @@ else {
_savecontainer = _sec;
};
};
if (!isnull _savecontainer && !_blocked) then {
if (!_blocked) then {
_savecontainer spawn {
waituntil {!isnull (findDisplay 602)};
while {!isnull (findDisplay 602)} do {
_stored = [itemcargo _this, magazinecargo _this, backpackcargo _this];
waituntil {uisleep 0.5; !(_stored isequalto [itemcargo _this, magazinecargo _this, backpackcargo _this]) || isnull (findDisplay 602)};
if !(_stored isequalto [itemcargo _this, magazinecargo _this, backpackcargo _this]) then {
_this call EPOCH_interact;
call EPOCH_CryptoButtons;
if (!isnull _this) then {
while {!isnull (findDisplay 602)} do {
_stored = [itemcargo _this, magazinecargo _this, backpackcargo _this];
waituntil {uisleep 0.5; !(_stored isequalto [itemcargo _this, magazinecargo _this, backpackcargo _this]) || isnull (findDisplay 602)};
if !(_stored isequalto [itemcargo _this, magazinecargo _this, backpackcargo _this]) then {
_this call EPOCH_interact;
};
};
};
};

View File

@ -0,0 +1,82 @@
/*
Author: He-Man - EpochMod.com
Contributors:
Description: Adds a Slider into the inventory to put Crypto on the Ground
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/inventory/EPOCH_CryptoButtons.sqf
Usage:
on opened Inventory: call EPOCH_CryptoButtons
RETURNS: NOTHING
*/
private ["_display","_ctrl_ground","_ContainerBG","_PlayerBg","_ContainerBgPos","_ctrl_groundPos","_PlayerBgPos","_KryptoButton","_border","_slider1","_KryptoText"];
_display = finddisplay 602;
_ctrl_ground = _display displayCtrl 6321;
_ContainerBG = _display displayCtrl 1001;
_PlayerBg = _display displayCtrl 1002;
_ContainerBgPos = ctrlPosition _ContainerBG;
_ctrl_groundPos = ctrlPosition _ctrl_ground;
_PlayerBgPos = ctrlPosition _PlayerBG;
_KryptoButton = _display ctrlCreate['RSCButton', -1];
_KryptoButton ctrlSetPosition [
(_PlayerBgPos select 0)+(_PlayerBgPos select 2) + (_ctrl_groundPos select 3)/2,
(_ContainerBgPos select 1) + (_ctrl_groundPos select 3)*1.5 + (_ctrl_groundPos select 3)/2*0,
(_ContainerBgPos select 2)/2,
(_ctrl_groundPos select 3)*1.5
];
_KryptoButton ctrlCommit 0;
_KryptoButton ctrlSetText 'Crypto to Ground';
_KryptoButton ctrlsettextcolor [1,1,0,1];
_KryptoButton ctrlEnable true;
_KryptoButton ctrlSetEventHandler ["ButtonClick","_slider = ((finddisplay 602) displayCtrl 654001);_sliderPos = sliderPosition _slider;_value = round (epoch_playercrypto * (_sliderPos/10)); if (_value > 0 && _value <= Epoch_PlayerCrypto) then {finddisplay 602 closedisplay 0; [player,_value,Epoch_personalToken] remoteexec ['EPOCH_server_PutCrypto',2]};"];
_border = _display ctrlCreate['RscFrame', -1];
_border ctrlSetPosition [
(_PlayerBgPos select 0)+(_PlayerBgPos select 2) + (_ctrl_groundPos select 3)/2,
(_ContainerBgPos select 1) + (_ctrl_groundPos select 3)*1.5 + (_ctrl_groundPos select 3)/2*0,
(_ContainerBgPos select 2)/2,
(_ctrl_groundPos select 3)*1.5
];
_border ctrlCommit 0;
_slider1 = _display ctrlCreate['RscXSliderH', 654001];
_slider1 ctrlSetPosition [
(_PlayerBgPos select 0)+(_PlayerBgPos select 2) + (_ctrl_groundPos select 3)/2,
(_ContainerBgPos select 1) + (_ctrl_groundPos select 3)*1.5*2,
(_ContainerBgPos select 2)/2,
(_ctrl_groundPos select 3)*0.75
];
_slider1 ctrlCommit 0;
_KryptoText = _display ctrlCreate['RSCText', 654002];
_KryptoText ctrlSetPosition [
(_PlayerBgPos select 0)+(_PlayerBgPos select 2) + (_ctrl_groundPos select 3)/2,
(_ContainerBgPos select 1) + (_ctrl_groundPos select 3)*1.5*2 + (_ctrl_groundPos select 3)*0.75,
(_ContainerBgPos select 2)/2,
(_ctrl_groundPos select 3)*0.75
];
_KryptoText ctrlSetBackgroundColor [0,0,0,1];
[] spawn {
disableSerialization;
_display = finddisplay 602;
_slider1 = (_display displayCtrl 654001);
_KryptoText = (_display displayCtrl 654002);
_slider1 sliderSetPosition 0;
while {!isNull _display} do {
_sliderPos = sliderPosition _slider1;
_value = round (epoch_playercrypto * (_sliderPos/10));
_KryptoText ctrlSetText format['Put %1 Crypto',_value];
_KryptoText ctrlCommit 0;
uiSleep 0.1;
};
};

View File

@ -215,6 +215,7 @@ class CfgClientFunctions
class equip {};
class itemTypeSlot {};
class usedItemRepack {};
class CryptoButtons {};
};
class servicepoint
{

View File

@ -26,6 +26,11 @@ class CfgRemoteExec
{
mode = 1;
jip = 0;
class EPOCH_server_PutCrypto
{
allowedTargets=2;
jip = 0;
};
class EPOCH_server_SetFinalPlayerPos
{
allowedTargets=2;

View File

@ -0,0 +1,46 @@
/*
Author: He-Man - EpochMod.com
Contributors:
Description: Puts Crypto Items on the Ground
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server\compile\epoch_server\EPOCH_server_PutCrypto.sqf
Usage:
[player,_value,Epoch_personalToken] remoteexec ['EPOCH_server_PutCrypto',2]
RETURNS: NOTHING
*/
private ["_cIndex","_vars","_current_crypto","_pos","_dist","_direction","_randomPos","_itemclass","_var","_item"];
params ["_player","_Putcrypto",["_token","",[""]]];
diag_log format ["PutCrypto Server Side - %1",_this];
if !([_player, _token] call EPOCH_server_getPToken) exitWith{};
_cIndex = EPOCH_customVars find 'Crypto';
_vars = _player getVariable['VARS', call EPOCH_defaultVars_SEPXVar];
_current_crypto = _vars select _cIndex;
if (_current_crypto < _Putcrypto) exitwith {
["Not enough money",5] remoteexec ["Epoch_Message",_player];
};
_current_crypto = _current_crypto - _Putcrypto;
_vars set[_cIndex, _current_crypto];
_player setVariable['VARS', _vars];
_current_crypto remoteExec ['EPOCH_effectCrypto',_player];
[format ["You put %1 Crypto on the Ground",_Putcrypto],5] remoteexec ["Epoch_Message",_player];
[_player,_vars,_token] call EPOCH_fnc_savePlayer;
_pos = getposatl _player;
while {_Putcrypto > 0} do {
_itemclass = if (_Putcrypto >= 1000) then {"Land_Suitcase_F"} else {"Land_Money_F"};
_var = if (_Putcrypto >= 1000) then {1000} else {_Putcrypto min 100};
_Putcrypto = _Putcrypto - _var;
_item = createVehicle [_itemclass,_pos,[],1,"CAN_COLLIDE"];
_item setvariable ["RemoveOnTake",true];
_item allowdamage false;
_item enablesimulationglobal false;
_item setvariable ["Crypto",_var,true];
};

View File

@ -129,6 +129,7 @@ class CfgServerFunctions
class server_deleteGlobalMarkerSet {};
class server_isNearChecks {};
class server_DefuseBomb {};
class server_PutCrypto {};
};
class epoch_missions {
class Server_createObject {};