et.gentity_set? Explain Please :)


(mi$i3k:]) #21

Still dunno how to make it permanent change >.>


(Soak) #22

Right - I must have misread something. I can think of two ways to do this, each with their own problems.

  1. This solution depends on all the players ingame binding a special command to their regular reload key. You would then hook this special command - “specialreload” for example - and then move 30 bullets from their ps.ammo to their ps.ammoclip. This method would only really work for clan events and even then it is somewhat sketchy. This will have a negligible impact on server performance though.

  2. Hook et.RunFrame, and every 200 frames, check every player’s clip and see if it contains 30 rounds. If so, move 30 bullets from their ps.ammo to their ps.ammoclip. Will this have an impact on server performance, but it is hard to know until you actually try it. Also, players will have to wait 0.2 - 0.5 secs before getting their extra ammo. You could try lowering this, but doing so will increase server lag.

With both of these methods you will also have to do some basic ammo checking to make sure clients have enough ammo to fully reload. The logic should be:

  1. needed bullets = (60 - current bullets in ps.ammoclip)
  2. Add the min(needed bullets, bullets in ps.ammo) to ps.ammoclip, and subtract it from ps.ammo

No if statements needed =)

Soak

P.S. Note that both of these methods are very hackish - if you are looking to build a fun mode, I would try something else.


(mi$i3k:]) #23

I tried option 2, but it just give you ‘noreload’ cheat in some way… because when u change player’s clip to 60 rounds it says that its 60, when it goes down to 30 it checks player’s reserve ammo and if its high enough it changes player’s clip back to 60 without reloading. So it wont work, i might use first option but i have no idea how to execute reload action to make specialreload.