Jump to content

ToxicRageTv

Moderators
  • Content Count

    547
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by ToxicRageTv

  1. ToxicRageTv

    Anti-Theft Script

    you need to put the eventHandler inside the class of the object. ex. class Toxic_TestObject: House_F { displayName="Test Object"; model="\Toxic_Test\Testing.p3d"; scope=2; scopecurator=2; class EventHandlers { init="[] execVM '\Mod_Name\script\iLikePears.sqf'"; }; };
  2. Im a little lost as to what you want here. Are you wanting it so that when you are in a mine area you will gather BOTH metals at the same time? Or have a random chance of getting one or the other?
  3. ToxicRageTv

    Database - Display?

    The playtime is selected from the database when the player logs into the server. You can go take a look at the fn_queryRequest.sqf in Life_Server\Functions\MySQL if you want to see how its done there.
  4. ToxicRageTv

    Anti-Theft Script

    You can add an eventHandler in the config.cpp for an init and then you can put it inside a file. class EventHandlers { init="[] execVM '\Mod_Name\script\iLikePears.sqf'"; };
  5. ToxicRageTv

    Spot the coding mistake

    Lol is this from the UE4 course on udemy
  6. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Step 1: Go to "Altis_Life.Altis\Core" and CREATE a FOLDER called "Toxic" Step 2: In that newly created folder, CREATE a FILE called "fn_busMenu.sqf" #include "..\..\script_macros.hpp" /* Author: ToxicRageTv File: fn_busMenu.sqf Description: Sets up the bus menu */ if (!alive player || dialog) exitWith {}; createDialog "Toxic_Bus_Menu"; disableSerialization; private _display = uiNamespace getVariable "Toxic_Bus_Menu"; ctrlShow [1919,false]; private _busList = _display displayCtrl 1500; private _side = switch (playerSide) do { case west: {"Cop"}; case independent: {"Medic"}; default {"Civilian"}; }; private _busStops = getArray(missionConfigFile >> "Toxic_Bus_Config" >> _side >> "stops"); { _busList = lbAdd [ 1500, ( _x select 0 ) ]; lbSetData [ 1500, _busList, ( _x select 1 ) ]; } forEach _busStops; Step 3: In that same folder CREATE a FILE called "fn_busStart.sqf" #include "..\..\script_macros.hpp" /* Author: ToxicRageTv File: fn_busStart.sqf */ private ["_busDepotName"]; if ((lbCurSel 1500) isEqualTo -1) exitWith {hint "No destination selected";}; private _error = false; busTo = lbData [ 1500, ( lbCurSel 1500 ) ]; busToMarker = getMarkerPos busTo; disableSerialization; closeDialog 0; private _side = switch (playerSide) do { case west: {"Cop"}; case independent: {"Medic"}; default {"Civilian"}; }; private _dis = round(busToMarker distance (getPos player)); private _multiplyer = getNumber(missionConfigFile >> "Toxic_Bus_Config" >> _side >> "multipler"); private _tripTotal = round(_multiplyer * _dis); private _busStops = getArray(missionConfigFile >> "Toxic_Bus_Config" >> _side >> "stops"); private _payment = getText(missionConfigFile >> "Toxic_Bus_Config" >> "payment"); private _type = getNumber(missionConfigFile >> "Toxic_Bus_Config" >> "bus_3d"); { if (busTo isEqualTo (_x select 1)) then { _busDepotName = _x select 0; }; } forEach _busStops; _result = [ format ["Are You Sure You Want To Travel To %1? It Will Cost You $%2", _busDepotName, _tripTotal], "Bus", "Yes", "No"] call BIS_fnc_guiMessage; if !(_result) exitWith { hint "You Chose To Cancel Your Travel Plans"; }; switch (_payment) do { case "BANK": { if (BANK < _tripTotal) then { hint "You Dont Have Enough Money To Ride The Bus"; } else { BANK = BANK - _tripTotal; }; }; case "CASH": { if (CASH < _tripTotal) then { hint "You Dont Have Enough Money To Ride The Bus"; } else { CASH = CASH - _tripTotal; }; }; default { _error = true; }; }; if (_error) exitWith {hint "ERROR: Payment Config Not Setup!"}; [6] call SOCK_fnc_updatePartial; hint "Enjoy You're Trip"; if (_type isEqualTo 1) then { showCinemaBorder true; player allowDamage false; _cam = "camera" camCreate (player modelToWorldVisual [-5,0,1.85]); _cam cameraEffect ["internal","back"]; _cam camSetFov 9; _cam camSetTarget busToMarker; _cam camSetRelPos [(((getPosATL player) select 0) - ((getMarkerPos busTo) select 0)),(((getPosATL player) select 1) - ((getMarkerPos busTo) select 1)),(((getPosATL player) select 2) + 250)]; _cam camCommit 3; waitUntil {camCommitted _cam}; player setPos busToMarker; _cam camSetFov 9; _cam camSetTarget vehicle player; _cam camCommit 0; waitUntil {camCommitted _cam}; _cam camSetRelPos [0,0,250]; _cam camCommit 5; waitUntil {camCommitted _cam}; _cam camSetFOV 9; _cam camCommit 0; waitUntil {camCommitted _cam}; _cam camSetTarget vehicle player; _cam camSetRelPos [0,0,2]; _cam camCommit 3; waitUntil {camCommitted _cam}; _cam cameraEffect ["terminate","back"]; showCinemaBorder false; hint "You Have Arrived At Your Destination"; camDestroy _cam; player allowDamage true; } else { showCinemaBorder true; player allowDamage false; _cam = "camera" camCreate (player modelToWorldVisual [-5,0,1.85]); _cam cameraEffect ["internal","back"]; _cam camSetFov 9; _cam camSetTarget busToMarker; _cam camSetRelPos [(((getPosATL player) select 0) - ((getMarkerPos busTo) select 0)),(((getPosATL player) select 1) - ((getMarkerPos busTo) select 1)),(((getPosATL player) select 2) + 250)]; _cam camCommit 3; waitUntil {camCommitted _cam}; camDestroy _cam; _cam cameraEffect ["terminate","back"]; showCinemaBorder true; createDialog "Toxic_Bus_Menu"; _display = uiNamespace getVariable "Toxic_Bus_Menu"; ctrlShow [1000,false]; ctrlShow [1001,false]; ctrlShow [2200,false]; ctrlShow [1500,false]; ctrlShow [2400,false]; _map = _display displayCtrl 1919; sleep 0.5; player setPos busToMarker; _map ctrlMapAnimAdd[5,0.1,player]; ctrlMapAnimCommit _map; sleep 5; showCinemaBorder true; closeDialog 0; _cam = "camera" camCreate (player modelToWorldVisual [0,0,250]); _cam cameraEffect ["internal","back"]; _cam camSetFOV 9; _cam camCommit 0; waitUntil {camCommitted _cam}; _cam camSetTarget vehicle player; _cam camSetRelPos [0,0,2]; _cam camCommit 3; waitUntil {camCommitted _cam}; _cam cameraEffect ["terminate","back"]; showCinemaBorder false; hint "You Have Arrived At Your Destination"; camDestroy _cam; player allowDamage true; }; Step 4: Go to "Altis_Life.Altis\Dialog" and CREATE a FILE called "Toxic_Bus_Menu.hpp" /* Author: ToxicRageTv File: Toxic_Bus_Menu.hpp */ class Toxic_Bus_Menu { idd = 1; movingEnable = 1; enableSimulation = 1; onLoad = "uiNamespace setVariable ['Toxic_Bus_Menu',_this select 0]"; class controlsBackground { class backgroundMain: life_RscText { idc = 2200; x = 0.43304 * safezoneW + safezoneX; y = 0.313091 * safezoneH + safezoneY; w = 0.139172 * safezoneW; h = 0.373939 * safezoneH; colorBackground[] = {0,0,0,0.5}; }; class topTrim: life_RscText { idc = 1000; text = "Bus Menu"; //--- ToDo: Localize; x = 0.427837 * safezoneW + safezoneX; y = 0.286011 * safezoneH + safezoneY; w = 0.144326 * safezoneW; h = 0.0219964 * safezoneH; colorBackground[] = {1,0.341,0.2,1}; }; class trimLeft: life_RscText { idc = 1001; x = 0.428893 * safezoneW + safezoneX; y = 0.313091 * safezoneH + safezoneY; w = 0.0041236 * safezoneW; h = 0.373939 * safezoneH; colorBackground[] = {1,0.341,0.2,1}; }; }; class controls { class interactionList: Life_RscListbox { idc = 1500; onLBDblClick = ""; x = 0.438167 * safezoneW + safezoneX; y = 0.324052 * safezoneH + safezoneY; w = 0.128863 * safezoneW; h = 0.318948 * safezoneH; //style = ST_CENTER; sizeEx = GUI_GRID_CENTER_H; }; class interactButton: Life_RscButtonMenu { idc = 2400; text = "Get On Bus"; //--- ToDo: Localize; onButtonClick = "[] spawn toxic_fnc_busStart"; x = 0.438168 * safezoneW + safezoneX; y = 0.654004 * safezoneH + safezoneY; w = 0.128863 * safezoneW; h = 0.0219964 * safezoneH; colorBackground[] = {1,0.341,0.2,1}; sizeEx = GUI_GRID_CENTER_H; }; class MapView: Life_RscMapControl { idc = 1919; x = 0 * safezoneW + safezoneX; y = 0 * safezoneH + safezoneY; w = 1 * safezoneW; h = 1 * safezoneH; maxSatelliteAlpha = 0.75; alphaFadeStartScale = 1.15; alphaFadeEndScale = 1.29; }; }; }; Step 5: OPEN "Altis_Life.Altis\Dialog\MasterHandler.hpp" and at the bottom ADD #include "Toxic_Bus_Menu.hpp" Step 6: OPEN "Altis_Life.Altis\Functions.hpp" at the very bottom ADD class Toxic_Functions { tag = "Toxic"; class Toxic_Main { file = "core\Toxic"; class busMenu {}; class busStart {}; }; }; Step 7: OPEN "Altis_Life.Altis\config\Config_Master.hpp" at the very bottom ADD class Toxic_Bus_Config { payment = CASH; //Change whether you want them to pay from their bank or CASH on hand bus_3d = false; //True or False class Civilian { multipler = 0.1; //Price per KM multiplyer stops[] = { //{"Display Name","Marker_Name"} {"Kavala","bus_kavala"}, {"Agios Dionysios","bus_agiosDionysios"}, {"Syrta","bus_syrta"}, {"Zaros","bus_zaros"}, {"Poliakko","bus_poliakko"}, {"Athira","bus_athira"}, {"Airport","bus_airport"}, {"Paros","bus_paros"}, {"Chalkeia","bus_chalkeia"}, {"Selakano","bus_selakano"} }; }; class Cop { multipler = 0.05; stops[] = { {"Kavala PD","bus_kavalaPD"}, {"Athira PD","bus_athiraPD"}, {"Pygros PD","bus_pygrosPD"} }; }; class Medic { multipler = 0.05; stops[] = { {"Kavala Hospital","bus_kavalaMed"}, {"Airport Hospital","bus_airportMed"}, {"Pygros Hospital","bus_pygrosMed"} }; }; }; Step 8: OPEN your mission.sqm in EDEN and add markers and signs where you want to have but stops. (There needs to be a sign/marker at every bus stop) In the init field of the sign ADD this addAction["Bus Stop",toxic_fnc_busMenu]; Once you have added all your bus stops, go back to the Master_Config.hpp and edit the name of the bus stops and the marker that goes with it. If I missed anything let me know, hope you enjoy!
  7. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    1. Run the server without being encrypted and see if the logs say anything else. 2. You have several errors that are not related to my scripts that you need to fix.
  8. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Replace your Config_Master.hpp with this https://pastebin.com/4q92nTqM Also post your entire rpt
  9. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Ok well you didn't add it into the config_master properly. You need to add the Toxic_Bus_Config stuff under entire master config. this is what mine looks like crimes[] = { {"STR_Crime_187V","650","187V"}, {"STR_Crime_187","2000","187"}, {"STR_Crime_901","450","901"}, {"STR_Crime_215","200","215"}, {"STR_Crime_213","1000","213"}, {"STR_Crime_211","100","211"}, {"STR_Crime_207","350","207"}, {"STR_Crime_207A","200","207A"}, {"STR_Crime_390","1500","390"}, {"STR_Crime_487","150","487"}, {"STR_Crime_488","70","488"}, {"STR_Crime_480","100","480"}, {"STR_Crime_481","100","481"}, {"STR_Crime_482","500","482"}, {"STR_Crime_483","950","483"}, {"STR_Crime_459","650","459"}, {"STR_Crime_666","200","666"}, {"STR_Crime_667","4500","667"}, {"STR_Crime_668","1500","668"}, {"STR_Crime_1","250","1"}, {"STR_Crime_2","200","2"}, {"STR_Crime_3","150","3"}, {"STR_Crime_4","250","4"}, {"STR_Crime_5","100","5"}, {"STR_Crime_6","80","6"}, {"STR_Crime_7","150","7"}, {"STR_Crime_8","5000","8"}, {"STR_Crime_9","5000","9"}, {"STR_Crime_10","15000","10"}, {"STR_Crime_11","10000","11"}, {"STR_Crime_12","2500","12"}, {"STR_Crime_13","1500","13"}, {"STR_Crime_14","500","14"}, {"STR_Crime_15","2500","15"}, {"STR_Crime_16","1500","16"}, {"STR_Crime_17","100","17"}, {"STR_Crime_18","1500","18"}, {"STR_Crime_19","2500","19"}, {"STR_Crime_20","500","20"}, {"STR_Crime_21","500","21"}, {"STR_Crime_22","2000","22"}, {"STR_Crime_23","5000","23"}, {"STR_Crime_24","10000","24"}, {"STR_Crime_25","20000","25"} }; }; class Toxic_Bus_Config { payment = CASH; //Change whether you want them to pay from their bank or CASH on hand bus_3d = true; //True or False class Civilian { multipler = 0.1; //Price per meter multiplyer stops[] = { {"Union","bus_union"}, {"Smallville","bus_smallville"}, {"Victoria","bus_victoria"}, {"Airport","bus_airport"} }; }; class Cop { multipler = 0.05; stops[] = { {"Union","cop_spawn_Union"}, {"Smallville","cop_spawn_Smallville"}, {"Victoria","cop_spawn_Victoria"}, {"DOC","cop_spawn_doc"}, {"Airport","cop_spawn_Airport"} }; }; class Medic { multipler = 0.05; stops[] = { {"Union","medic_spawn_Union"}, {"Smallville","medic_spawn_smallville"}, {"Victoria","medic_spawn_victoria"}, {"Airport","medic_spawn_Airport"} }; }; };
  10. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Ok, well maybe post the errors so that way it can get fixed............
  11. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Maybe try a fresh mission.sqm just to test and see what happens in the rpt logs
  12. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    I mean it shouldn't because it's made as a stand alone script it doesn't rely on other scripts. Did you double check all the init fields of the bus stops to make sure they were right? Also are you running the correct mission.sqm on your server? (sounds obvious but its happened before).
  13. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Yeah, i just wanted to make sure, some people are lazy and just put it in the mission.sqf file and dont put it in properly and breaks the mission.sqm. I'm not sure why its not working for you. This is what i have in mine: this addAction["Bus Stop",toxic_fnc_busMenu,"",0,false,false,"","",5]; I would suggest going through the tutorial again and just making sure everything is done properly. And also check every bus stop and make sure the code is right in all of them. Also, what framework version is it?
  14. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Why you added in that code to the init field, did you do it in eden or through the mission.sqm file?
  15. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    Sorry, just saw your message. Do you still need help with this?
  16. ToxicRageTv

    2D/3D Bus System - Tutorial 5.0

    You have several errors. This one is relating to the mission.sqm Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Error in expression <addAction["Bus Stop",toxic_fnc_busMenu];> Error position: <> Error Invalid number in expression Also your database isn't connecting. Please post the code you are using in the init field of the bus stop signs and also post your description.ext
  17. ToxicRageTv

    Virtual + Physical Inventory - Tutorial 5.0

    Step 1: Go to "Altis_Life.Altis\Dialog\Common.hpp" and at the bottom ADD class Life_ToxicRscListBox { //style = 16; idc = -1; type = 5; x = 0; y = 0; w = 0.275; h = 0.04; sizeEx = GUI_GRID_CENTER_H; style = ST_CENTER; font = "RobotoCondensed"; colorSelect[] = {1, 1, 1, 1}; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0.28,0.28,0.28,0.28}; colorSelect2[] = {1, 1, 1, 1}; colorSelectBackground[] = {0.95, 0.95, 0.95, 0.5}; colorSelectBackground2[] = {1, 1, 1, 0.5}; colorScrollbar[] = {0.2, 0.2, 0.2, 1}; colorPicture[] = {1,1,1,1}; colorPictureSelected[] = {1,1,1,1}; colorPictureDisabled[] = {1,1,1,1}; arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; wholeHeight = 0.45; rowHeight = 0.04; color[] = {0.7, 0.7, 0.7, 1}; colorActive[] = {0,0,0,1}; colorDisabled[] = {0,0,0,0.3}; //sizeEx = 0.023; soundSelect[] = {"",0.1,1}; soundExpand[] = {"",0.1,1}; soundCollapse[] = {"",0.1,1}; maxHistoryDelay = 1; autoScrollSpeed = -1; autoScrollDelay = 5; autoScrollRewind = 0; tooltipColorText[] = {1,1,1,1}; tooltipColorBox[] = {1,1,1,1}; tooltipColorShade[] = {0,0,0,0.65}; class ListScrollBar: Life_RscScrollBar { color[] = {1,1,1,1}; autoScrollEnabled = 1; }; }; class Life_ToxicRscEdit { x = 0; y = 0; w = 0.275; h = 0.04; text = ""; type = 2; style = 0x00 + 0x40; font = "RobotoCondensed"; shadow = 2; sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; colorBackground[] = {0, 0, 0, 1}; soundSelect[] = {"",0.1,1}; soundExpand[] = {"",0.1,1}; colorText[] = {0.95, 0.95, 0.95, 1}; colorDisabled[] = {1, 1, 1, 0.25}; autocomplete = false; colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1}; canModify = 1; }; Step 2: Open "Altis_Life.Altis\Dialog\Player_Inv.hpp" and EDIT the following: Change onButtonClick = "[] call life_fnc_giveItem;"; To onButtonClick = "[0] call life_fnc_giveItem;"; Change onButtonClick = "[] call life_fnc_useItem;"; To onButtonClick = "[0] call life_fnc_useItem;"; Change onButtonClick = "[] call life_fnc_removeItem;"; To onButtonClick = "[0] call life_fnc_removeItem;"; Step 3: Open "Altis_Life.Altis\Core\PMenu\fn_giveItem.sqf" and REPLACE with #include "..\..\script_macros.hpp" /* File: fn_giveItem.sqf Author: Bryan "Tonic" Boardwine Description: Gives the selected item & amount to the selected player and removes the item & amount of it from the players virtual inventory. */ private ["_unit","_val"]; private _mode = param [0,0,[0]]; switch (_mode) do { case 0: { _val = ctrlText 2010; ctrlShow[2002,false]; if ((lbCurSel 2023) isEqualTo -1) exitWith {hint localize "STR_NOTF_noOneSelected"; ctrlShow[2002,true];}; _unit = lbData [2023,lbCurSel 2023]; _unit = call compile format ["%1",_unit]; if ((lbCurSel 2005) isEqualTo -1) exitWith {hint localize "STR_NOTF_didNotSelectItemToGive";ctrlShow[2002,true];}; _item = lbData [2005,(lbCurSel 2005)]; if (isNil "_unit") exitWith {ctrlShow[2002,true];}; if (_unit == player) exitWith {ctrlShow[2002,true];}; if (isNull _unit) exitWith {ctrlShow[2002,true];}; //A series of checks *ugh* if (!([_val] call TON_fnc_isnumber)) exitWith {hint localize "STR_NOTF_notNumberFormat";ctrlShow[2002,true];}; if (parseNumber(_val) <= 0) exitWith {hint localize "STR_NOTF_enterAmountGive";ctrlShow[2002,true];}; if (isNil "_unit") exitWith {ctrlShow[2001,true]; hint localize "STR_NOTF_notWithinRange";}; if (!([false,_item,(parseNumber _val)] call life_fnc_handleInv)) exitWith {hint localize "STR_NOTF_couldNotGive";ctrlShow[2002,true];}; [_unit,_val,_item,player] remoteExecCall ["life_fnc_receiveItem",_unit]; _type = M_CONFIG(getText,"VirtualItems",_item,"displayName"); hint format [localize "STR_NOTF_youGaveItem",_unit getVariable ["realname",name _unit],_val,(localize _type)]; [_mode] call life_fnc_p_updateMenu; ctrlShow[2002,true]; }; case 1: { _val = ctrlText 10010; ctrlShow[10007,false]; if ((lbCurSel 10008) isEqualTo -1) exitWith {hint localize "STR_NOTF_noOneSelected"; ctrlShow[10007,true];}; _unit = lbData [10008,lbCurSel 10008]; _unit = call compile format ["%1",_unit]; if ((lbCurSel 10009) isEqualTo -1) exitWith {hint localize "STR_NOTF_didNotSelectItemToGive";ctrlShow[10007,true];}; _item = lbData [10009,(lbCurSel 10009)]; if (isNil "_unit") exitWith {ctrlShow[10007,true];}; if (_unit == player) exitWith {ctrlShow[10007,true];}; if (isNull _unit) exitWith {ctrlShow[10007,true];}; //A series of checks *ugh* if (!([_val] call TON_fnc_isnumber)) exitWith {hint localize "STR_NOTF_notNumberFormat";ctrlShow[10007,true];}; if (parseNumber(_val) <= 0) exitWith {hint localize "STR_NOTF_enterAmountGive";ctrlShow[10007,true];}; //if (isNil "_unit") exitWith {ctrlShow[2001,true]; hint localize "STR_NOTF_notWithinRange";}; if (!([false,_item,(parseNumber _val)] call life_fnc_handleInv)) exitWith {hint localize "STR_NOTF_couldNotGive";ctrlShow[10007,true];}; [_unit,_val,_item,player] remoteExecCall ["life_fnc_receiveItem",_unit]; _type = M_CONFIG(getText,"VirtualItems",_item,"displayName"); hint format [localize "STR_NOTF_youGaveItem",_unit getVariable ["realname",name _unit],_val,(localize _type)]; [_mode] call life_fnc_p_updateMenu; ctrlShow[10007,true]; }; }; Step 4: Open "Altis_Life.Altis\Core\PMenu\fn_removeItem.sqf" and REPLACE with #include "..\..\script_macros.hpp" /* File: fn_removeItem.sqf Author: Bryan "Tonic" Boardwine Description: Removes the selected item & amount to remove from the players virtual inventory. */ private ["_data","_value","_obj"]; disableSerialization; private _mode = param [0,0,[0]]; switch (_mode) do { case 0: { _data = lbData[2005,(lbCurSel 2005)]; _value = ctrlText 2010; }; case 1: { _data = lbData[10009,(lbCurSel 10009)]; _value = ctrlText 10010; }; }; if (_data isEqualTo "") exitWith {hint localize "STR_NOTF_didNotSelectToRemove";}; if (!([_value] call TON_fnc_isnumber)) exitWith {hint localize "STR_NOTF_notNumberFormat";}; if (parseNumber(_value) <= 0) exitWith {hint localize "STR_NOTF_enterAmountRemove";}; if (ITEM_ILLEGAL(_data) isEqualTo 1 && ([west,visiblePosition player,100] call life_fnc_nearUnits)) exitWith {titleText[localize "STR_NOTF_illegalItemCannotDispose","PLAIN"]}; if !(isNull objectParent player) exitWith {titleText[localize "STR_NOTF_cannotRemoveInVeh","PLAIN"]}; if (!([false,_data,(parseNumber _value)] call life_fnc_handleInv)) exitWith {hint localize "STR_NOTF_couldNotRemoveThatMuch";}; hint format [localize "STR_NOTF_removedFromInventory",(parseNumber _value),(localize ITEM_NAME(_data))]; [_mode] call life_fnc_p_updateMenu; Step 5: Open "Altis_Life.Altis\Core\PMenu\fn_useItem.sqf" and below private ["_item"]; disableSerialization; ADD switch (_mode) do { case 0: { _item = CONTROL_DATA(2005); }; case 1: { _item = lbData [ 10009, ( lbCurSel 10009 )]; }; }; The TOP of the file should now look like this #include "..\..\script_macros.hpp" /* File: fn_useItem.sqf Author: Bryan "Tonic" Boardwine Description: Main function for item effects and functionality through the player menu. */ private ["_item"]; disableSerialization; private _mode = param [0,0,[0]]; switch (_mode) do { case 0: { _item = CONTROL_DATA(2005); }; case 1: { _item = lbData [ 10009, ( lbCurSel 10009 )]; }; }; if (_item isEqualTo "") exitWith { hint localize "STR_ISTR_SelectItemFirst"; }; And at the BOTTOM of the file REPLACE [] call life_fnc_p_updateMenu; With [_mode] call life_fnc_p_updateMenu; Step 6: Open "Altis_Life.Altis\Core\PMenu\fn_p_updateMenu.sqf" and at the top of the file ABOVE _lic = CONTROL(2001,2014); ADD #include "..\..\script_macros.hpp" /* File: fn_p_updateMenu.sqf Author: Bryan "Tonic" Boardwine Description: Updates the player menu (Virtual Interaction Menu) */ private ["_inv","_lic","_licenses","_near","_near_units","_mstatus","_shrt","_side","_struct","_weightCtrl"]; disableSerialization; private _mode = param [0,0,[0]]; if (FETCH_CONST(life_adminlevel) < 1) then { ctrlShow[2021,false]; }; _side = switch (playerSide) do {case west:{"cop"}; case civilian:{"civ"}; case independent:{"med"};}; switch (_mode) do { case 0: { _inv = CONTROL(2001,2005); _weightCtrl = 2009; }; case 1: { _display = findDisplay 602; _inv = _display displayCtrl 10009; _weightCtrl = 10004; }; }; Step 7: Open "Altis_Life.Altis\Core\Functions\fn_inventoryOpened.sqf" and at the bottom ADD h = [] spawn { disableSerialization; waitUntil { !isNull ( findDisplay 602 ) }; private _display = findDisplay 602; private _background = _display ctrlCreate ["life_RscText",10001]; _background ctrlSetPosition [ 0.11833 * safezoneW + safezoneX, 0.279937 * safezoneH + safezoneY, 0.1341 * safezoneW, 0.473135 * safezoneH ]; _background ctrlSetBackgroundColor [0,0,0,0.5]; _background ctrlCommit 0; private _topTrim = _display ctrlCreate ["life_RscText",10002]; _topTrim ctrlSetPosition [ 0.11833 * safezoneW + safezoneX, 0.246928 * safezoneH + safezoneY, 0.1341 * safezoneW, 0.0220063 * safezoneH ]; _topTrim ctrlSetBackgroundColor [(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843]), (profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019]), (profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862]), (profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])]; _topTrim ctrlCommit 0; /* private _defultTopTrim = _display ctrlCreate ["life_RscText",99999]; _defultTopTrim ctrlSetPosition [ 0.433156 * safezoneW + safezoneX, 0.246928 * safezoneH + safezoneY, 0.302035 * safezoneW, 0.0220063 * safezoneH ]; _defultTopTrim ctrlSetBackgroundColor [(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843]), (profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019]), (profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862]), (profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])]; _defultTopTrim ctrlCommit 0; */ private _headerText = _display ctrlCreate ["life_RscText",10003]; _headerText ctrlSetPosition [ 0.11833 * safezoneW + safezoneX, 0.246928 * safezoneH + safezoneY, 0.0670502 * safezoneW, 0.0220063 * safezoneH ]; _headerText ctrlSetBackgroundColor [-1,-1,-1,-1]; _headerText ctrlSetText "Virtual Inventory"; _headerText ctrlCommit 0; private _weightText = _display ctrlCreate ["life_RscText",10004]; _weightText ctrlSetPosition [ 0.200853 * safezoneW + safezoneX, 0.246928 * safezoneH + safezoneY, 0.0515771 * safezoneW, 0.0220063 * safezoneH ]; _weightText ctrlSetBackgroundColor [-1,-1,-1,-1]; _weightText ctrlSetText format ["Weight: %1/%2", life_carryWeight, life_maxWeight]; _weightText ctrlCommit 0; //Player List private _playerList = _display ctrlCreate ["Life_RscCombo",10008]; _playerList ctrlSetPosition [ 0.128645 * safezoneW + safezoneX, 0.67605 * safezoneH + safezoneY, 0.11347 * safezoneW, 0.0220063 * safezoneH ]; lbClear _playerList; private _near_units = []; { if (player distance _x < 10) then {_near_units pushBack _x};} forEach playableUnits; { if (!isNull _x && alive _x && player distance _x < 10 && !(_x isEqualTo player)) then { _playerList lbAdd format ["%1 - %2",_x getVariable ["realname",name _x], side _x]; _playerList lbSetData [(lbSize _playerList)-1,str(_x)]; }; if ((lbSize _playerList) isEqualTo -1) then { _playerList lbAdd "No Players"; }; } forEach _near_units; _playerList ctrlCommit 0; //vItems private _vItems = _display ctrlCreate ["Life_ToxicRscListBox",10009]; _vItems ctrlSetPosition [ 0.128645 * safezoneW + safezoneX, 0.301944 * safezoneH + safezoneY, 0.11347 * safezoneW, 0.264075 * safezoneH ]; lbClear _vItems; { if (ITEM_VALUE(configName _x) > 0) then { _vItems lbAdd format ["%2 [x%1]",ITEM_VALUE(configName _x),localize (getText(_x >> "displayName"))]; _vItems lbSetData [(lbSize _vItems)-1,configName _x]; _icon = M_CONFIG(getText,"VirtualItems",configName _x,"icon"); if (!(_icon isEqualTo "")) then { _vItems lbSetPicture [(lbSize _vItems)-1,_icon]; }; if ((lbSize _vItems) isEqualTo -1) then { _vItems lbAdd "No Items"; }; }; } forEach ("true" configClasses (missionConfigFile >> "VirtualItems")); _vItems ctrlCommit 0; //Edit private _edit = _display ctrlCreate ["Life_ToxicRscEdit",10010]; _edit ctrlSetPosition [ 0.144118 * safezoneW + safezoneX, 0.643041 * safezoneH + safezoneY, 0.0825233 * safezoneW, 0.0220063 * safezoneH ]; _edit ctrlSetText "1"; _edit ctrlCommit 0; //BUTTONS private _useButton = _display ctrlCreate ["life_RscButtonMenu",10005]; _useButton ctrlSetPosition [ 0.144118 * safezoneW + safezoneX, 0.577022 * safezoneH + safezoneY, 0.0825233 * safezoneW, 0.0220063 * safezoneH ]; _useButton ctrlSetStructuredText parseText "<t align='center'>Use</t>"; _useButton buttonSetAction "[1] call life_fnc_useItem"; _useButton ctrlCommit 0; private _removeButton = _display ctrlCreate ["life_RscButtonMenu",10006]; _removeButton ctrlSetPosition [ 0.144118 * safezoneW + safezoneX, 0.610031 * safezoneH + safezoneY, 0.0825233 * safezoneW, 0.0220063 * safezoneH ]; _removeButton ctrlSetStructuredText parseText "<t align='center'>Remove</t>"; _removeButton buttonSetAction "[1] call life_fnc_removeItem;"; _removeButton ctrlCommit 0; private _giveButton = _display ctrlCreate ["life_RscButtonMenu",10007]; _giveButton ctrlSetPosition [ 0.144118 * safezoneW + safezoneX, 0.70906 * safezoneH + safezoneY, 0.0825233 * safezoneW, 0.0220063 * safezoneH ]; _giveButton ctrlSetStructuredText parseText "<t align='center'>Give</t>"; _giveButton buttonSetAction "[1] call life_fnc_giveItem;"; _giveButton ctrlCommit 0; }; If i missed anything let me know. Hope you enjoy!
  18. ToxicRageTv

    Fast mission testing method

    You don’t even need pbo’s for this. (You do for life_server but not the mission file)
  19. ToxicRageTv

    Fast mission testing method

    Personally I use this method all the time. It makes it really quick to make edits and test it out right away.
  20. ToxicRageTv

    Virtual + Physical Inventory - Tutorial 5.0

    i would suggest you go through the tutorial again and make sure you follow every step
  21. ToxicRageTv

    Virtual + Physical Inventory - Tutorial 5.0

    why did you add it in?
  22. ToxicRageTv

    Virtual + Physical Inventory - Tutorial 5.0

    why is it not possible? Did you already try to remove it?
  23. ToxicRageTv

    Virtual + Physical Inventory - Tutorial 5.0

    looks like you have an extra }; at the end
  24. ToxicRageTv

    [TUTORIAL] Speaker/PA announcements

    Is loudspeaker.sqf in your scripts folder
×