From 7539751fc604c1e65082b06d43d634ce985bf7c6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 15 Feb 2006 16:05:20 +0000 Subject: [PATCH] added pcvar funcs --- plugins/include/amxmodx.inc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 5f82d35a..95e584e4 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -520,7 +520,9 @@ native emit_sound(index, channel, sample[], Float:vol, Float:att,flags, pitch); /* Returns distance between two vectors. */ native get_distance(origin1[3],origin2[3]); -/* Registers new cvar for HL engine. */ +/* Registers new cvar for HL engine. + * Returns the cvar pointer for get/set_pcvar functions. + */ native register_cvar(const name[],const string[],flags = 0,Float:fvalue = 0.0); /* Generates random floating point number from a to b. */ @@ -978,3 +980,19 @@ native ExecuteForward(forward_handle, &ret, ...); */ native DestroyForward(forward_handle); + +/* CVAR Pointer natives. Use these for + * more optimized CVAR usage. + * register_cvar() returns a pointer you can use. + */ + +//Get a cvar pointer. Returns 0 if not found. +native get_cvar_pointer(const cvar[]); + +native get_pcvar_num(pcvar); +native set_pcvar_num(pcvar, num); +native Float:get_pcvar_float(pcvar); +native set_pcvar(pcvar, Float:num); +native get_pcvar_string(pcvar, string[], maxlen); + +