Raised This Month: $51 Target: $400
 12% 

xvar_exists() ok, but what's the point?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Downtown1
Veteran Member
Join Date: Mar 2004
Old 07-06-2004 , 22:15   xvar_exists() ok, but what's the point?
Reply With Quote #1

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? :-\
Downtown1 is offline
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-06-2004 , 22:32  
Reply With Quote #2

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

I think this returns a 1 or 0, True or false.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 07-07-2004 , 06:25  
Reply With Quote #3

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 );
Johnny got his gun is offline
Downtown1
Veteran Member
Join Date: Mar 2004
Old 07-07-2004 , 11:39  
Reply With Quote #4

Useful, but what if the private variable is an array of one or more dimensions?
Downtown1 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 10:08.


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