Code:
// This is the plugin your going to get the variable from.
// This is using AMXX api style natives
#include <amxmodx>
new Var[33] = { 9999, ... } ;
public plugin_natives()
{
register_library("MyScript");
register_native("GetThisVar", "_GetThisVar");
}
public _GetThisVar(pluginid, param)
{
new index = get_param(1);
return Var[index];
}
Code:
// This file will be name like ThisPlugin.inc and put into your include folder in the compiler.
#if defined _ThisInclude_included
#endinput
#endif
#define _ThisInclude_included
native GetThisVar(player);
Code:
// This is the plugin using the native
#include <amxmodx>
#include <ThisPlugin>
public plugin_init()
{
register_concmd("run", "cmdRun");
}
public cmdRun(id)
{
server_print("This is suppose to be 9999. The value of that variable is [%d]", GetThisVar(id));
}
__________________