Cuberite Forum
New to plugin scripting - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: New to plugin scripting (/thread-1719.html)



New to plugin scripting - hendrikyoda - 01-11-2015

Hello MCServer Community,
I started to script a plugin for MCServer. It should be a really simple party plugin.

I followed the one tutorial on how to begin to script plugins, but from there it's hard to get far. At the moment i simply dont know how to acces classes. I mean I can execute Player functions, but how can I acces the Team class?

This is my Plugin code so far:
PLUGIN = nil

party = {}

function Initialize(Plugin)
  Plugin:SetName("PartyPlugin")
  Plugin:SetVersion(1)
  
  PLUGIN = Plugin
  
  cPluginManager.BindCommand("/party", "party.party", PartyMain, " ~ The Party Plugin.")
  
  LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
  return true
end

function PartyMain(Split, Player)
  
  Player:SendMessageInfo("Test")
  Player:SendMessageInfo(Player:GetTeam()) 
  Team:AddPlayer("testtest")
  return true

end



RE: New to plugin scripting - xoft - 01-11-2015

Hello, welcome to the forum.
I'm not exactly sure here, but I suppose the cTeam class represents a team within the minecraft's scoreboard system. That means you first need to initialize the scoreboard somehow, add a team to it and then you can work with it. I have a feeling that this is not exactly what you wanted, is it? Perhaps give us an overview of what you want to accomplish, then we could help you more.

(I have edited your post to use the shcode tag for the plugin code)