Author Topic: [RequestHelp] Removing backpack contents.  (Read 1483 times)

0 Members and 1 Guest are viewing this topic.

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
[RequestHelp] Removing backpack contents.
« 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! :)
« Last Edit: June 26, 2012, 08:13:08 am by KaosNye »

Allonsy

  • Relentless Teamkiller
  • **
  • Posts: 95
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #1 on: June 26, 2012, 08:13:47 am »
Isnt addWeapon easily detected by BE?

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #2 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.

Allonsy

  • Relentless Teamkiller
  • **
  • Posts: 95
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #3 on: June 26, 2012, 08:21:27 am »
Oh i see.
Sorry.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #4 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.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

s0beit

  • Relentless Teamkiller
  • **
  • Posts: 94
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #5 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.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #6 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.



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.

« Last Edit: June 26, 2012, 04:05:53 pm by MrMedic »
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
Re: [RequestHelp] Removing backpack contents.
« Reply #7 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.