OK so some things from the testing:
1st. It does work, I gave the test player a 10 round ww2 stock colt45, after 10 rounds the gun is depleted and clicks as it should, however the plrusingreload fails to trigger the giveplrweapon command so currently my way doesnt work automatically.
What I did manage to get working though, was to map a scancodekeypressed command to the R key, so a manual reload will In fact trigger the giveplr weapon command
2.As far as I know it requires an example of the weapon to exist physically in the level (spawn somewher the player cant get to ideally) or the weapon doesnt get given
So basically as it stands right now, there is a solution but it will take some effort to get the rough edges smoothed out.
3.As the trigger to give the player the second weapon is linked to the R key, if the player presses R repeatedly they give themselves an unlimited amount of ammo if they want, they still have to reload at the end of each clip though so you could use this to your advantage.
So basically if you want to test it do this:
Created a blank room ( i used hangar prefab) place a player start marker, right click and assign the player the ww2\colt45 using the player start marker options. set ammo quantity to 1 (this denotes the number of magazines for that weapon the player will be given)
Place an actual colt45 item from ww2 entities somewhere outside the room (the roof maybe so it doesnt fall out the map). right click on it and set the reload quantity to 10 ( so it reloads every 10 rounds)
Place a ww2 wall furniture sign down, set it to dynamic,always active and put this in its main
:state=0,scancodekeypressed=19:giveplrweapon=ww2\colt45
Fire off all 10 rounds, you will get the empty click, fire a few more times to confirm this, then hit R (making sure ur not holding any other keys, fpsc doesnt like recognising scancodekeys if your moving around using wasd etc) your weapon will now magically have another 10 rounds!
Repeat over and over and over again til your satisfied Ive solved your problem
Few things, sometimes it just gives you the ammo straight into your gun and doesnt trigger a reload, so you might want to tweak the code to play the reload animation everytime the player receives a new clip, and probably try and link the scancodekey=19 condition to an ammo condition so the player cant spam the R key over and over, not that this would really hurt as the way its set up, even if they did this, the gun would still reload every 10 rounds regardless of how much ammo the player accumulates, so you could try and figure out how long it takes to fire off the entire magazine, say 8 seconds, then script the giveplrweapon command, to happen every 7 seconds so the player ALWAYS has ammo.
It just doesnt strike me as needing to be as complicated as involving variables, the player is always reloading, the action needs to centre around the reload action itself, as long as the weapon is reloading every 10 rounds and never runs out of ammo, does it really matter if its complicated variable based or just based on the fact that theres a constant trigger here we can use, regardless of the variable, admittedly its a very low tech solution compared to checking and monitoring the players ammo count but it works at least
Alternatively set the ammo quantity in the player start marker to 9999 (as far as i can tell this defines the number of reloads you get, the reload quantity option in the weapon determines the number of rounds fired before a reload so to control how often the player reloads, spawn a copy of the weapon the player will be using in the leve, and edit its properties to set the properties of how and when the players weapon will reload)
So you could give the player a colt 45 via start marker, set the ammo quantity to 99999, then place an item variant in the level, right click on the item, and use its properties to set the RELOAD quantity to 10, then the player should reload every 10 rounds, but have access to 99999 reloads.
As far as i can tell this only works if you spawn a copy of the weapon you are giving the player, somewhere in the level and manually edit ITS properties to act as a control for the weapon the player is using.
Seems weird but thats how its working out for me during testing.
Which it seems like it shouldnt, but if it works it works
Hope this helps
smoke em if you got em