I'll check it out tonight if you don't have it solved yet. If you don't have electric cherry, Google it. I think there is a script in it that will solve your problem.
Last Edit: June 26, 2014, 10:03:01 pm by MakeCents
No, Unless, because the player may not reload the weapon through sprinting and change weapons with the variable still set to true, alternatively the player doesn't have enough ammo to reload with which would still keep the variable to true so you'd have to put in several other if's and buts and candy and nuts into it.
I've never check or tried reload checking but if self.is_reloading is an actual variable used to define if the play is reloading or not then you'd wan't to put a check into a flow control that runs all the time to each individual player with a tiiiny little wait within to stop it from going *freezing for 5 seconds so I can return my favourite infinite loop error* and then passing a notify (( `self notify("reloading")` )) when self.is_reloading is set to true. Of coarse there will be a spam of those notifies unless you also add in another variable into the reload checker function with another if statement to control it. With self notify, in other functions you can just use self waittill from there (( `self waittill("reloading")` ))
But like I said, Never tried it, not even sure if that variable self.is_reloading even exists and if not this reply was a gorgeous waste of time.
Since I lost all my work recently and haven't completely re-installed World at War yet, I can't test it out otherwise I would of before posting this.
Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
reloading_monitor() { while(1) { self.reloading = false; self waittill("reload_start"); ammo = self getWeaponAmmoClip(self getCurrentWeapon()); //get their current ammo during the reload, probably 0 self.reloading = true; while(ammo == self getWeaponAmmoClip(self getCurrentWeapon())) //wait for the ammo to change to something other than what we caught during the reload wait 0.00001; } }
Then you can check if(self.reloading) or whatever is appropriate for the function you are using it in.
I use this in UGX Mod and it works perfectly fine.
reloading_monitor() { while(1) { self.reloading = false; self waittill("reload_start"); ammo = self getWeaponAmmoClip(self getCurrentWeapon()); //get their current ammo during the reload, probably 0 self.reloading = true; while(ammo == self getWeaponAmmoClip(self getCurrentWeapon())) //wait for the ammo to change to something other than what we caught during the reload wait 0.00001; } }
Then you can check if(self.reloading) or whatever is appropriate for the function you are using it in.
I remember seeing reload_start/reload_end ,=, Edit: Nevermind no reload_end
Last Edit: June 27, 2014, 02:44:56 am by DidUknowiPwn
This script will set a variable for the player, is_reloading, based on whether or not the player is currently reloading. I had two issues that I could not resolve. getting the sprint binding when it was shift was an issue, so I worked around it, and if you switch weapons too quickly that you end right back at the same weapon, it doesn't register, so I added a 3 second timer to stop if from setting reload true until the next time. I think I accounted for the other stuff that cancels reload though.
I left the print statements in the top code so you can see what it is doing and see that you have the option to do something depending of if the player finishes reloading or not.
You can just thread this in your nazi_zombie_mapname.gsc right above zombie mode