AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Cross-plugin boolean arrays (https://forums.alliedmods.net/showthread.php?t=154541)

misterx 04-10-2011 04:28

Cross-plugin boolean arrays
 
Hi,

I'm working on a VIP menu, which uses some other plugins for choices in menu. So, I need to create a cross-plugin boolean array. I read from somewhere, that this can be done using dynamic natives and dynamic arrays, but what I didn't find, was how to use these. So, what I need is a way to make a cross-plugin array.

ConnorMcLeod 04-10-2011 06:40

Re: Cross-plugin boolean arrays
 
There are tutorials on xvars and dynamic natives in Code Snippets/Tutorials forum.

misterx 04-10-2011 07:31

Re: Cross-plugin boolean arrays
 
Xvars do not support arrays...

Arkshine 04-10-2011 07:44

Re: Cross-plugin boolean arrays
 
Dynamic natives. There is a tutorial like connor said. Please search.

misterx 04-10-2011 08:11

Re: Cross-plugin boolean arrays
 
Yeah, I read that, but I didn't completely undestand it. Do I have to make my own *.inc file? Where should I put it to compile it? etc.

Arkshine 04-10-2011 08:28

Re: Cross-plugin boolean arrays
 
Yes. ( though it's possible to not use a file and copy-paste the content directly into the plugins).
If you use a file, just put in... scripting/includes/

Anyway, in the tutorials section, you have many examples of snippets using dynamic natives.

misterx 04-10-2011 08:40

Re: Cross-plugin boolean arrays
 
How to do it without *.inc file? I'll try searching, but just in case.

ConnorMcLeod 04-10-2011 08:45

Re: Cross-plugin boolean arrays
 
You create the native in plugin a.
In plugin b you put a line :

native get_user_thing(id)
native set_user_thing(id, num)

You put those lines where you put global vars and other stuff.

Arkshine 04-10-2011 08:47

Re: Cross-plugin boolean arrays
 
Look, think. .inc contains natives declaration. When you want to include theses natives in others plugins, you do #include <blabla>. Without file, you just need to copy theses native declaration into your plugins.

misterx 04-10-2011 08:49

Re: Cross-plugin boolean arrays
 
Thank you very much! It is pretty obvious now, when I know how it works. Thanks again, I'll try it right away!


All times are GMT -4. The time now is 20:10.

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