Get value from another plugin?
#1
Information 
Is possible, obtain the value of a variable from another plugin?

Plugin:
PHP Code:
variable1 Info[Player]; 

Another plugin:
PHP Code:
InfoGet[Player] = variable1

As "natives", pawno or only with sqlite, txt, etc?
Reply
Thanks given by:
#2
See http://mc-server.xoft.cz/LuaAPI/cPluginManager.html -> CallPlugin for specifics and limitations.

Usage:
Code:
cPluginManager:CallPlugin("PluginName", "FunctionToCall", Optional Parameters)
Reply
Thanks given by:
#3
Thanks for reply i don't see that, something?

Plugin "Game":
PHP Code:
function GetWinner()
      return 
ServerData.Winner;
end 

Plugin "Login":
PHP Code:
function GivePoints()
      
local WinnerName cPluginManager:CallPlugin("Game""GetWinner");
      
PlayerData.points[WinnerName] = PlayerData.points[WinnerName] +1;
end 
Reply
Thanks given by:
#4
First of all, check if there's any errors or warnings in the server console. That is the first place where problems are discovered.

Second, in the GetWinner() function, add logging to verify that you are sending over the proper value:
function GetWinner()
    LOG("Function GetWinner()")
    LOG("  type(ServerData.Winner) = " .. type(ServerData.Winner))
    LOG("  ServerData.Winner = " .. ServerData.Winner)
    return ServerData.Winner
end
Similarly, verify in the GivePoints() function that you're getting what you think you are getting.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)