ARZUMATA

Spawning Bike/QuadBike etc.

66 posts in this topic

Thank you so much for the step by step install man, the pop's are now saving to the database without any issue :)

Cheers man, that is very kind of you !!!

 

The menu is still available on scroll if a player has not deployed the bike as a bambi though. The bike will not spawn, but the option still comes up, do you think there is a way to stop this from showing?

Share this post


Link to post
Share on other sites

I'll check when I'm home tonight. Need to put in a waituntil or loop check in the code to wait till the player is no longer a Bambi then remove. Or just use the radio spawn bike code. 

Edited by happydayz

Share this post


Link to post
Share on other sites
Advertisement
16 hours ago, Diddl3s said:

The menu is still available on scroll if a player has not deployed the bike as a bambi though. The bike will not spawn, but the option still comes up, do you think there is a way to stop this from showing?

If you are using the radio spawn bike code, you need to remove all the other code from the start of this post! Only use the code that I have posted above :)

Share this post


Link to post
Share on other sites
On December 6, 2015 at 6:02:07 AM, happydayz said:

Simple.  Just do this: (note you need to download this extra addon of mine if you want to be able to take the poptabs off the player permanently!

 

HOW TO INSTALL:

If your not running any extra addons folders the easiest way to run this is just adding the Enigma_Exile_Custom.pbo to the @ExileServer/Addons path where it will be loaded up automatically. Otherwise place into any addon folderpath that is loaded on the server!

https://github.com/happydayz-enigma/Enigma_Exile_Custom

 

edit config.cpp, you need to override default client function

  Reveal hidden contents


class CfgExileCustomCode 
{
   	ExileClient_gui_inventory_event_onSlotDoubleClick = "ExileClient_gui_inventory_event_onSlotDoubleClick.sqf";
};

 

 

New version of ----  ExileClient_gui_inventory_event_onSlotDoubleClick.sqf

  Reveal hidden contents


/**
 * 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["_control","_itemClassName","_magazine","_configName"];
disableSerialization;
_control = _this select 0;
_itemClassName = "";
switch (ctrlIDC _control) do 
{
	case 610:  { _itemClassName = primaryWeapon player; }; 
	case 620:  { _itemClassName = (primaryWeaponItems player) select 0; }; 
	case 621:  { _itemClassName = (primaryWeaponItems player) select 1; }; 
	case 622:  { _itemClassName = (primaryWeaponItems player) select 2; }; 
	case 641:  { _itemClassName = (primaryWeaponItems player) select 3; }; 
	case 611:  { _itemClassName = secondaryWeapon player; }; 
	case 624:  { _itemClassName = (secondaryWeaponItems player) select 0; }; 
	case 625:  { _itemClassName = (secondaryWeaponItems player) select 1; }; 
	case 626:  { _itemClassName = (secondaryWeaponItems player) select 2; }; 
	case 642:  { _itemClassName = (secondaryWeaponItems player) select 3; }; 
	case 612:  { _itemClassName = handgunWeapon player; }; 
	case 628:  { _itemClassName = (handgunItems player) select 0; }; 
	case 629:  { _itemClassName = (handgunItems player) select 1; }; 
	case 630:  { _itemClassName = (handgunItems player) select 2; }; 
	case 643:  { _itemClassName = (handgunItems player) select 3; }; 
	case 6240: { _itemClassName = headgear player; }; 
	case 6216: { _itemClassName = goggles player; }; 
	case 6217: { _itemClassName = ""; }; 
	case 6238: { _itemClassName = binocular player; }; 
	case 6211: { _itemClassName = ""; }; 
	case 6215: { _itemClassName = ""; }; 
	case 6212: { _itemClassName = ""; }; 
	case 6214: { _itemClassName = ""; [] ExecVM "spawn_bike.sqf"; }; //set path to whereever in mission file you keep spawn_bike.sqf
	case 6213: { _itemClassName = ""; }; 
	case 6331: { _itemClassName = uniform player; }; 
	case 6381: { _itemClassName = vest player; }; 
	case 6191: { _itemClassName = backpack player; }; 
	case 623: 
	{ 
		_magazine = primaryWeaponMagazine player;
		if (count _magazine > 0) then
		{
			_itemClassName = _magazine select 0;
		};
	}; 
	case 627: 
	{ 
		_magazine = secondaryWeaponMagazine player;
		if (count _magazine > 0) then
		{
			_itemClassName = _magazine select 0;
		};
	}; 
	case 631: 
	{ 
		_magazine = handgunMagazine player;
		if (count _magazine > 0) then
		{
			_itemClassName = _magazine select 0;
		};
	}; 
};
if !(_itemClassName isEqualTo "") then
{
	_configName = _itemClassName call ExileClient_util_gear_getConfigNameByClassName;
	[_configName, _itemClassName] call ExileClient_gui_itemDetails_show;
};
true

 

mpmissions/your.pbo/spawn_bike.sqf

  Reveal hidden contents



if !(ExileClientPlayerIsBambi) exitWith {};
if !((vehicle player) isEqualTo player) exitWith {}; 
   if (ExileClientPlayerMoney > 50) then {

    titleText ["", "PLAIN DOWN"];
    player playActionNow "Medic"; 
    _spawnPos = player modelToWorld [0,2,0];
    _spawnDir = (getDir player) -90;
    do_MakeBike = [player, _spawnPos, _spawnDir];
	
			_poptabs = 50;
			_newPoptabs = ExileClientPlayerMoney - _poptabs;
			ENIGMA_UpdateStats = [player,_newPoptabs];
			publicVariableServer "ENIGMA_UpdateStats";
    uiSleep 3;
    publicVariableServer "do_MakeBike"; 
    uiSleep 1;
    ['BIKE DEPLOYED for 50$',0,0.6,2,0] spawn bis_fnc_dynamictext;
};

 

 

mpmissions/your.pbo/init.sqf

  Reveal hidden contents


//TO BE USED ONLY ON SERVER
if (isDedicated || 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_MountainBike", _parameters2 , [] ,0 , "NONE"];
	};
};

 

 

Just remember that they can buy as many bikes as they want as long as they have the money and as long as they are a bambi!

Thanks so much.  You sir deserve a cookie.  

  • Like 1

Share this post


Link to post
Share on other sites

I really appreciate the help with this script happydayz. You have been a massive help for me.

I ended up going with the scroll wheel option because I can imagine the insane amount of abuse with the doubleclick radio option due to the fact that it is unlimited.

It works pretty decent for me.

 

Do you think it is possible to have the script where people with certain UID's can get the spawn for say $100 and the others pay the $1000 ?

Spoiler

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

//We check if we have money for that
if (ExileClientPlayerMoney > 1000) 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];
    
            _poptabs = 1000;
            _newPoptabs = ExileClientPlayerMoney - _poptabs;
            ENIGMA_UpdateStats = [player,_newPoptabs];
            publicVariableServer "ENIGMA_UpdateStats";
    
    uiSleep 3;
    publicVariableServer "do_MakeBike"; //HEY SERVER GIVE ME A BIKE
    uiSleep 1;
    ['QUAD DEPLOYED for $1000. Gone at Restart!',0,0.6,2,0] spawn bis_fnc_dynamictext;
    player removeAction DeployBikeAction;
} else{
    ['You need $1000 to spawn a Quad.',0,0.7,2,0] spawn bis_fnc_dynamictext;
    };

 

Edited by Diddl3s

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.