Scripts / Sell/remove player weapons

Author
Message
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 2nd Sep 2016 09:44
Hi all, ive been trying to work around an issue in Dropzone and have had an idea as to how but need a little help. Is there a way to remove player weapons and ammo and calculate how much the player has? using e.g RemovePlayerWeapons(e) and addplayercash this way i could say add a vendor or even a zone whereas the player when he or she leaves the area has all the weapons bought on that level get removed but is compensated with cash and then the normal weapon could be just added on the no linear start level.. Has anyone done this? Thanks
Intel i5 4950 Quad core 3.3ghz
8gb Ram
Nvidia NVS 315 1gb
and a well fed mouse on a wheel

When Reality is broken. Game designers can fix it and make it more realistic
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 3rd Sep 2016 05:01
Well, this would be complicated, Someone that has an idea of the weapon functions could. You would have to declare what weapon prices are in a table. You would need to get the weapon index. ChangePlayerWeaponID(id) this is one of the many functions dealing with weapons I pulled out of the global script. You would maybe do the same for ammo, and then the shop script would be simple once you have that.
In the shop script you would need to check the players weapons and match the weapons to the table you created before and give the player however much money,
Sorry I can't offer any more info but I have yet to delve into the ammo_pool or weapon functions due to things going on and work, I had to pause my scripting.
Markchapman10 is my Skype let's have some dev talk.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 3rd Sep 2016 11:52 Edited at: 3rd Sep 2016 11:53
How about setting a global variable for each weapon, start it at 0 when you receive a weapon set it to 1, then on the new level the variable will carry over, you can then use a script to disarm your character and then for each variable that's 1 give you cash and reset the variable to 0

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 3rd Sep 2016 12:43
Thanks guys both ideas here sound interesting, i'll have to have a bash at something that way the player on leaving a dropzone could get some money back for weapons bought in that area, its not imperative but thought it'd or maybe just remove the weapons and have a reward for clearing the map plenty here to think on tho thanks
Intel i5 4950 Quad core 3.3ghz
8gb Ram
Nvidia NVS 315 1gb
and a well fed mouse on a wheel

When Reality is broken. Game designers can fix it and make it more realistic
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 3rd Sep 2016 13:01
Sorry I haven't answered yout private message yet honkey, only got my phone at the moment and for some reason mobile forum doesn't have a send button on private messages for me. I'll check out your demi as soon as I can.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.

Login to post a reply

Server time is: 2024-12-22 22:21:11
Your offset time is: 2024-12-22 22:21:11