AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   xvar_exists() ok, but what's the point? (https://forums.alliedmods.net/showthread.php?t=3449)

Downtown1 07-06-2004 22:15

xvar_exists() ok, but what's the point?
 
So xvar_exists() http://www.amxmodx.org/funcwiki.php?go=func&id=288 checks for a public variable in one of the plugins (does it even return true or false, or the name of the plugin, or what), but ok, let's say there IS a public variable by that name.

How would we access that public variable? Is there a function for that? :-\

Dygear 07-06-2004 22:32

xvar_exists - Checks if public variable with given name exists in loaded plugins.

I think this returns a 1 or 0, True or false.

Johnny got his gun 07-07-2004 06:25

Straight from amxmodx.inc:

Code:
/* Checks if public variable with given name exists in loaded plugins. */ native xvar_exists( const name[] ); /* Returns an unique id for public variable specified by name. If such * variable doesn't exist then returned value is -1. */ native get_xvar_id( const name[] ); /* Returns an integer value of a public variable. Id is a value * returned by get_xvar_id(...) native. */ native get_xvar_num( id ); /* Returns a float value of a public variable. Id is a value * returned by get_xvar_id(...) native. */ native Float:get_xvar_float( id ); /* Sets a value of a public variable. Id is a value * returned by get_xvar_id(...) native. */ native set_xvar_num( id, value = 0 ); /* Sets a float value of a public variable. Id is a value * returned by get_xvar_id(...) native. */ native set_xvar_float( id, Float:value = 0.0 );

Downtown1 07-07-2004 11:39

Useful, but what if the private variable is an array of one or more dimensions?


All times are GMT -4. The time now is 14:53.

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