Raised This Month: $ Target: $400
 0% 

Cross-plugin boolean arrays


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
misterx
Member
Join Date: Jan 2011
Old 04-10-2011 , 04:28   Cross-plugin boolean arrays
Reply With Quote #1

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.
misterx is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 06:40   Re: Cross-plugin boolean arrays
Reply With Quote #2

There are tutorials on xvars and dynamic natives in Code Snippets/Tutorials forum.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
misterx
Member
Join Date: Jan 2011
Old 04-10-2011 , 07:31   Re: Cross-plugin boolean arrays
Reply With Quote #3

Xvars do not support arrays...
misterx is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-10-2011 , 07:44   Re: Cross-plugin boolean arrays
Reply With Quote #4

Dynamic natives. There is a tutorial like connor said. Please search.
__________________
Arkshine is offline
misterx
Member
Join Date: Jan 2011
Old 04-10-2011 , 08:11   Re: Cross-plugin boolean arrays
Reply With Quote #5

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.
misterx is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-10-2011 , 08:28   Re: Cross-plugin boolean arrays
Reply With Quote #6

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.
__________________
Arkshine is offline
misterx
Member
Join Date: Jan 2011
Old 04-10-2011 , 08:40   Re: Cross-plugin boolean arrays
Reply With Quote #7

How to do it without *.inc file? I'll try searching, but just in case.
misterx is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 08:45   Re: Cross-plugin boolean arrays
Reply With Quote #8

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-10-2011 , 08:47   Re: Cross-plugin boolean arrays
Reply With Quote #9

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.
__________________
Arkshine is offline
misterx
Member
Join Date: Jan 2011
Old 04-10-2011 , 08:49   Re: Cross-plugin boolean arrays
Reply With Quote #10

Thank you very much! It is pretty obvious now, when I know how it works. Thanks again, I'll try it right away!
misterx 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 20:10.


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