Cuberite Forum
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)

Pages: 1 2 3


RE: Build in a new world - Boo - 04-12-2012

tnx workSmile


RE: Build in a new world - Boo - 04-12-2012

Code:
function OnBlockDig( PacketData, Player )
Namesini = cIniFile("names.ini")
if ( Namesini:ReadFile() == true ) then
Namess = Namesini:GetValue(Nicks,Player:GetName())
if Namess == Player:GetName() then
return false
end
return true
end
end

names.ini
Code:
[Nicks]
Bot
Lol
gogogog
Player
Fifa=1
Polloooo
Looseeerrr!!!!
Noooobbb!!!

I'm sorry that is wrong?

If the name matches the name of the player that you can destroy blocks


RE: Build in a new world - xoft - 04-13-2012

If I were to write something like this, I'd go about it in a different way. I'd use the existing structure of Permissions and UserGroups:

groups.ini:
Code:
[World1Builders]
Permissions=buildinworld.world1

[World2Builders]
Permissions=buildinworld.world2

users.ini:
Code:
[Name1]
Groups=World1Builders,World2Builders

[Name2]
Groups=World2Builders

[Name3]
Groups=World1Builders

[MyAdminName]
Groups=Admins

plugin pseudocode:
Code:
function OnBlockDig( PacketData, Player )
  WorldName = Player.GetWorld().GetName()
  return Player.HasPermission("buildinworld." + WorldName)
end



RE: Build in a new world - FakeTruth - 04-13-2012

That's exactly what i would do haha. But too lazy to do right now


RE: Build in a new world - xoft - 04-13-2012

Are permissions case-sensitive? Might need to adjust for that.


RE: Build in a new world - Boo - 04-13-2012

(04-13-2012, 06:07 AM)xoft Wrote: If I were to write something like this, I'd go about it in a different way. I'd use the existing structure of Permissions and UserGroups:
...

ErrorSad WTf?


RE: Build in a new world - xoft - 04-13-2012

As I said, I don't do Lua, so it was *pseudocode* only. You need to write proper code for that, I just wanted to illustrate the idea.


RE: Build in a new world - Boo - 04-13-2012

Sorry, but I write pseudocode itself can Smile I have a problem with programming, I did not really know