Raised This Month: $ Target: $400
 0% 

Calculating fall distance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-05-2009 , 12:26   Re: Calculating fall distance
Reply With Quote #1

@Exolent:

Code:
new boo:g_falling[33]; // Typo ---> new bool:g_falling[33];

Also:
Code:
pev(client, pev_origin, fall_origin[client]);
Are you positive that static variables' value is stored just like global vars(except of course only for the specific function where they were created)?
I think that static vars are only to prevent creating vars multiple times like in Think forwards to decrease CPU or something.

If you use new on every client_connect forward, it will recreate it every time the player connects.
But if you use static, the variable already exists but resets.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 02-05-2009 at 12:31.
Dores is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-05-2009 , 12:36   Re: Calculating fall distance
Reply With Quote #2

Thanks for the typo.

And static acts like a global variable inside a local method.
It does not get reset.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-05-2009 , 12:44   Re: Calculating fall distance
Reply With Quote #3

I always thought that it does reset.
Thanks for the info.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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 01:53.


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