2004-08-24 21:36:39 +00:00
|
|
|
/* FakeMeta functions
|
|
|
|
* This file is provided as-is with no warrenties.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if defined _fakemeta_included
|
|
|
|
#endinput
|
|
|
|
#endif
|
|
|
|
#define _fakemeta_included
|
|
|
|
|
2005-07-15 07:59:26 +00:00
|
|
|
#include <fakemeta_const>
|
|
|
|
|
2005-07-15 19:05:31 +00:00
|
|
|
#pragma library fakemeta
|
|
|
|
|
2005-07-15 07:59:26 +00:00
|
|
|
/* Returns entvar data from an entity Use the pev_* enum to specify which form of data you want returned. */
|
2006-02-01 12:17:40 +00:00
|
|
|
native pev(_index,_value,{Float,Sql,Result,_}:...);
|
2005-07-15 07:59:26 +00:00
|
|
|
|
|
|
|
/* Sets entvar data for an entity. Use the pev_* enum */
|
2006-02-01 12:17:40 +00:00
|
|
|
native set_pev(_index,_value,{Float,Sql,Result,_}:...);
|
|
|
|
|
|
|
|
/* returns 0 if ent is invalid, >0 if valid
|
|
|
|
* (1 == valid, 2 == valid+pvPrivateData valid)
|
|
|
|
*/
|
|
|
|
native pev_valid(entindex);
|
2004-08-24 21:36:39 +00:00
|
|
|
|
2006-03-14 17:15:52 +00:00
|
|
|
/* Returns any global variable inside globalvars_t structure. Use the glb_* enum. */
|
|
|
|
native global_get(_value, {Float,Sql,Result,_}:...);
|
|
|
|
|
2004-08-24 21:36:39 +00:00
|
|
|
/* Returns an integer from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */
|
|
|
|
native get_pdata_int(_index,_Offset,_linuxdiff=5);
|
|
|
|
|
|
|
|
/* Sets an integer from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */
|
|
|
|
native set_pdata_int(_index,_Offset,_Value,_linuxdiff=5);
|
|
|
|
|
|
|
|
/* Returns a float from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */
|
|
|
|
native Float:get_pdata_float(_index,_Offset,_linuxdiff=5);
|
|
|
|
|
|
|
|
/* Sets a float from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */
|
|
|
|
native set_pdata_float(_index,_Offset,Float:_Value,_linuxdiff=5);
|
|
|
|
|
|
|
|
|
2006-02-03 03:27:03 +00:00
|
|
|
/* Registers a forward.
|
|
|
|
* Returns an id you can pass to unregister_forward
|
|
|
|
*/
|
2004-08-24 21:36:39 +00:00
|
|
|
native register_forward(_forwardType,_function[],_post=0);
|
|
|
|
|
2006-02-03 03:27:03 +00:00
|
|
|
/* Unregisters a forward.
|
|
|
|
* The registerId must be from register_forward, and
|
|
|
|
* post/forwardtype must match what you registered the forward as.
|
|
|
|
*/
|
|
|
|
native unregister_forward(_forwardType, registerId, post=0);
|
|
|
|
|
2004-08-24 21:36:39 +00:00
|
|
|
/* Returns data for metamod */
|
2004-09-07 09:26:20 +00:00
|
|
|
native forward_return(type,{Float,Sql,Result,_}:...);
|
2004-08-24 21:36:39 +00:00
|
|
|
|
2004-09-07 09:26:20 +00:00
|
|
|
native engfunc(type,{Float,Sql,Result,_}:...);
|
2004-09-14 06:16:52 +00:00
|
|
|
native dllfunc(type,{Float,Sql,Result,_}:...);
|
|
|
|
|
|
|
|
//only use this with functions that pass a Trace
|
|
|
|
// get: zero extra params - return int, one extra param = byref float or vector
|
|
|
|
// set: use anything
|
2004-09-15 18:40:18 +00:00
|
|
|
native get_tr(TraceResult:tr_member, {Float,_}:...);
|
2005-08-21 16:38:45 +00:00
|
|
|
native set_tr(TraceResult:tr_member, {Float,_}:...);
|
|
|
|
|
2006-03-20 18:08:51 +00:00
|
|
|
//Upgraded version takes in a TraceResult handle, optionally passed in as the last parameter to the
|
|
|
|
//TraceResult forward. Use 0 to specify the global traceresult handle set from calling
|
|
|
|
// some of the Engfucs.
|
|
|
|
native get_tr2(tr_handle, TraceResult:tr_member, {Float,_}:...);
|
|
|
|
native set_tr2(tr_handle, TraceResult:tr_member, {Float,_}:...);
|
|
|
|
|
|
|
|
//Same as above, use either a kvd_handle or 0 for global reserved kvd data
|
|
|
|
//kvd_handle is passed by the kvd hook, last param
|
|
|
|
native get_kvd(kvd_handle, KeyValueData:member, {Float,_}:...);
|
|
|
|
|
|
|
|
//Using set_kvd with the handle from the hook for anything under KV_fHandled
|
|
|
|
// is considered an undefined operation (it could crash). You should fire a new
|
|
|
|
// keyvalues structure rather than changing the internal engine strings.
|
|
|
|
native set_kvd(kvd_handle, KeyValueData:member, {Float,_}:...);
|
|
|
|
|
2005-08-21 16:38:45 +00:00
|
|
|
//NOTE that for the string offsets below, on AMD64, a byref (char **) offset is NOT the same as an int offset
|
|
|
|
//In fact it's QWORD aligned rather than DWORD aligned, so the offset will be exactly half.
|
|
|
|
//Gets a string from a private offset. If byref is false, the string is treated as static rather than dynamic.
|
|
|
|
native get_pdata_string(entity, offset, dest[], maxlength, byref=1, linux=-5);
|
|
|
|
|
|
|
|
//Sets a string in a private offset.
|
|
|
|
//realloc = -1 - nonbyref copy (static
|
|
|
|
//realloc = 0 - copy byref, no realloc *(char **)
|
|
|
|
//realloc = 1 - reallocate new string with free+malloc
|
|
|
|
//realloc = 2 - reallocate new string with delete[]+new[]
|
|
|
|
native set_pdata_string(entity, offset, const source[], realloc=2, linux=-5);
|