Reload of Weapons!!!
#1

Hello Peoples,

Is it possibile that the players must reload her weapons and not only change them 2 times?

Please help.

mfg Marcel
Reply
#2

Most people will say thats impossible, but yep, thats indeed possible. [ame]http://www.youtube.com/watch?v=e1hQEVd1Ze8[/ame]
Though its quite hard, i did it with completely serversided weapons, but thats not neccessary. Im not going to reveal my code, its way too long to post here anyways.
Basically you need a way to detect when a player is shooting. You can e.g. do that with GetPlayerAmmo in OnPlayerUpdate to see how many shots a player fired. With that you can calculate how much ammo is left in a gun (by subtracting it from the weapons default clip size). Also in OnPlayerUpdate you can detect when a player switches his weapon, then store the remaining ammo of the last weapon, and apply the ammo for the new weapon. This might be the most difficult part. You could reduce the total ammo for that gun to the ammo for a single clip for example, and add new ammo on every weapon reload.

An alternative would be just giving a player a single clip of amunition, and never more. Then detect when hes out of ammo in OnPlayerUpdate and add the next clip to his ammo, until a variable containing the total left ammo is empty.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)