AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Multi script variable (https://forums.alliedmods.net/showthread.php?t=47457)

DPAKOH 11-18-2006 12:32

Multi script variable
 
How can I create array in script, which (array) can be accessed from different scripts?

teame06 11-18-2006 14:31

Re: Mulit script variable
 
Use dynamic natives. Look in the Coding Tutorial section for a tutorial on it

DPAKOH 11-18-2006 15:45

Re: Mulit script variable
 
I didn't find it :(
It's register_native?
How it can help me?

The Specialist 11-18-2006 18:41

Re: Multi script variable
 
http://forums.alliedmods.net/showthread.php?t=41251

DPAKOH 11-19-2006 15:34

Re: Multi script variable
 
I read this... I think it's not detailed information :(
Which script use this technology? I want to see some examples.

teame06 11-19-2006 16:29

Re: Multi script variable
 
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)); }

DPAKOH 11-19-2006 20:14

Re: Multi script variable
 
oO
THANK YOU!


All times are GMT -4. The time now is 06:52.

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