Raised This Month: $ Target: $400
 0% 

client_prethink & posthink - clear explanation on proble


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-23-2006 , 15:45  
Reply With Quote #1

Quote:
Originally Posted by organizedKaoS
Quote:
Originally Posted by Hawk552
PreThink is called every time before a client renders a frame with physics. This means that if the client's FPS is 50, it will be called 50 times a second, just before each frame is actually rendered. This gives you a fraction of a second to change whatever you need to, before the client actually renders the frame.

PostThink works the same way, except it's a fraction of a second after.
Is prethink and posthink the only route to go as far as "changing" a clients actions? example is twisted's multijump plugin. Prethink checks if the player is jumping and pressing his jump button again while not on ground. Is pre/posthink the only way of achieving this kind of "client action modification"? Or is there any other possible way? Thanks
Not really, although it's easily the most effective. There are a number of other ways I can think of.

Code:
register_forward(FM_PlayerPreThink,"my_func") register_forward(FM_PlayerPostThink,"my_func")

Code:
register_think("player","my_func")

Code:
public server_frame() {     //... }

That's pretty much all I can think of. I think client_PreThink and PostThink are still the best though.

If you're going for optimization and can ommit Engine from the plugin, then I would go with the Fakemeta hooks (first example).
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



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 16:30.


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