HOWTO: Inter-plugin communication
#16
Yeah that's not gonna work Sad
You will have to make those Object functions global so other plugins can access them.

Use some kind of key to identify the Objects, this could be the player name and pass that key to the functions. You will need to keep track of the Objects in your plugin yourself.

I suppose you would like to call LoadPasswords() from another plugin? And then the other plugin will receive this Object containing functions.
To still have the same functionality without passing tables around you need to restructure some things.

local AllLoadedStuff = {}

function LoadPasswords(path)
	-- ... do stuff
	-- Create a unique key
	AllLoadedStuff[Key] = WhateverYouLoaded
	return Key
end

-- Former Object:GetPassFromPlayer
function GetPassFromPlayer(Key, PlayerName)
	local Object = AllLoadedStuff[Key];
	
	-- Still use Object functions
	return Object:GetPassFromPlayer(PlayerName)
	
	-- Or copy everything in here
	if Table[PlayerName] ~= nil then
            return true, Table[PlayerName]
	end
	return false
end
Not sure if it's clear what I mean?Tongue
Reply
Thanks given by:


Messages In This Thread
HOWTO: Inter-plugin communication - by FakeTruth - 10-11-2012, 08:07 AM
RE: HOWTO: Inter-plugin communication - by ThuGie - 10-11-2012, 08:11 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-11-2012, 09:08 PM
RE: HOWTO: Inter-plugin communication - by xoft - 10-11-2012, 11:05 PM
RE: HOWTO: Inter-plugin communication - by ThuGie - 10-12-2012, 12:36 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-12-2012, 04:57 AM
RE: HOWTO: Inter-plugin communication - by FakeTruth - 10-23-2013, 12:59 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-23-2013, 05:43 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-23-2013, 06:33 AM
RE: HOWTO: Inter-plugin communication - by xoft - 11-25-2013, 01:33 AM
RE: HOWTO: Inter-plugin communication - by xoft - 12-07-2013, 06:51 AM



Users browsing this thread: 2 Guest(s)