Jump to content

MasterPuffin

Member
  • Content Count

    30
  • Joined

  • Last visited

  • Medals

Community Reputation

21 Excellent

2 Followers

About MasterPuffin

  • Rank
    Private First Class

Profile Information

  • Gender
    Male
  • Location
    Germany

Contact Methods

  • Steam url id
    sgtomtf

Recent Profile Visitors

1871 profile views
  1. if you wand your light permanently on instead of blinking replace the while part in the light.sqf with the following code: while{ (alive _vehicle) && (_repeat isEqualTo true)} do { if(_leftRed) then { _lightleft setLightBrightness _brightness; } else { _lightright setLightBrightness _brightness; }; sleep 1; _repeat = _vehicle getVariable "lights"; }; deleteVehicle _lightleft; deleteVehicle _lightright;
  2. Add _unit setVariable ["restcaller ", false]; _unit setVariable ["restrain ", false]; at the end of the script before the line that says } forEach (units _grp);
  3. If you use a script to spawn the unit, place this line inside your script. May I ask which script are you using?
  4. You could insert the parameters in the script you are using to call your units.
  5. MasterPuffin

    [Release] Simple MP Restraining Script

    Have you set the variables in the onPlayeRespawn.sqf correctly? Also try adding those variables in the init.sqf!
  6. MasterPuffin

    [Release] Keyhandler with modificators

    @Taylor2.0 Sorry for the late reply buddy, just use the following code: case 22: {//U key if (_shift) then { execVM "scripts/restrain.sqf"; }; In this case it would trigger the script when you press Shift + U
  7. @Bosh Sorry for the late reply! This should work: if (restcaller isEqualto false) then { if (restrain isEqualto false) then { restrain=true; _this setVariable ["restrain", true, true]; while { _this getVariable ["restrain", false] } do { _this playMove "AmovPercMstpSnonWnonDnon_EaseIn"; //Animation in if (((!alive _this) || (_this getVariable["onkill",FALSE]))) then { _this setVariable ["restrain", false, true]; }; }; _this playMoveNow "AmovPercMstpSnonWnonDnon_EaseOut"; //Animation out } else { restrain=false; _this setVariable ["restrain", false, true]; //Set surrender to true _this playMoveNow "AmovPercMstpSnonWnonDnon_EaseOut"; //Animation out }; }; restcaller = false; and in the init of the AI you put restcaller = false; restrain = false;
  8. Hello, I'm using https://community.bistudio.com/wiki/Dynamic_Groups and I want to make a script which checks if a group with a certain name already exists and if not create it and assigns the player to it. In case the group already exists it should assign the player to this group. Does anyone have an idea how to do this? Cheers Puffin
  9. No, in Arma there is no way to skin helmets and vests without a mod. You can skin backpacks however The code has to run forever because at some times Arma loads the default skin even during the mission, for example if you open the Virtual Arsenal. But you are right, it would be better to place the script in the init.sqf
  10. I have found a bug: Every time the editor crashes, it resets the selected theme.
  11. AFAIK the only way to replace game textures would be to rip out the 3D models from the game files and make a mod with a custom texture. Wich is BTW a legal grey area
  12. This script is best used with a keyhandler, however if you have a bit of experience with coding you can get it also work with addaction. This script works in MP ******************************** Download the sounds here (or use your own ones) Make a folder called sounds and put the two files inside this folder Put the following code in your description.ext class CfgSounds { class Siren { name = "Siren"; sound[] = {"sounds\Siren.ogg", 5.0, 1}; titles[] = {1, ""}; }; class Yelp { name = "Yelp"; sound[] = {"sounds\Yelp.ogg", 5.0, 1}; titles[] = {1, ""}; }; }; Put the following code in your keyhandler: case 33: {//F key if (_shift) then { _vehicle = (vehicle player); if (isNil {_vehicle getVariable "EmergencyVeh"}) then { _vehicle setVariable ["EmergencyVeh", false, true]; }; _ComVeh = _vehicle getVariable "EmergencyVeh"; if (vehicle player != player && (driver _vehicle == player && _ComVeh isEqualTo true)) then { if (isNil {_vehicle getVariable "siren"}) then { _vehicle setVariable ["siren", false, true]; }; _SirenState = _vehicle getVariable "siren"; if (_SirenState isEqualTo true) then { _vehicle setVariable ["siren", false, true]; } else { [[[_vehicle],"scripts\siren.sqf"],"BIS_fnc_execVM",true,false,false] call BIS_fnc_MP; _vehicle setVariable ["siren", true, true]; }; }; }; if (_ctrl) then { _vehicle = (vehicle player); if (isNil {_vehicle getVariable "EmergencyVeh"}) then { _vehicle setVariable ["EmergencyVeh", false, true]; }; _ComVeh = _vehicle getVariable "EmergencyVeh"; if (vehicle player != player && (driver _vehicle == player && _ComVeh isEqualTo true)) then { [[[_vehicle],"scripts\yelp.sqf"],"BIS_fnc_execVM",true,false,false] call BIS_fnc_MP; }; }; }; Create a folder called scripts. Inside this folder create a file called siren.sqf and put the following code into it: Private ["_vehicle"]; _vehicle = _this select 0; _repeat = true; while{ (alive _vehicle) && (_repeat isEqualTo true)} do { _vehicle say3D "Siren"; sleep 5.5; _repeat = _vehicle getVariable "Siren"; }; Inside the folder scripts create a file called yelp.sqf and put the following code into it: Private ["_vehicle"]; _vehicle = _this select 0; _vehicle say3D "Yelp"; Thats it! As always, if you have any questions feel free to ask! Cheers Puffin
  13. This script is best used with a keyhandler, however if you have a bit of experience with coding you can get it also work with addaction. This script works in MP ******************************** Put the following code in your keyhandler: case 38: {//L key if (_shift) then { _vehicle = (vehicle player); if (isNil {_vehicle getVariable "EmergencyVeh"}) then { _vehicle setVariable ["EmergencyVeh", false, true]; }; _ComVeh = _vehicle getVariable "EmergencyVeh"; if (vehicle player != player && (driver _vehicle == player && _ComVeh isEqualTo true)) then { if (isNil {_vehicle getVariable "lights"}) then { _vehicle setVariable ["lights", false, true]; }; _LightState = _vehicle getVariable "lights"; if (_LightState isEqualTo true) then { _vehicle setVariable ["lights", false, true]; } else { [[[_vehicle],"scripts\light.sqf"],"BIS_fnc_execVM",true,false,false] call BIS_fnc_MP; _vehicle setVariable ["lights", true, true]; }; }; }; }; Create a folder called scripts. Inside this folder create a file called light.sqf and put the following code into it: Private ["_vehicle","_lightRed","_lightBlue","_lightleft","_lightright","_leftRed"]; _vehicle = _this select 0; if(isNil "_vehicle" OR isNull _vehicle) exitWith {}; _lightRed = [20, 0.1, 0.1]; _lightBlue = [0.1, 0.1, 20]; _lightleft = "#lightpoint" createVehicle getpos _vehicle; sleep 0.2; _lightleft setLightColor _lightRed; _lightleft setLightBrightness 0.2; _lightleft setLightAmbient [0.1,0.1,1]; switch (typeOf _vehicle) do { case "C_Offroad_01_F": { _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]]; }; case "B_MRAP_01_F": { _lightleft lightAttachObject [_vehicle, [-0.8, -0.90, 0.6]]; }; case "C_SUV_01_F": { _lightleft lightAttachObject [_vehicle, [1.1,0.4,-0.05]]; }; case "I_Heli_light_03_unarmed_F": { _lightleft lightAttachObject [_vehicle, [1.23, 4.7, -1.42]]; }; case "B_Heli_Light_01_F": { _lightleft lightAttachObject [_vehicle, [-0.75, 1.7, -0.95]]; }; case "C_Hatchback_01_sport_F": { _lightleft lightAttachObject [_vehicle, [0.62, 1.87, -0.52]]; }; case "C_Offroad_02_unarmed_F": { _lightleft lightAttachObject [_vehicle, [0.62, 1.87, -0.52]]; }; case "O_MRAP_02_F": { _lightleft lightAttachObject [_vehicle, [-0.8, -0.90, 0.6]]; }; case "B_APC_Wheeled_01_cannon_F": { _lightleft lightAttachObject [_vehicle, [-0.8, -0.90, 0.6]]; }; case "B_Heli_Transport_01_F": { _lightleft lightAttachObject [_vehicle, [1.23, 4.7, -1.42]]; }; }; _lightleft setLightAttenuation [0.181, 0, 1000, 130]; _lightleft setLightIntensity 10; _lightleft setLightFlareSize 0.38; _lightleft setLightFlareMaxDistance 150; _lightleft setLightUseFlare true; _lightright = "#lightpoint" createVehicle getpos _vehicle; sleep 0.2; _lightright setLightColor _lightBlue; _lightright setLightBrightness 0.2; _lightright setLightAmbient [0.1,0.1,1]; switch (typeOf _vehicle) do { case "C_Offroad_01_F": { _lightright lightAttachObject [_vehicle, [0.37, 0.0, 0.56]]; }; case "B_MRAP_01_F": { _lightright lightAttachObject [_vehicle, [0.8, -0.90, 0.6]]; }; case "C_SUV_01_F": { _lightright lightAttachObject [_vehicle, [-1.1,0.4,-0.05]]; }; case "I_Heli_light_03_unarmed_F": { _lightright lightAttachObject [_vehicle, [-1, 3.2, -2]]; }; case "B_Heli_Light_01_F": { _lightright lightAttachObject [_vehicle, [0.75, 1.7, -0.95]]; }; case "C_Hatchback_01_sport_F": { _lightright lightAttachObject [_vehicle, [-0.62, 1.87, -0.52]]; }; case "C_Offroad_02_unarmed_F": { _lightright lightAttachObject [_vehicle, [0.37, 0.0, 0.56]]; }; case "O_MRAP_02_F": { _lightright lightAttachObject [_vehicle, [0.8, -0.90, 0.6]]; }; case "B_APC_Wheeled_01_cannon_F": { _lightright lightAttachObject [_vehicle, [0.8, -0.90, 0.6]]; }; case "B_Heli_Transport_01_F": { _lightright lightAttachObject [_vehicle, [-1, 3.2, -2]]; }; }; _lightright setLightAttenuation [0.181, 0, 1000, 130]; _lightright setLightIntensity 10; _lightright setLightFlareSize 0.38; _lightright setLightFlareMaxDistance 150; _lightright setLightUseFlare true; _lightleft setLightDayLight true; _lightright setLightDayLight true; _transitionState = sunOrMoon; _brightness = 0; _repeat = true; if (_transitionState < 1) then { _brightness = 2; } else { _brightness = 50; }; _leftRed = true; while{ (alive _vehicle) && (_repeat isEqualTo true)} do { if(_leftRed) then { _leftRed = false; _lightright setLightBrightness 0.0; sleep 0.05; _lightleft setLightBrightness _brightness; } else { _leftRed = true; _lightleft setLightBrightness 0.0; sleep 0.05; _lightright setLightBrightness _brightness; }; sleep 0.05; _repeat = _vehicle getVariable "lights"; }; deleteVehicle _lightleft; deleteVehicle _lightright; You can remove any vehicles you don't need or add some. Just remember that you have to add them twice (for the left and the right light). Now you can place a vehicle in the editor and put the following in the init box: this setVariable ["EmergencyVeh", true, true]; Only vehicles with this variable can activate the lights. As always, if you have any questions feel free to ask! Cheers Puffin
  14. I have one more suggestion: Mark brackets wich belong together like notepad ++ does it. For example if (whatever) then { script; more_script; };
×