04-12-2012, 01:59 PM
04-12-2012, 11:11 PM
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
04-13-2012, 06:07 AM
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:
users.ini:
plugin pseudocode:
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
04-13-2012, 06:14 AM
That's exactly what i would do haha. But too lazy to do right now
04-13-2012, 03:26 PM
Are permissions case-sensitive? Might need to adjust for that.
04-13-2012, 06:30 PM
(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:
...
Error

04-13-2012, 07:24 PM
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.
04-13-2012, 07:58 PM
Sorry, but I write pseudocode itself can
I have a problem with programming, I did not really know
