xDaVIRUS

Code for Spawning Primary weapon/Ammo

4 posts in this topic

So i can spawn a bambi in, with a Gun and some ammo, how do you get that ammo, to already be in the gun?

Share this post


Link to post
Share on other sites
21 minutes ago, xDaVIRUS said:

So i can spawn a bambi in, with a Gun and some ammo, how do you get that ammo, to already be in the gun?

if you use Exiles loadout it automatically does it, but if you are using a script, you add the gun then the ammo.

Share this post


Link to post
Share on other sites
Advertisement

Seems that when i add a gun, then the type of ammo, it puts the ammo in the uniform, then when you land, it reloads it.

Share this post


Link to post
Share on other sites

Create a file inside your mission file called..

ExileServer_object_player_network_createPlayerRequest.sqf

paste this in there and edit to your liking..

Spoiler

private["_sessionID","_parameters","_requestingPlayer","_spawnLocationMarkerName","_playerUID","_accountData","_bambiPlayer","_cargoType"];
_sessionID = _this select 0;
_parameters = _this select 1;
_requestingPlayer = _sessionID call ExileServer_system_session_getPlayerObject;
_spawnLocationMarkerName = _parameters select 0;
_playerUID = getPlayerUID _requestingPlayer;
_accountData = format["getAccountStats:%1", _playerUID] call ExileServer_system_database_query_selectSingle;
_group = createGroup independent;
_bambiPlayer = _group createUnit ["Exile_Unit_Player", [0,0,0], [], 0, "CAN_COLLIDE"];
_bambiPlayer setVariable ["ExileIsBambi", false];
/////////////////////////////////////////
// RANKS START HERE!!!!!!
/////////////////////////////////////////
_respect = (_accountData select 1);

switch (true) do 
{
  case (_respect > 0 && _respect < 2499):
    {
	_bambiPlayer forceAddUniform "U_C_Poloshirt_blue";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
   };

 case (_respect > 2500 && _respect < 4999):
    {
	_bambiPlayer forceAddUniform "U_BG_Guerilla1_1";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };

 case (_respect > 5000 && _respect < 9999):
   {
	_bambiPlayer forceAddUniform "U_C_Poor_2";
	_bambiPlayer addVest "V_Press_F";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };
 
 case (_respect > 10000 && _respect < 19999):
   {
	_bambiPlayer forceAddUniform "U_B_CombatUniform_mcam";
	_bambiPlayer addBackpack "B_HuntingBackpack";
	_bambiPlayer addVest "V_Rangemaster_belt";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };
   
  case (_respect > 20000 && _respect < 29999):
   {
	_bambiPlayer forceAddUniform "U_Rangemaster";
	_bambiPlayer addBackpack "B_HuntingBackpack";
	_bambiPlayer addHeadgear "CUP_H_BAF_Officer_Beret_PRR_O";
	_bambiPlayer addVest "V_Rangemaster_belt";
	_bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
    _bambiPlayer addMagazine "Exile_Magazine_Swing";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };
 
 case (_respect > 30000 && _respect < 39999):
   {
	_bambiPlayer forceAddUniform "U_B_CTRG_3";
	_bambiPlayer addBackpack "B_HuntingBackpack";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_Rangemaster_belt";
	_bambiPlayer addWeaponGlobal "hgun_mas_glock_F";
    _bambiPlayer addMagazine "16Rnd_9x21_Mag";
	_bambiPlayer addMagazine "16Rnd_9x21_Mag";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };

 case (_respect > 40000 && _respect < 49999):
   {
	_bambiPlayer forceAddUniform "U_O_CombatUniform_oucamo";
	_bambiPlayer addBackpack "B_HuntingBackpack";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_Rangemaster_belt";
	_bambiPlayer addWeaponGlobal "hgun_mas_glock_F";
    _bambiPlayer addMagazine "16Rnd_9x21_Mag";
	_bambiPlayer addMagazine "16Rnd_9x21_Mag";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };

 case (_respect > 50000 && _respect < 69999):
   {
	_bambiPlayer forceAddUniform "U_BG_Guerilla3_1";
	_bambiPlayer addBackpack "B_mas_AssaultPack_mul";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_TacVest_blk";
	_bambiPlayer addWeaponGlobal "CUP_hgun_PB6P9";
    _bambiPlayer addMagazine "CUP_8Rnd_9x18_Makarov_M";
	_bambiPlayer addMagazine "CUP_8Rnd_9x18_Makarov_M";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };

  case (_respect > 70000 && _respect < 89999):
   {
	_bambiPlayer forceAddUniform "Exile_Uniform_Woodland";
	_bambiPlayer addBackpack "B_mas_AssaultPack_mul";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_TacVest_blk";
	_bambiPlayer addWeaponGlobal "hgun_Pistol_heavy_01_F";
    _bambiPlayer addMagazine "11Rnd_45ACP_Mag";
	_bambiPlayer addMagazine "11Rnd_45ACP_Mag";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };

  case (_respect > 90000 && _respect < 129999):
   {
	_bambiPlayer forceAddUniform "U_BG_Guerilla3_1";
	_bambiPlayer addBackpack "B_mas_AssaultPack_mul";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_TacVest_blk";
	_bambiPlayer addWeaponGlobal "CUP_hgun_TaurusTracker455";
    _bambiPlayer addMagazine "CUP_6Rnd_45ACP_M";
	_bambiPlayer addMagazine "CUP_6Rnd_45ACP_M";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };

 case (_respect > 130000 && _respect < 159999):
   {
	_bambiPlayer forceAddUniform "U_B_CombatUniform_mcam";
	_bambiPlayer addBackpack "B_mas_AssaultPack_mul";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_TacVest_blk_POLICE";
	_bambiPlayer addWeaponGlobal "CUP_hgun_MicroUzi";
    _bambiPlayer addMagazine "CUP_30Rnd_9x19_UZI";
	_bambiPlayer addMagazine "CUP_30Rnd_9x19_UZI";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };
   
 case (_respect > 160000 && _respect < 199999):
   {
	_bambiPlayer forceAddUniform "Exile_Uniform_Woodland";
	_bambiPlayer addBackpack "B_OutdoorPack_blk";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_TacVest_blk_POLICE";
	_bambiPlayer addWeaponGlobal "SMG_01_F";
    _bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };
   
 case (_respect > 200000 && _respect < 249999):
   {
	_bambiPlayer forceAddUniform "U_C_Poloshirt_tricolour";
	_bambiPlayer addBackpack "B_OutdoorPack_blk";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_TacVest_blk_POLICE";
	_bambiPlayer addWeaponGlobal "SMG_01_F";
    _bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
   };
   
 case (_respect > 250000 && _respect < 299999):
   {
	_bambiPlayer forceAddUniform "U_B_CombatUniform_mcam";
	_bambiPlayer addBackpack "B_OutdoorPack_blk";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_Chestrig_blk";
	_bambiPlayer addWeaponGlobal "SMG_01_F";
    _bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
	_bambiPlayer addItem "MiniGrenade";

   };

  case (_respect > 300000 && _respect < 349999):
   {
	_bambiPlayer forceAddUniform "U_B_CombatUniform_mcam";
	_bambiPlayer addBackpack "B_AssaultPack_blk";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_Chestrig_blk";
	_bambiPlayer addWeaponGlobal "SMG_01_F";
	_bambiPlayer addPrimaryWeaponItem "CUP_optic_HoloWdl";
    _bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addMagazine "30Rnd_45ACP_Mag_SMG_01";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
	_bambiPlayer addItem "MiniGrenade";
	_bambiPlayer addItem "Exile_Item_InstaDoc";

   };

 case (_respect > 350000 && _respect < 399999):
   {
	_bambiPlayer forceAddUniform "Exile_Uniform_Woodland";
	_bambiPlayer addBackpack "B_AssaultPack_blk";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_Chestrig_blk";
	_bambiPlayer addWeaponGlobal "arifle_mas_mp5sd_ds";
	_bambiPlayer addPrimaryWeaponItem "CUP_optic_HoloWdl";
    _bambiPlayer addMagazine "30Rnd_mas_9x21_Stanag";
	_bambiPlayer addMagazine "30Rnd_mas_9x21_Stanag";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
	_bambiPlayer addItem "MiniGrenade";
	_bambiPlayer addItem "Exile_Item_InstaDoc";
   };
   
 case (_respect > 400000):
   {
	_bambiPlayer forceAddUniform "U_B_CombatUniform_mcam_tshirt";
	_bambiPlayer addBackpack "B_AssaultPack_blk";
	_bambiPlayer addHeadgear "CUP_H_PMC_Cap_PRR_Grey";
	_bambiPlayer addVest "V_Chestrig_blk";
	_bambiPlayer addWeaponGlobal "CUP_srifle_LeeEnfield";
	_bambiPlayer addPrimaryWeaponItem "CUP_optic_HoloWdl";
    _bambiPlayer addMagazine "CUP_10x_303_M";
	_bambiPlayer addMagazine "CUP_10x_303_M";
	_bambiPlayer addItem "Exile_Item_Matches";
	_bambiPlayer addItem "Exile_Item_EnergyDrink";
	_bambiPlayer addItem "Exile_Item_Noodles";
	_bambiPlayer addItem "Exile_Item_Bandage";
	_bambiPlayer addItem "Exile_Item_Vishpirin";
	_bambiPlayer addItem "MiniGrenade";
	_bambiPlayer addItem "Exile_Item_InstaDoc";
   };
    default
    {	
	_bambiPlayer forceAddUniform "Exile_Uniform_BambiOverall";
	};
};
/////////////////////////////////////////
// RANKS END HERE!!!!!!
/////////////////////////////////////////

{
	_cargoType = _x call ExileClient_util_cargo_getType;
	switch (_cargoType) do
	{
		case 1: 	{ _bambiPlayer addItem _x; };
		case 2: 	{ _bambiPlayer addWeaponGlobal _x; };
		case 3: 	{ _bambiPlayer addBackpackGlobal _x; };
		case 4:		{ _bambiPlayer linkItem _x; };
		default 					{ _bambiPlayer addItem _x; };
	};
}
forEach getArray(configFile >> "CfgSettings" >> "BambiSettings" >> "loadOut");
[_sessionID, _requestingPlayer, _spawnLocationMarkerName, _bambiPlayer, _accountData] call ExileServer_object_player_createBambi;

 

Once your done editing that, go into your config.cpp and paste is in there. under cfg custom code..

ExileServer_object_player_network_createPlayerRequest           = "ExileServer_object_player_network_createPlayerRequest.sqf";

hope this helped and i dont know if this will still work i havent used this script in a while

1 person likes this

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.