Raised This Month: $51 Target: $400
 12% 

Get access from one plugin to another


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-01-2009 , 13:58   Get access from one plugin to another
Reply With Quote #1

Hello,

is it possible to use an Array, which is located in Plugin1, in another plugin called Plugin2?

Here the examples:

PHP Code:
#include <sourcemod>

new data[100];

public 
OnPluginStart() {
  
//this is plugin1

PHP Code:
#include <sourcemod>

public OnPluginStart() {
  
//this is plugin2
  //here I want to print out the array "data" from plugin1

any ideas?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-01-2009 , 14:18   Re: Get access from one plugin to another
Reply With Quote #2

No, you have to create a native function in the one plugin, which you pass the array in, so you can copy the array over. but there is no way to share variables.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-02-2009 , 01:58   Re: Get access from one plugin to another
Reply With Quote #3

native function ? how does it look like ?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
SAMURAI16
BANNED
Join Date: Sep 2006
Old 01-02-2009 , 02:28   Re: Get access from one plugin to another
Reply With Quote #4

http://wiki.alliedmods.net/Creating_Natives_(SourceMod_Scripting)

Btw i think this is what you need : http://wiki.alliedmods.net/Function_Calling_API_(SourceMod_Scripting)#Ge neric_Calling

Last edited by SAMURAI16; 01-02-2009 at 02:35.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
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:35.


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