Here is the info i obtained from my research on the mater.
Copy
Creating Hacked/Infi Mags
To create hacked / Infi-mags, you have to either call the function itself, or remove the
isServerOwner check from the function. Also the funny thing about this script, is that it is not in any other arma game, and is very visible in the dayz source code.
In both methods, you will need to find the script function first, seen in this image:
https://gyazo.com/0ff538c6ab797e67c773eeeea6edf6bc
Method 1, Using it as a Script.
- Hook the function and remove the isServerOwner check, just hooking it will not work and will make this only local. Setting yourself as the serverowner
will block all client->server messages. This is because you are setting yourself as the server so your client is sending the messages to yourself.
Here is the isServerCheck in this image:
https://gyazo.com/16c17170f3184cfda80b0c55a1c606db
- Go to the following PBO: weapon_magazines.pbo
and set the max amount of ammo each type of mag may hold
- Go in game and execute setMagazineAmmo 1, which will set the mag to the max value, if you do not follow step 2, the mag will just be refiled. If you are a scripts, just create a script to set all mags around you to max, i do know scripting so i do not do this method.
Method 2, Calling the actual function through memory
- You will have to find the actual function in IDA, which will be under __RTDynamicCast which
is way down within the script function. As this is the same as the DayZ 0.45 Source code.
Here is an image of the actual function setting the mag's ammo:
https://gyazo.com/dbb72480e9f716f5341b98f6231d78b1
- You will need to go within the function and grab the arguments
This is an image of the function decompiled in IDA
https://gyazo.com/f1a342fa3d970742d16a59d88e712525
- Next you will need to create your function, i just did:
Code:
// 0x6CABB0 is the address of the actual function in the immage above class Magazine { public: void setAmmo (float amount) { typedef void(__thiscall *tSetMagAmmo)(Magazine*, float); tSetMagAmmo oSetMagAmmo = (tFunction)(0x6CABB0); oSetMagAmmo(this, amount); }; };
- You will need to write a way to grab your current magazine, or make it find all the magazines in your area.
usage of that class
Code:
Magazine* myMag = CameraOn()->GetCurrentMag(); myMag->setAmmo(99999999);
And thats how you make hacked mags in DayZ
--------------------------------------
paste