New to plugin scripting
#1
Question 
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
Reply
Thanks given by:
#2
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)
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)