(For The Specialists)
I tried logging ClipInfo (Message 101) with the
message logger and it didn't log anything.
So, I went to my own methods, and did this:
Code:
register_event("ClipInfo", "clip_info", "b")
public clip_info()
{
new id = read_data(0)
new clip = read_data(1)
client_print(0, print_chat, "ClipInfo, 0:%i 1:%i", id, clip)
message_begin(MSG_ONE, 101, {0,0,0}, id)
write_byte(id)
write_byte(clip)
message_end()
}
The event only sends two args, and the first is id and second is amount of ammo remaining in the gun. However, the server crashes with something like: "Fatal error, User msg ClipInfo sent 2 bytes, expecting 1".
I imagine I can't do infinite ammo this way, or I am doing something wrong. Please point out any errors or give some suggestions as to what I can do to make a nice infinite ammo plugin.
I really don't like the method implemented by Seather
here, he just forces the client to drop the weapon and gives the client the same weapon again, so it's not fluid at all and it requires running a relatively lengthy function every 0.5 seconds.
ClipInfo is the only event that I found that changes when the ammo goes down. WeaponInfo is called on reload, though.