TKC-Community

Hacking and Art => Armed Assault 3 => Armed Assault 2 => Topic started by: KaosNye on June 26, 2012, 08:05:25 am

Title: [RequestHelp] Removing backpack contents.
Post by: KaosNye on June 26, 2012, 08:05:25 am
Hey, sorry to post another thread so soon, however the last thread was very informative and helpful.

However, I have stumbled in a hole, and I require help to get out of it.

I've been working on a script that will:

1) Clear out my inventory
2) Spawn a preset load out

I will post it so you can see what I've done so far. (And if you can suggest better ways to improve the code I would appreciate that as well.)

Code: [Select]
// Spawn preset DayZ equipment into inventory
// by KaosNye
// Moday, June 25, 2012
// File: preset1.sqf
//-- -- -----------------------------------------------//



//---------------------------------------------------//
//------------------CLEAN INVENTORY------------------//
//---------------------------------------------------//

// Display hint
_title  = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>CLEANING</t><br/><br/>";
_text   = "your inventory.";
hint parseText (_title + _text);

// Removes all special items
removeAllItems player;

// Remove all weapons
removeAllWeapons player;

// Remove backpack contents **
//clearMagazineCargo ?

// Remove backpack
//removeBackpack player;

sleep 10;

//---------------------------------------------------//
//------------------SPAWN INVENTORY------------------//
//---------------------------------------------------//

// Display hint
_title1  = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>Preset 1</t><br/><br/>";
_text1   = "has been loaded!";
hint parseText (_title1 + _text1);

// Spawn magazine for M14 in loop
// Spawn first to avoid  initial reload
{player addMagazine "20Rnd_762x51_DMR"} forEach [1,2,3,4];

// Spawn a M14 into player inventory
player addWeapon "M14_EP1";

// Spawn magazine for M9SD in loop
// Spawn first to avoid  initial reload
{player addMagazine "15Rnd_9x19_M9SD"} forEach [1,2,3,4];

// Spawn a M9SD into player inventory
player addWeapon "M9SD";

// Spawn the tools/accessories for player
player addWeapon "Binocular_Vector";
player addWeapon "NVGoggles";
player addWeapon "ItemGPS";
player addWeapon "ItemCompass";
player addWeapon "ItemWatch";
player addWeapon "ItemFlashlightRed";
player addWeapon "ItemKnife";
player addWeapon "ItemHatchet";
player addWeapon "ItemMatchbox";
player addWeapon "ItemEtool";
player addWeapon "ItemToolbox";

// Spawn player backpack
player addBackpack "DZ_Backpack_EP1";


The code highlighted in red is the area I am having problems with. I believe this is the right command to use, but I am not sure the correct way to go about it.

The code highlighted in green, is working, but yet again, I am not sure the best way to group them together. I believe it's something like:


Code: [Select]
player addWeapon ["ItemGPS","ItemEtool",etc];



Edit:

//clearMagazineCargo ?

player addWeapon "Binocular_Vector";
player addWeapon "NVGoggles";
player addWeapon "ItemGPS";
player addWeapon "ItemCompass";
player addWeapon "ItemWatch";
player addWeapon "ItemFlashlightRed";
player addWeapon "ItemKnife";
player addWeapon "ItemHatchet";
player addWeapon "ItemMatchbox";
player addWeapon "ItemEtool";
player addWeapon "ItemToolbox";

Again, thanks for the help! :)
Title: Re: [RequestHelp] Removing backpack contents.
Post by: Allonsy on June 26, 2012, 08:13:47 am
Isnt addWeapon easily detected by BE?
Title: Re: [RequestHelp] Removing backpack contents.
Post by: KaosNye on June 26, 2012, 08:16:34 am
Yes, probably, however I am doing this in a private situation, with no BI.

Short story: I'm playing private server.
Title: Re: [RequestHelp] Removing backpack contents.
Post by: Allonsy on June 26, 2012, 08:21:27 am
Oh i see.
Sorry.
Title: Re: [RequestHelp] Removing backpack contents.
Post by: MrMedic on June 26, 2012, 12:59:36 pm
Yes, probably, however I am doing this in a private situation, with no BI.

Short story: I'm playing private server.

RemoveAllWeapons player.
Title: Re: [RequestHelp] Removing backpack contents.
Post by: s0beit on June 26, 2012, 02:17:18 pm
Yes, probably, however I am doing this in a private situation, with no BI.

Short story: I'm playing private server.

RemoveAllWeapons player.

That's for his gear, not his backpack though isn't it?

Though it really should clear out his backpack when the old backpack is gone from his gear and he makes a new one I guess.
Title: Re: [RequestHelp] Removing backpack contents.
Post by: MrMedic on June 26, 2012, 03:20:54 pm
Yes, probably, however I am doing this in a private situation, with no BI.

Short story: I'm playing private server.

RemoveAllWeapons player.

That's for his gear, not his backpack though isn't it?

Though it really should clear out his backpack when the old backpack is gone from his gear and he makes a new one I guess.

in conjunction with 2 other command.

(http://i21.photobucket.com/albums/b270/tonyK1/removeeverything.jpg)

this is the result. im not telling him for 2 reasons 1 its simple to do , 2 if he isnt bypassed then i dont want to see him get banned through copy pasting, when he learns to do it himself then he will know what he is doing.

Title: Re: [RequestHelp] Removing backpack contents.
Post by: KaosNye on June 27, 2012, 03:37:04 am
Yes, probably, however I am doing this in a private situation, with no BI.

Short story: I'm playing private server.

RemoveAllWeapons player.

Hmm, gotcha.

I was doing all the tests for removal independently. Never would have guessed.