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

Sed data to other plugins.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 01-25-2018 , 20:56   Sed data to other plugins.
Reply With Quote #1

Hello. How can I send data from a plugin to another?

Thankyou.
lugui is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 01-25-2018 , 21:06   Re: Sed data to other plugins.
Reply With Quote #2

Using Natives, explained on the Creating Natives (SourceMod Scripting) wiki.

Using Forwards, explained on the Function Calling API (SourceMod Scripting) wiki.

It can be achieved with either of them, or a combination of them both. What suit best highly depends on your project / use case.

A native can be called to request and retrieve things here and now, however, with a forward the originating plugin notifies other plugins (that cares about the forward name) about the change, so they also know what happened.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 01-25-2018 , 21:32   Re: Sed data to other plugins.
Reply With Quote #3

Thank you =)
lugui is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-25-2018 , 21:42   Re: Sed data to other plugins.
Reply With Quote #4

As a side note to what arne said, if you're using forwards you probably want a global forward.

Private forwards are only really if you want to put restrictions on the plugins that get messages from your plugins, such as making it so only a single implementation can be used for data storage (text files, sqlite, mysql?)
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 02:31.


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