Raised This Month: $7 Target: $400
 1% 

[INFO] Fakemeta & Ham detailed function descriptions and examples


Post New Thread Reply   
 
Thread Tools Display Modes
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-26-2014 , 19:40   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #191

Fakemeta function:
Code:
EngFunc_CanSkipPlayer


Description:
Returns 1 or 0 depending of client's cl_lw cvar value (if cl_lw different from 0, returns 1). This functions is used by the mod for checking if player has weapon prediction enabled. Mod uses CanSkipPlayer on weapons, directly on SendWeaponAnim function.

If client haves cl_lw cvar enabled, it means that haves weapon prediction enabled = no need to send weapons animations.
Usage:

PHP Code:
if(engfunc(EngFunc_CanSkipPlayer(index))
{
    
// client has weapon prediction enabled
}
else
{
    
// client has weapon prediction disabled, server will sent him everything from his weapons.

Parameters:
index = client's index (must be a player)

Not really an important snippet, but it will be useful for someone. May this function be unknown for a lot of scripters.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross

Last edited by meTaLiCroSS; 07-26-2014 at 19:41.
meTaLiCroSS is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-26-2014 , 19:49   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #192

Fakemeta function:
Code:
EngFunc_Time


Description:
Returns time in seconds (float) since the game started. Rather the same as tickcount(). It seems to not be used by the mod (it's useless anyway).
Usage:

PHP Code:
new Float:flElapsedTime Float:engfunc(EngFunc_Time)
server_print("%.2f seconds passed since the server started"flElapsedTime
PHP Code:
new Float:flStartTime Float:engfunc(EngFunc_Time)
MyVeryBigFunction()
AnotherHugeFunction()
SpamArkshineSteamChat()
server_print("Execution time: %f"Float:engfunc(EngFunc_Time) - flStartTime
Parameters:
no params for this function

Another not really important function, but as many others, it's unknown for many scripters.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-08-2014 , 10:44   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #193

@meTaLiCroSS, from what I see EngFunc_Time acts like get_gametime. AFAIK the value returned by get_gametime is increased only in next frame. In your last example, if the execution of the 3 private functions happen in the same frame, it will print 0. Is this right ?
__________________

Last edited by HamletEagle; 09-08-2014 at 11:07.
HamletEagle is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 09-12-2014 , 20:00   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #194

Quote:
Originally Posted by HamletEagle View Post
@meTaLiCroSS, from what I see EngFunc_Time acts like get_gametime. AFAIK the value returned by get_gametime is increased only in next frame. In your last example, if the execution of the 3 private functions happen in the same frame, it will print 0. Is this right ?
I posted it because I researched the engine and found it usage, it has nothing to do with get_gametime(). Time will always return a difference of time (substracting 2 values from get_systime() as example)
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Old 09-12-2014, 21:49
Sta77dom
This message has been deleted by YamiKaitou. Reason: spambot
Reply


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 05:26.


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