Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Is there a way to cap weapon ammo?

Author
Message
ScooT9
6
Years of Service
User Offline
Joined: 29th Mar 2017
Playing: Half-Life: WAR
Posted: 25th Feb 2020 21:27
So i was testing my game, and then i noticed that i had 1000 ammo in one of my weapons, i want to cap the weapon ammo capacity to around 200-300.
Is there a way to do that?
hi, i'm a random guy who's making random games with random game engines for random reasons
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 25th Feb 2020 22:24
Scoot9 Well there was a command called " ammomax = x" Not sure if it was ever implemented ???
There are a few easy was of doing this, are you wanting to just max a particular weapons ammo or all of them?
If "all" of the players weapons then use the command $A (player’s total ammo) and when ever you go over set amount
just reduce it.
My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Feb 2020 23:25
@ Scoot9 Just tested the command $CA and it works by limiting the amount of ammo in the current
"clip" for the current weapon being held by player
My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **
Pvt.Dan
6
Years of Service
User Offline
Joined: 24th Jul 2017
Location:
Posted: 27th Feb 2020 05:28
How do you implement that into the weapon?
Medal of Honor
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Feb 2020 10:31 Edited at: 27th Feb 2020 10:32
@ Pvt.Dan Here is the simple test script I used. Note carefully this one ONLY limits the amount
of ammo in the CLIP of current weapon. I'll play with some script tonight to see if I can limit Total ammo.
Attach to a triggerzone, place anywhere in level.

It is set for 5 rounds max in clip, change that number to whatever you need.
I tested on a couple pistols & shotgun and worked fine. If you need to limit a specific weapon, use the
plrcurrentweapon command
My games never have bugs.... they just Explosys's

** WHERES MY YELLOW BUTTON ? **

Login to post a reply

Server time is: 2024-03-29 08:33:11
Your offset time is: 2024-03-29 08:33:11