Jump to content
AmaZiinG

[Tutorial] Blow up vehicles for the 4.4 R3

Recommended Posts

 

Autor: Saturin78

Edit: AmaZiinG and Iam_Nico

 

1. Create a new SQF called  fn_carC4.sqf:

/*
	Author: Saturin78
	Description:
	Mit dieser Datei werden Sprengladungen an Fahrzeuge gepackt und nach 4 Minuten gesprengt!	
	Edited by Iam_Nico and AmaZiinG
*/
private["_vault","_handle","_carc4"];
_vault = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
if(isNull _vault) exitWith {}; //Bad object
if(!(_vault isKindOf "AllVehicles")) exitWith {hint "Du kannst den Fahrzeugsprengsatz hier nicht anbringen!"};
if(player distance _vault > 7) exitWith {hint "Du musst dich näher an das Fahrzeug stellen!"};
if(!([false,"carC4",1] call life_fnc_handleInv)) exitWith {}; //Error?
closeDialog 0;
life_action_inUse = true;
player playMove "AinvPknlMstpSnonWnonDnon_medic_1";
sleep 4;
life_action_inUse = false;
if(player distance _vault > 7) exitWith {titleText["Du bist nicht in der Nähe eines Fahrzeugs!","PLAIN"];};
titleText["Du hast den Fahrzeugsprengsatz an diesem Fahrzeug angebracht.","PLAIN"];
sleep 10;
_vault setVariable["chargeplaced",true,true];
titleText ["Sprengung in 4 Minuten, bitte abstand halten!","PLAIN"];
sleep 60;
titleText ["Sprengung in 3 Minuten, bitte abstand halten!","PLAIN"];
sleep 60;
titleText ["Sprengung in 2 Minuten, bitte abstand halten!","PLAIN"];
sleep 60;
titleText ["Sprengung in 1 Minute, bitte abstand halten!","PLAIN"];
sleep 30;
titleText ["Sprengung in 30 Sekunden, bitte abstand halten!","PLAIN"];
sleep 20;
[player,"carC4"] call life_fnc_globalSound;
titleText ["Sprengung in 10 Sekunden, bitte abstand halten!","PLAIN"];
sleep 10;
_carc4 = "Bo_Mk82" createVehicle [0,0,9999];
_carc4 setPos (getPos _vault);
_carc4 setVelocity [100,0,0];
titleText ["Fahrzeug gesprengt!","PLAIN"];
[0,format["%1 hat ein Fahrzeug in die Luft gesprengt.",name player]] remoteExec ["life_fnc_broadcast",0];

2. Now search the fn_useItem.sqf copie this insert:

case (_item isEqualTo "carC4"): {
 [cursorTarget] spawn life_fnc_carC4;
};

3. Go in the Config_vItems.hpp and add this: 

class carC4 {
        variable = "carC4";
        displayName = "STR_Item_carC4";
        weight = 1;
        buyPrice = 200000;
        sellPrice = 1000;
        illegal = true;
        edible = -1;
        icon = "";
    };

if there problems is it writes under the post 

Link to post
Share on other sites
On 10/8/2016 at 6:18 PM, AmaZiinG said:

/* Author: Saturin78 Description: Mit dieser Datei werden Sprengladungen an Fahrzeuge gepackt und nach 4 Minuten gesprengt! Edited by Iam_Nico and AmaZiinG */ private["_vault","_handle","_carc4"]; _vault = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; if(isNull _vault) exitWith {}; //Bad object if(!(_vault isKindOf "AllVehicles")) exitWith {hint "Du kannst den Fahrzeugsprengsatz hier nicht anbringen!"}; if(player distance _vault > 7) exitWith {hint "Du musst dich näher an das Fahrzeug stellen!"}; if(!([false,"carC4",1] call life_fnc_handleInv)) exitWith {}; //Error? closeDialog 0; life_action_inUse = true; player playMove "AinvPknlMstpSnonWnonDnon_medic_1"; sleep 4; life_action_inUse = false; if(player distance _vault > 7) exitWith {titleText["Du bist nicht in der Nähe eines Fahrzeugs!","PLAIN"];}; titleText["Du hast den Fahrzeugsprengsatz an diesem Fahrzeug angebracht.","PLAIN"]; sleep 10; _vault setVariable["chargeplaced",true,true]; titleText ["Sprengung in 4 Minuten, bitte abstand halten!","PLAIN"]; sleep 60; titleText ["Sprengung in 3 Minuten, bitte abstand halten!","PLAIN"]; sleep 60; titleText ["Sprengung in 2 Minuten, bitte abstand halten!","PLAIN"]; sleep 60; titleText ["Sprengung in 1 Minute, bitte abstand halten!","PLAIN"]; sleep 30; titleText ["Sprengung in 30 Sekunden, bitte abstand halten!","PLAIN"]; sleep 20; [player,"carC4"] call life_fnc_globalSound; titleText ["Sprengung in 10 Sekunden, bitte abstand halten!","PLAIN"]; sleep 10; _carc4 = "Bo_Mk82" createVehicle [0,0,9999]; _carc4 setPos (getPos _vault); _carc4 setVelocity [100,0,0]; titleText ["Fahrzeug gesprengt!","PLAIN"]; [0,format["%1 hat ein Fahrzeug in die Luft gesprengt.",name player]] remoteExec ["life_fnc_broadcast",0];

 

 

English Translation

/*
	Author: Saturin78
	Description:
	Mit dieser Datei werden Sprengladungen an Fahrzeuge gepackt und nach 4 Minuten gesprengt!	
	Edited by Iam_Nico and AmaZiinG
*/
private["_vault", "_handle", "_carc4"];
_vault = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_param;
if(isNull _vault) exitWith
{}; //Bad object
if(!(_vault isKindOf "AllVehicles")) exitWith
{
	hint "You can not attach the car bomb here!"
};
if(player distance _vault > 7) exitWith
{
	hint "You have to put it closer to the vehicle!"
};
if(!([false, "carC4", 1] call life_fnc_handleInv)) exitWith
{}; //Error?
closeDialog 0;
life_action_inUse = true;
player playMove "AinvPknlMstpSnonWnonDnon_medic_1";
sleep 4;
life_action_inUse = false;
if(player distance _vault > 7) exitWith
{
	titleText["You are not near a vehicle!", "PLAIN"];
};
titleText["You have mounted the car bomb on the vehicle.", "PLAIN"];
sleep 10;
_vault setVariable["chargeplaced", true, true];
titleText["blowing up in 4 minutes, please Keep distance!", "PLAIN"];
sleep 60;
titleText["blowing up in 3 Minuten, please Keep distance!", "PLAIN"];
sleep 60;
titleText["blowing up in 2 Minuten, please Keep distance!", "PLAIN"];
sleep 60;
titleText["blowing up in 1 Minute, please Keep distance!", "PLAIN"];
sleep 30;
titleText["blowing up in 30 seconds, please Keep distance!", "PLAIN"];
sleep 20;
[player, "carC4"] call life_fnc_globalSound;
titleText["blowing up in 10 seconds, please Keep distance!", "PLAIN"];
sleep 10;
_carc4 = "Bo_Mk82"
createVehicle[0, 0, 9999];
_carc4 setPos(getPos _vault);
_carc4 setVelocity[100, 0, 0];
titleText["Fahrzeug gesprengt!", "PLAIN"];
[0, format["%1 has blown up a vehicle .", name player]] remoteExec["life_fnc_broadcast", 0];

 

 

Link to post
Share on other sites

Nevermind, my bad. It seems to be in conflict with another script I put before this, I deleted that script and works how it should be. By the way, In wich store can I find the bomb? Thank you and fantastic job mate!

 

EDIT: I put it in my rebel market but appears with no name, i spawned a car and when I select the item and click use nothing happens, same with the mouse wheel, nothing appears.

Edited by MAE MIA PITICLI
Link to post
Share on other sites
On 1/29/2017 at 11:52 PM, Elite IV | XtGCommunity said:

You need to define the name of the items in your stringtable.xml

 

 

On 1/24/2017 at 7:09 AM, MAE MIA PITICLI said:

I found what is missing, it's the string on Functions.hpp. You have to put in class Actions: class carC4 {};    and then it works. Still is missing the name on the market. Cheers!

 

Add this to the bottom of your stringable.xml

 

        <Key ID ="STR_Item_carC4">
            <Original>Car Bomb</Original>        
        </Key>

 

What it should look like (example):

        <Key ID ="STR_ITEM_NAME">              
            <Original>NAME</Original>        
        </Key>    <---------------------------------------------------- Add it below the last one you have.
        <Key ID ="STR_Item_carC4"> <--------------------------- This is what you add
            <Original>Car Bomb</Original>        
        </Key>

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.