Raised This Month: $ Target: $400
 0% 

Post and pre forward .


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamer99
Senior Member
Join Date: Jul 2011
Old 07-17-2011 , 09:06   Post and pre forward .
Reply With Quote #1

Hi ,

I have to fucntions which are being called in postthink . (FM_PlayerPostThink).

Now the logic is simple and they can be moved to prethink too.

So my question is
1)will it be better if i move them to prethink ?
2)will it be better if i move one of them to prethink ?

Just asking for my knowledge .
gamer99 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-17-2011 , 09:20   Re: Post and pre forward .
Reply With Quote #2

Show us what you have in your functions.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-17-2011 , 09:58   Re: Post and pre forward .
Reply With Quote #3

1st one :

public CheckSpinHack_Post(id)
{
if(is_user_alive(id))
{
static Float:fAngles[3]
pev(id, pev_angles, fAngles)

fTotalAngle[id] += vector_distance(fLastAngles[id], fAngles)

CopyVector(fAngles, fLastAngles[id])

static Button
Button = pev(id, pev_button)

if((Button & IN_LEFT) || (Button & IN_RIGHT))
{
g_dSpinWarnings[id] = 0
//server_cmd("say pressing left/right")
}

}
}

Another one I can't post as it uses some slowhacking . But its a very simple developer 0 function .
gamer99 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-17-2011 , 10:34   Re: Post and pre forward .
Reply With Quote #4

Use "prethink".
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-17-2011 , 10:56   Re: Post and pre forward .
Reply With Quote #5

See here

I don't think it matters which you use (pre or post) since you are not changing anything, you are only using it as a monitoring mechanism. If you plan to alter anything, then prethink must be used.

Here's just a slight improvement to button checking
PHP Code:
const IN_BUTTONS = ( IN_LEFT IN_RIGHT );

if( 
pevid pev_button ) & IN_BUTTONS )
{
    
g_dSpinWarnings[id] = 0
    
//server_cmd("say pressing left/right")

__________________

Last edited by Bugsy; 07-17-2011 at 11:25.
Bugsy is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-17-2011 , 11:29   Re: Post and pre forward .
Reply With Quote #6

hey the plugin is working fine ..

I just want to know whether

1)will it be better if i move them to prethink ?
2)will it be better if i move one of them to prethink ?


just wrt to CPU load and lag .

Quote:
Here's just a slight improvement to button checking
Thanks bugsy
gamer99 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-17-2011 , 14:27   Re: Post and pre forward .
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
I don't think it matters which you use (pre or post) since you are not changing anything
__________________
fysiks is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-17-2011 , 15:27   Re: Post and pre forward .
Reply With Quote #8

Still doing something in pre forward is better I think. Correct me when I am wrong.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-17-2011 , 17:14   Re: Post and pre forward .
Reply With Quote #9

Quote:
Originally Posted by bibu View Post
Still doing something in pre forward is better I think. Correct me when I am wrong.
It depends on what you are doing but if you aren't going to be changing anything then it shouldn't really matter.
__________________
fysiks is offline
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 00:49.


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