AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   retrieving vars from other plugins (https://forums.alliedmods.net/showthread.php?t=11345)

VarmVaffel 03-16-2005 13:49

retrieving vars from other plugins
 
How can I retrieve a full array, or a var inside of an array from another plugin?

VV

XxAvalanchexX 03-16-2005 22:11

Code:
// this goes in the plugin you want to receive FROM public return_variable() {   return the_variable_here; }

Code:
// this goes in the plugin you want to receive WITH public get_variable() {    callfunc_begin("return_variable","plugin_file.amxx");    new the_variable_here = callfunc_end(); }

VarmVaffel 03-17-2005 05:03

alright thanks m8! :D

But isn't there any way to do this without changing the plugin we should receive the var from?

Twilight Suzuka 03-17-2005 13:37

Yes.

Code:
    new holder_for_variable     if(xvar_exists ( "variable_you_want" ) ) holder_for_variable = get_xvar_num (  get_xvar_id ( variable_you_want ) )

You can use the xvar natives.


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

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