Raised This Month: $ Target: $400
 0% 

Question on register_think.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 11-21-2011 , 03:24   Question on register_think.
Reply With Quote #1

I'm creating an entity(not a player) and checking if players are around the area and visible to it. But I'm confused with register_think and client_PreThink. Which of them are more suitable for the entity or both of them are different from each other.
Excalibur.007 is offline
Old 11-21-2011, 03:44
Arkshine
This message has been deleted by Arkshine. Reason: nvm
mrhellish
Junior Member
Join Date: Jun 2010
Old 11-21-2011 , 05:13   Re: Question on register_think.
Reply With Quote #2

client_PreThink -> for clients/players
register_think(... -> you choose the entity type
mrhellish is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 11-21-2011 , 05:42   Re: Question on register_think.
Reply With Quote #3

So, I assumed both of them works the same way just that client_PreThink is (mostly) used for players while register_think is used for entities we choose right?
Excalibur.007 is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-21-2011 , 05:51   Re: Question on register_think.
Reply With Quote #4

Whats the difference of prethink and postthink?
__________________
Snaker beatter is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 11-21-2011 , 05:56   Re: Question on register_think.
Reply With Quote #5

Quote:
Originally Posted by Snaker beatter View Post
Whats the difference of prethink and postthink?
Quote:
Originally Posted by Hawk552 View Post
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.
You got your answers
Excalibur.007 is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-21-2011 , 05:59   Re: Question on register_think.
Reply With Quote #6

Quote:
Originally Posted by Excalibur.007 View Post
You got your answers
Ok
__________________
Snaker beatter is offline
mrhellish
Junior Member
Join Date: Jun 2010
Old 11-21-2011 , 14:57   Re: Question on register_think.
Reply With Quote #7

Pre - detect when happened
Post - detect after happend

then if you want to block some event, you can do it in Pre, not Post. in Post the event is already happened
mrhellish is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 11-21-2011 , 15:09   Re: Question on register_think.
Reply With Quote #8

If you want to check whether a client is in range of your entity, hook think on the entity and repeatedly check for entities using find_ent_in_sphere.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 11-22-2011 , 16:48   Re: Question on register_think.
Reply With Quote #9

Quote:
Originally Posted by Excalibur.007 View Post
So, I assumed both of them works the same way just that client_PreThink is (mostly) used for players while register_think is used for entities we choose right?
Not mostly, only. client_PreThink is only called for player entities.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 08:31.


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