Jump to content

General McTavish

Member
  • Content Count

    20
  • Joined

  • Last visited

  • Medals

Everything posted by General McTavish

  1. I am looking for some help here :D, basically looking to run this script on MP but need help with the addaction and the conditions (if player is within 5 metres, vehicle is flipped over then addaction is available) _vehicle = cursorTarget; _vehicle setVectorUp surfaceNormal getPos _vehicle; _vehicle setPosATL [getPosATL _vehicle select 0, getPosATL _vehicle select 1, 0]; };
  2. 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)
  3. 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
  4. 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.
  5. General McTavish

    Create Vehicle Position help

    @pierremgi Perfect, it all works as intended Thank you very much for the help
  6. 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:
  7. 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.
  8. General McTavish

    Create Vehicle Position help

    Woops, fixed 😄
  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. General McTavish

    Virtual Item Issue

    Still can't fix this, any one have ideas?
  11. 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"];
  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. General McTavish

    Spawn Weapon with ammo on ground

    Totally missed the array bit haha Fixed it, thanks for the help m8 😄
  14. 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}; };
  15. I am currently making a custom debug menu to use on our Altis life server, but I am having issues with running functions globally and on the server. Similar to using the default debug global and server exec buttons I enter some code in the Rsceditbox (99007) and when I press the global button I get the system chat notification but code doesn't run and when I press the server button nothing happens at all. Dialog class RebornDBG { idd = 99000; movingEnabled = 0; enableSimulation = 0; onLoad = ""; onUnload = ""; class Controls { class Maindebug: RDB2_RscEdit { idc = 99007; x = 0.298906 * safezoneW + safezoneX; y = 0.379 * safezoneH + safezoneY; w = 0.402187 * safezoneW; h = 0.484 * safezoneH; }; class GlobalExec: RDB_RscButtonMenu { idc = 99028; text = "Global"; onButtonClick = "[] call RR_fnc_runGlobal;"; x = 0.298906 * safezoneW + safezoneX; y = 0.8652 * safezoneH + safezoneY; w = 0.128906 * safezoneW; h = 0.033 * safezoneH; }; class ServerExecButton: RDB_RscButtonMenu { idc = 1013; text = "Server"; onButtonClick = "[] call RR_fnc_runServer;"; x = 0.432969 * safezoneW + safezoneX; y = 0.8652 * safezoneH + safezoneY; w = 0.134062 * safezoneW; h = 0.033 * safezoneH; }; }; runGlobal.sqf params ["_code"]; [_code] remoteExec ["RR_fnc_globalExec",0]; globalExec.sqf _display = findDisplay 99900; _ctrl = _display displayCtrl 99007; _code = ctrlText _ctrl; systemChat "RAN CODE ON: GLOBAL"; runServer.sqf params ["_code"]; [_code] remoteExec ["RR_fnc_serverExec",2]; serverExec.sqf _display = findDisplay 99900; _ctrl = _display displayCtrl 99007; _code = ctrlText _ctrl; systemChat "RAN CODE ON: SERVER"; CfgRemoteExec //Debug Exec F(RR_fnc_globalExec,CLIENT) F(RR_fnc_serverExec,CLIENT)
  16. 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
  17. 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
  18. General McTavish

    Vehicle Unflip script

    Funny that you mention doing that for antistasi as i was sick of having tanks/apcs flip over while playing antistasi. Would you call this script in the initserver?
  19. Hi all i am looking for some config help here I am trying to change the Main Cannon on an Apache AH64D to fire xxx ammo (lets say 5000Rnd_762x51_Belt) but i am stuck because i havent patched vehicles before Any help is appreciated My Config class defaultUserActions; class DefaultEventhandlers; class WeaponFireGun; class WeaponCloudsGun; class WeaponFireMGun; class WeaponCloudsMGun; class CfgPatches { class rbplus_hafm { units[]={}; weapons[]={}; requiredVersion=0.1; requiredAddons[]={}; }; }; class CfgVehicles { class AllVehicles; class Air: AllVehicles class Helicopter: Air { class Turrets { class MainTurret; }; }; class HAFM_AH64_base: Helicopter class HAFM_AH64D: HAFM_AH64_base { class Turrets: Turrets { class MainTurret: MainTurret { magazines[]= { "5000Rnd_762x51_Belt", }; }; }; }; }; class CfgWeapons { class Default; class CannonCore; class M230: CannonCore { scope=1; displayName="Main Cannon"; magazines[]= { "5000Rnd_762x51_Belt" }; }; class CfgMagazines { class VehicleMagazine; class 1200Rnd_30x113mm_M789_HEDP: VehicleMagazine { displayName="5000Rnd 762x51 Belt"; ammo="5000Rnd_762x51_Belt"; count=5000; }; }; Original Config
  20. Hello all I love this missions great job, I have put in a custom spawn area but i am trying to fix where my sides spawn they can only run a certain radius before they are essentially teleported back to the spawn marker, so people are stuck from exploring the base while we wait/are dead I thhought it would ba a trigger of somr sort but i cannot see it anywhere in the files Any help would be great.
×