ARZUMATA

Spawning Bike/QuadBike etc.

66 posts in this topic

It's working fine guys make sure you choose ground spawn tho or change back pack to parachute script restriction 23 i think this will give you a custom loadout and spawn a quad

mpmissions/your.pbo/init.sqf

//TO BE USED ONLY ON SERVER
if (isServer) then {
	"do_MakeBike" addPublicVariableEventHandler {
		_parameters = (_this select 1);
		_parameters2  =(_parameters select 1);
		diag_log format ["createVehicleRequested %1 ", _parameters]; // YOU NEED THIS FOR LOGS TO SEE WHO DID IT
		veh = createVehicle["Exile_Bike_QuadBike_Nato", _parameters2 , [] ,0 , "NONE"];
	};
};

mpmissions/your.pbo/spawn_bike.sqf

if !((vehicle player) isEqualTo player) exitWith {}; //MAKE SURE WE ARE ON FEET

//We check if we have money for that
if (ExileClientPlayerMoney > 0) then {
    titleText ["", "PLAIN DOWN"];
    player playActionNow "Medic"; //ANIMATED DELAY
    player removeAction DeployBikeAction; //REMOVE TO LET PLAYER SPAWN BIKES DURING THE PLAY
    _spawnPos = player modelToWorld [0,2,0];
    _spawnDir = (getDir player) -90;
    do_MakeBike = [player, _spawnPos, _spawnDir];
    ExileClientPlayerMoney = ExileClientPlayerMoney - 0; //REMOVE THE MONEY
    uiSleep 3;
    publicVariableServer "do_MakeBike"; //HEY SERVER GIVE ME A BIKE
    uiSleep 1;
     ['You crafted a temporary quad',0,0.7,2,0] spawn bis_fnc_dynamictext;

mpmissions/your.pbo/startingloadout.sqf

uiSleep 2;
if (ExileClientPlayerMoney > 0) then {
        uiSleep 1;
		hint "Gear Supplied"; 
		clearWeaponCargo player;
		clearMagazineCargo player;
		removeBackpackGlobal player;
		player forceAddUniform "Exile_Uniform_ExileCustoms";
		player addBackpack "B_Carryall_oucamo";
		player addVest "V_TacVest_blk_POLICE";
		player addWeapon "ItemRadio";
		player addWeapon "ItemGPS";
		player addWeapon 'Exile_Item_XM8';
		player addWeapon "ItemCompass";
		player addWeapon "Rangefinder";
		player addItemToBackpack "Exile_Item_BBQSandwich_Cooked";
		player addItemToBackpack "Exile_Item_Energydrink";
		player addItemToBackpack "Exile_Item_InstaDoc";
		player addItemToBackpack "hgun_Rook40_F";
		player addItemToBackpack "U_O_OfficerUniform_ocamo";
		player addItemToVest "16Rnd_9x21_Mag";
};

edit config.cpp

class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/
	ExileClient_object_player_bambiStateBegin = "ExileClient_object_player_bambiStateBegin.sqf";
};

put ExileClient_object_player_bambiStateBegin.sqf from exile client to your mpmission folder and edit it

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_duration"];
disableSerialization;
_duration = _this;
ExileClientPlayerIsBambi = true;
ExileClientPlayerBambiStateExpiresAt = time + _duration; 
true call ExileClient_gui_hud_toggleBambiIcon;
execVM "startingloadout.sqf";
DeployBikeAction = player addaction [("<t color=""#00CF11"">" + ("Spawn Bike") +"</t>"),"spawn_bike.sqf","",-97,false,false,"",""]; //THIS IS WHAT HAS BEEN ADDED
ExileClientEndBambiStateThread = [_duration, ExileClient_object_player_bambiStateEnd, [], true] call ExileClient_system_thread_addTask;
true

 

Edited by Redcloud78
corrected 'rangefinder' to "Rangefinder"

Share this post


Link to post
Share on other sites
Advertisement

It' could be the backpack spawning rando things change it back to (steerable parachute(search exile item classes) or to a different backpack and what do you mean by random things like these?

Exile_Uniform_ExileCustoms,
B_Carryall_oucamo
V_TacVest_blk_POLICE 
hgun_Rook40_F etc..

And to properly test if it's working be sure to re-enter Bambi mode

Edited by Redcloud78

Share this post


Link to post
Share on other sites

no not like that its spawns building and shit in the server when i look some where there spawns random stuff everwhere and  everthing is glitching

Share this post


Link to post
Share on other sites

I can't get it to work, I get the scroll menu options "Spawn Bike" but when clicked on, nothing happens :-( 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.