Raised This Month: $ Target: $400
 0% 

How to...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
B1ondu
Junior Member
Join Date: Apr 2007
Old 05-23-2007 , 09:26   How to...
Reply With Quote #1

How to get an array from other plugin ?

like:

Plugin1: Array[id] = 1

Plugin2: if(Array[id] !=0){
//something
}
__________________

[IMG]http://img107.**************/img107/8208/ssj3gokublondusigor0.png[/IMG]
[IMG]http://img112.**************/img112/7394/umdeveloperec1.jpg[/IMG]

Last edited by B1ondu; 05-23-2007 at 09:29.
B1ondu is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-23-2007 , 15:42   Re: How to...
Reply With Quote #2

As nobody have an idea:
I would prolly make it over nvault or a text-file...
Safe the array from one plugin and read it by an other...
But be aware of race conditions! I don't know exactly how to prevent that.
I know this idea is hackish, but better than no solution!?

greetz regalis
__________________
regalis is offline
pRED*
Join Date: Dec 2006
Old 05-23-2007 , 16:57   Re: How to...
Reply With Quote #3

You can't read variables from another plugin.

You can however transfer data from one plugin to another. Read Hawks tutorial on "Plugin API" in the tutorials section.
pRED* is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-23-2007 , 20:10   Re: How to...
Reply With Quote #4

Here is one way you can do this:

plugin #1:

PHP Code:
public plugin_natives() 
{
 
register_native("plugin_array_one""native_plugin_array_one")
}
public 
native_plugin_array_one(pluginparams)
{
 if(
params != 1)
  return 
0
 
     
new id get_param(1)
     if(!
id) return 0
      
return array[id]


plugin #2:

PHP Code:
native plugin_array_one(id)
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
my_function(id)
{
 new 
value plugin_array_one(id)

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 05-23-2007 , 22:16   Re: How to...
Reply With Quote #5

(I think)You can also declare a variable as public, fully exposing it to the VM, and allowing other plugins to access it by name. If not cheap suit's way will be the only way.

I think War3 did this or something. Check there and the pawn manual of course .
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 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 10:34.


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