Jump to content

General McTavish

  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

13 Good

About General McTavish

  • Rank
    Private First Class

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I am having an issue with spawning vehicles at certain spawn markers Let's say there are 5 "shops" all over the map and each has its own spawn, right now a player "buys" a vehicle and it spawns only at Spawn 1 I am trying to make it so it would select the nearest spawn to the player (that is pre-defined in an array)
  2. General McTavish

    Delete Vehicle Help

    Thank you very much for the help @pierremgi and @stanhope One last question, if I have multiple markers can I put markers in array and put that in a forEach
  3. So, I am trying to make a script that deletes all empty vehicles in an area defined by a marker every 5 minutes That works fine at the moment, however, I'm struggling on how to make it so if a player is within 10 meters of any vehicle then it won't delete it.
  4. General McTavish

    Create Vehicle Position help

    @pierremgi Perfect, it all works as intended Thank you very much for the help
  5. General McTavish

    Create Vehicle Position help

    Thanks for the reply, I totally forgot about simulation I tried your code and it won't spawn anything at all now.
  6. General McTavish

    Create Vehicle Position help

    Woops, fixed 😄
  7. Hey all I am helping to build a ramp/obstacle course and having difficulty working out how to set the objects on the Z Index I can spawn them fine, however, they spawn at all ground level Not sure on how to correctly pull the position so they create correctly in the air Any help would be great Code:
  8. General McTavish

    Virtual Item Issue

    Still can't fix this, any one have ideas?
  9. General McTavish

    Virtual Item Issue

    I play on an Altis life server and I am making a virtual items list to spawn virtual items in locally (to the admins inventory) The dialog (Rsedit) works fine in which to add numbers but when I click to it does nothing I have tried so many different ways but something is not working and I can't figure out where also tried lbText as well as lbData If I run this from debug (local exec) it gives me the item _item = "largegift"; _num = 1; [true, _item, _num] call RR_fnc_handleInv; Code private ["_item","_num"]; _display = findDisplay 9801; _item = lbData [9873, (lbCurSel 9873)]; _num = parseNumber(ctrlText 65465); //Add _add = _display ctrlCreate ["ModShop_RscButton",65466]; _add ctrlSetPosition [0.432969 * safezoneW + safezoneX, 0.511 * safezoneH + safezoneY, 0.061875 * safezoneW, 0.022 * safezoneH]; _add ctrlSetText "Add Item"; _add ctrlCommit 0; _add ctrlAddEventHandler ['ButtonClick','[true, _item, _num] call RR_fnc_handleInv']; RR_fnc_HandleInv private["_math","_item","_num","_return","_var","_weight","_value","_diff"]; params [ ["_math",false,[false]], ["_item","",[""]], ["_num",0,[0]] ]; Can post full script if needed Virtual Items List lbclear _lblist; { _itemName = format ["%1",configName _x]; _itemDisplayName = getText(missionConfigFile >> "VirtualItems" >> _itemName >> "displayname"); _itemDisplayIcon = getText(missionConfigFile >> "VirtualItems" >> _itemName >> "icon"); _itemDisplayName = localize _itemDisplayName; if !(_itemName isEqualTo "") then { _lbList lbAdd format ["%1",_itemDisplayName]; _lbList lbSetData [(lbSize _lbList)-1,_itemName]; _lbList lbSetPicture [(lbSize _lbList )-1,_itemDisplayIcon]; }; } forEach ("true" configClasses (missionConfigFile >> "VirtualItems"));
  10. I am trying to implement a spectate script that will run when double-clicking a player in a RscTree. Now it works fine for static information such as UID, name etc, but i am unsure the best approach to make it "live" (I.E. will update if the player gets in a vehicle or changes weapon) With weapon https://i.gyazo.com/3fa65603994ee8e2c20b16e4de78da8f.jpg Without https://i.gyazo.com/1117b84ba1c8e739d9006dd4c5b9bcf2.jpg Code private["_unit"]; _display = findDisplay 46; _unit = tvData[9803,tvCurSel (9803)]; _unit = call compile format["%1", _unit]; _uid = getPlayerUID _unit; _veh = vehicle _unit; //Checks if (isNil "_unit") exitWith {}; if (isNull _unit) exitWith {}; /*if (_unit == player) exitWith {["You can't do that dumbass.",true,"fast"] call RR_fnc_notificationSystem;};*/ [] spawn { while {dialog} do { closeDialog 0; uisleep 0.01; }; }; //Player Info _ctrlText = '<t align=''left'' size=''0.9'' shadow=''2'' color=''#FFFFFF''>Spectating - F9 to show inventory, F10 to exit/stop spectating</t><br/>'; _info = format["Spectating Player: %1 (%2) %3",name _unit, _uid, _veh]; _ctrlText = _ctrlText + '<t align=''left'' shadow=''2'' size=''1.1'' color=''#11e602''>'+_info +'</t>'; //Weapon Info _type = currentWeapon _unit; _cammo = _veh ammo _type; _pic = getText(configFile >> "CfgWeapons" >> _type >> "picture"); _displayName = getText(configFile >> "CfgWeapons" >> _type >> "displayName"); _info = format ["%1 (%2)",_displayName, _cammo]; _ctrlWep = '<img image='''+_pic+''' align=''left'' shadow=''2'' size=''1''/><t align=''left'' shadow=''2'' size=''1.1'' color=''#e68a00''>'+_info+'</t>'; //Controls _ctrl = _display ctrlCreate ["RscStructuredText",6969]; _ctrl ctrlSetPosition [0.041094 * safezoneW + safezoneX, 0.071 * safezoneH + safezoneY, 0.3 * safezoneW, 0.055 * safezoneH]; _ctrl ctrlCommit 0; _ctrl ctrlSetStructuredText parseText _ctrlText; _wep = _display ctrlCreate ["RscStructuredText",6970]; _wep ctrlSetPosition [0.0410937 * safezoneW + safezoneX, 0.126 * safezoneH + safezoneY, 0.4 * safezoneW, 0.055 * safezoneH]; _wep ctrlCommit 0; if ((_displayname != "")) then { _wep ctrlSetStructuredText parseText _ctrlWep; } else { _wep ctrlSetStructuredText parseText ""; }; //Spectate Camera _unit switchCamera "INTERNAL";[format["You are now spectating %1 Press F10 to stop Spectating.",_unit getVariable ["playername", "Unknown Player"]],true,"fast"] call RR_fnc_notificationSystem; AM_Exit = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 68) then {(findDisplay 46) displayRemoveEventHandler ['KeyDown',AM_Exit]; ctrlDelete ((findDisplay 46) displayCtrl 6969); ctrlDelete ((findDisplay 46) displayCtrl 6970); player switchCamera 'INTERNAL';[""You have stopped spectating"",true,""fast""] call RR_fnc_notificationSystem;};false"];
  11. General McTavish

    Spawn Weapon with ammo on ground

    Totally missed the array bit haha Fixed it, thanks for the help m8 😄
  12. So I have a list box that has rifles/pistols/launchers that will spawn on the ground when we double-click the selected weapon. Spawning the weapon works fine, however, it is empty. I am trying to spawn ammo for the selected weapon but no ammo spawns when I try (empty weapon does), I have tried multiple different ways but nothing works. Spawn script private["_classname","_magazines"]; _classname = lbData [9871, (lbCurSel 9871)]; _magazines = getArray (configFile >> "CfgWeapons" >> _classname >> "magazines"); _wep = createVehicle ["GroundWeaponHolder", position player, [], 0, "CAN_COLLIDE"]; _wep addWeaponCargoGlobal [_classname, 1]; _mag = createVehicle ["GroundWeaponHolder", position player, [], 0, "CAN_COLLIDE"]; _mag addMagazineCargoGlobal [_magazines, 3]; hint format["You have spawned a %1",_classname]; Listbox disableSerialization; _lbList = (findDisplay 9801) displayCtrl 9871; lbclear _lblist; _Weapons = []; _Rifles = "getnumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons"); _Pistols = "getnumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons"); _Launchers = "getnumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons"); _Weapons pushBack _Rifles; _Weapons pushBack _Pistols; _Weapons pushBack _Launchers; _Weapons = _Rifles + _Pistols + _Launchers; { _className = configName _x; _weapon = getText(configFile >> "CfgWeapons" >> _className >> "displayName"); _picture = getText(configFile >> "CfgWeapons" >> _className >> "picture"); if !(_className isEqualTo "") then { _index = _lbList lbAdd _weapon; _lbList lbSetPicture [_index,_picture]; _lbList lbSetData [_index,_className]; _lbList lbSetTooltip [_index,_className]; }; } forEach _Weapons;
  13. I am trying to create a list box menu that will spawn vehicles on left double-click The following code populates the Listbox with all the vehicles and pictures etc but after reading many posts I am unsure on how to code the rest so that when I double-click it gets the class name from the index and then spawns the vehicle _lbList = (findDisplay 9801) displayCtrl 9877; disableSerialization; private["_position","_className","_displayName"]; lbclear _lblist; _vehiclelist = ("(configname _x isKindOf 'LandVehicle' or configname _x isKindOf 'Air' or configname _x isKindOf 'Ship') && getNumber (_x >> 'scope') == 2 " configClasses (configfile >> "CfgVehicles")); { _className = configName _x; _vehicle = getText(configFile >> "CfgVehicles" >> _className >> "displayName"); _picture = getText(configFile >> "CfgVehicles" >> _className >> "picture"); if !(_className isEqualTo "") then { _index = _lbList lbAdd _vehicle; _lbList lbSetPicture [_index,_picture]; _lbList lbSetData [_index,_className]; _lbList lbSetTooltip [_index,_className]; }; } forEach _vehiclelist; lbSort [_lblist, "ASC"]; class VehiclesBox: RscListBox { idc = 9877; x = 0.845468 * safezoneW + safezoneX; y = 0.126 * safezoneH + safezoneY; w = 0.134062 * safezoneW; h = 0.858 * safezoneH; onLBDblClick = "systemChat str ['onLBDblClick',_this]; false"; colorBackground[] = {0.8,0,0.5,0.1}; };
  14. General McTavish

    Custom Debug Issues

    Thanks @Larrow I will give this a try In terms of our remoteExec policy, if we need a function to be remoteExec then we add it to the CfgRemoteExec config
  15. General McTavish

    Custom Debug Issues

    Thank you very much for the help @Larrow The only problem is that we don't have BIS_fnc_call / call whitelisted due to hackers visiting our server once in a while Is there a workaround without allowing that function to be allowed Thanks again