Access variables in other plugins?
Hi all!
On my server I have a lot of different plugins running and most of them all access the ip, steamid and an id from my database for every user. Since this makes a lot of the same variables in the different plugins I was thinking that maybe there is a better way. Can I in plugin 1 access a variable set in plugin 2? I know about the callfunc but I want to get to the variable without calling a function for it. So in globalvars.amxx I create: PHP Code:
Now in savedeaths.amxx I want to save that the player XeroXer dies. I then want to send it to the database with his db id. Can I then access the playerDbId[id] from globalvars.amxx? Any help and/or suggestions are welcome... :mrgreen: |
Re: Access variables in other plugins?
X-olent made a include file for his hide'n'seek plugin
So u can use get_hidenseek_on or summink in a different plugin if it uses #include <hidenseek> My guess is that u can do the same if u create a include file I have no idea how to make 1 though |
Re: Access variables in other plugins?
If you are just sending information to between plugins, use Dynamic Natives.
|
Re: Access variables in other plugins?
Quote:
Would I gain anything from using Dynamic Natives instead of callfunc to get the information? Or maybe callfunc doesn't work that way, can I use a function in another plugin and get a result back with it? |
Re: Access variables in other plugins?
A dynamic natives to get users ips is non-sense, juste use get_user_ip in each plugin ;)
|
Re: Access variables in other plugins?
Yeah the ip and steamid might just be easier to get in each plugin, but not the databaseid right.
Then I have five plugins that each time a user connects make the same query to the same database to get the same information. That is what I want another plugin to do for them, just do the query and store the id for the other plugins to use. |
Re: Access variables in other plugins?
my bad :)
You may send a forward right after client_putinserver to send all datas to other plugins. |
Re: Access variables in other plugins?
You could use a forward:
Include: Code:
Main plugin: Code:
Other plugins: Code:
|
| All times are GMT -4. The time now is 03:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.