Raised This Month: $ Target: $400
 0% 

ClipInfo - Infinite ammo - XxAvalanchexX saved the day


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 10-30-2006 , 00:08   ClipInfo - Infinite ammo - XxAvalanchexX saved the day
Reply With Quote #1

(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.

Last edited by stupok; 11-05-2006 at 15:51.
stupok is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode