Class cGroup
#1
is cGroup completly up to date on the wiki? becouse i can't find Group:GetName() in the source code
Reply
Thanks given by:
#2
No, it's not.

The easiest way to check out the API is to temporarily enable the Debuggers plugin, it will output all available API functions into a file, API.txt, next to the MCServer.exe executable.
Reply
Thanks given by:
#3
thanks i now have a list of all the API functions Smile however i don't know how to use most of those functionsTongue
i am trying to make a chat plugin so you can see your group and i have this code:

	Server:SendMessage( Group:GetColor() .. "[" .. Group:GetName() .. "]" .. Player:GetColor() .. Player:GetName() .. ": " .. cChatColor.LightGray .. Message )

howerver i get this error all the time:
Code:
LUA: Plugins/Test/main.lua:17: attempt to index global 'Group' (a nil value)
Error in plugin chat calling function OnChat()
Reply
Thanks given by:
#4
1, A player may be a member of multiple groups, so this idea's not gonna work at all
2, What is Group in your code, is it a variable? because it definitely isn't a class name. The Lua error is telling you basically that you're using an undefined thing called "Group"
3, To see parameters for API functions, have a look at the bottom of Bindings.cpp file, there's a huuuge tolua_AllToLua_open() function that glues Lua to C++, find your class and function there and have a look at how it's glued. For example, cCraftingRecipe:GetIngredient() is glued in tolua_AllToLua_cCraftingRecipe_GetIngredient00() function, if you look that one up, you'll see that it takes one "const cCraftingRecipe" parameter (that's the Lua's hidden first parameter, denoted by using a colon instead of a dot), two number parameters and nothing more, it calls cCraftingRecipe's GetIngredient C++ function and then returns one result, "cItem".
Reply
Thanks given by:
#5
You could use the first group a player is in and prefix that to the chat messages
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)