Topic Rating
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Coding, Arma2] DayZ scripting lesson #1, How to hack
10-03-2015, 04:42 AM
Post: #1
[Coding, Arma2] DayZ scripting lesson #1, How to hack
Hello guys! Today I will be showing you how to write scripts for arma 2 so you can follow up with my other lessons and hopefully get down to making your own hack menu.


First, we will discuss on how to find what script commands we need.
[spoiler]
I highly suggest starting by downloading notepad++ if you have not done this yet. It can be found here.

Notepad++ is a powerful tool that you can use for scripting and coding. It includes various syntax highlighting setups so you can keep up more on what you write etc. I usually set it to C++ when working with .sqf scripting.
Once notepad is installed, create a new document. Make sure that you save it as a .sqf and NOT a .cpp or anything else if you use syntax highlighting.




So first, find arma's resources for scripting: https://community.bistudio.com/wiki/Cate...ands_ArmA2

Every scripts in the game is found there. You can then use your starting idea to find what scripts you should use to achieve X goal. For example, let's say we want to add an AKM to our inventory.
We can find the addweapon scripting command on arma's resources page, and then read on how to use it, what parameters we need to use, etc.

For this example, here is the code:

Code:
player addweapon "AK_47_M";

player is us. It is the unit to which you need to add the weapon to.
addweapon is the script command
"AK_47_M" is the parameter we pass on to the script, in this case, the classname of the AKM. Search on google for the full list of classnames of each mod you want to script on.

***Do not forget to add a ";" at the end of your line!***
[/spoiler]



So you see, this is pretty simple. Now, let's push it to another level...
[spoiler]

So, now that we know how to add weapons and magazines (search it in the script commands, it is as easy), we will create a loadout script.


Using our commands from step 1, we will add magazines and a secondary weapon, as well as clear old inventory.

Code:
hint format["Deleting old gear to spawn new..."];         //Hint the player              

removeAllWeapons player;      //Remove all weapons
removeAllItems player;         //Remove items, tools, etc.
removebackpack player;         //This will remove the backpack of the player

player addBackPack "DZ_ALICE_Pack_EP1";    //Spawn backpack with said classname

player addweapon "AK_47_M";    //Our step 1 command
player selectWeapon "AK_47_M";   //This makes the player take the AKM in his hands
player addMagazine '30Rnd_762x39_AK47';    //mags
player addMagazine '30Rnd_762x39_AK47';
player addMagazine '30Rnd_762x39_AK47';
player addMagazine '30Rnd_762x39_AK47';
player addMagazine '30Rnd_762x39_AK47';
player addMagazine '30Rnd_762x39_AK47';

player addweapon "Colt1911";   //add a pistol
player addMagazine "7Rnd_45ACP_1911";
player addMagazine "7Rnd_45ACP_1911";
player addMagazine "7Rnd_45ACP_1911";
player addMagazine "7Rnd_45ACP_1911";
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';  //Most items but tool belt items are classified as magazine. Look it up ;)
player addMagazine 'ItemBandage';
player addMagazine 'ItemBandage';

player addWeapon 'Binocular';  //As I said, tool belt items are *weapons*
player addWeapon 'ItemCompass';
player addWeapon 'ItemMap';
player addWeapon 'ItemWatch';
player addWeapon 'ItemHatchet';
player addWeapon 'ItemKnife';
player addWeapon 'Itemmatchbox';
player addWeapon 'Itemtoolbox';
player addWeapon 'ItemFlashlight';

reload player;   //makes the player reload.



[/spoiler]



Here you go guys! Hope you enjoyed my small tut and see you for the next !

I sell GFXs, hacks, viruses to troll or fu** up people, keyloggers and cheap DDOS services.
Selling DayZ scripts, Android RATs and more.
Add me on skype: fewii.seller

[Image: Vg2zSYF.jpg]
Quote



Forum Jump:
Options +


User(s) browsing this thread: 3 Guest(s)

About Hack Bulletin

Hackbulletin.com is a friendly hack forums to learn and share knowledge. Whether you are a pro or just someone dabbling you can always learn more.

Don't be afraid to join and chat!

 

Links