Build in a new world - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Requests (https://forum.cuberite.org/forum-3.html) +--- Thread: Build in a new world (/thread-408.html) |
RE: Build in a new world - Boo - 04-02-2012 Code: function Initialize( Plugin ) It is dont work. what's wrong? RE: Build in a new world - geser - 04-02-2012 There is no method GetGroupName. May be GetGroups? http://www.mc-server.org/wiki/doku.php?id=api:cplayer std::list has no method contains(), try to write your own function to search element in list. If player can be in only one group use Player:GetGroups().at(0). RE: Build in a new world - Boo - 04-11-2012 no, dont work RE: Build in a new world - FakeTruth - 04-11-2012 Yes, use Player:GetGroups() GetGroups() does not return an std::list in Lua though, it returns a regular Lua table/array which you can iterate through. This should work I think Code: for Key, Group in pairs(Player:GetGroups()) do RE: Build in a new world - Boo - 04-11-2012 Code: function Initialize( Plugin ) Dont Work Help what problem? RE: Build in a new world - xoft - 04-11-2012 This line: Code: if (Player:GetGroups() == "Admins") then You should do this instead: Code: for Key, Group in pairs(Player:GetGroups()) do (Note that I don't do Lua at all so the code may be syntactically wrong) Explanation: Player may be a member of multiple groups; Player:GetGroups() returns all the groups, so you need to search the returned list of groups for yourparticular group name. RE: Build in a new world - Boo - 04-11-2012 Code: function Initialize( Plugin ) No! Dont Work again RE: Build in a new world - FakeTruth - 04-11-2012 What doesn't work? You're returning true, which blocks all admins from placing blocks... RE: Build in a new world - Boo - 04-11-2012 I need to only admins can destroy the blocks. It does not work RE: Build in a new world - FakeTruth - 04-11-2012 Code: function OnBlockDig( PacketData, Player ) |