Build in a new world
#21
tnx workSmile
Reply
Thanks given by:
#22
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
Reply
Thanks given by:
#23
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
Reply
Thanks given by:
#24
That's exactly what i would do haha. But too lazy to do right now
Reply
Thanks given by:
#25
Are permissions case-sensitive? Might need to adjust for that.
Reply
Thanks given by:
#26
(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?


Attached Files Thumbnail(s)
   
Reply
Thanks given by:
#27
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.
Reply
Thanks given by:
#28
Sorry, but I write pseudocode itself can Smile I have a problem with programming, I did not really know
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)