Not able to run command inside plugin
#1
Hello,
I'm writing a plugin and no matter what I try, i allways have "insufficient privileges "/setblock"". Can anyone help me with that?
Here is the source:
Code:
PLUGIN = nil

function Initialize(Plugin)
    Plugin:SetName("VanillaFill")
    Plugin:SetVersion(1)

    -- Hooks

    PLUGIN = Plugin -- NOTE: only needed if you want OnDisable() to use GetName() or something like that

    -- Command Bindings
    cPluginManager.BindCommand("/setblock", "vanillafill.setblock", setblock, " ~ Changes a block at X Y Z.");
--    cPluginManager.BindCommand("/fill", "vanillafill.fill", fill, " ~ Fills an area from X Y Z to X2 Y2 Z2.");

    LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
    return true
end

function OnDisable()
    LOG(PLUGIN:GetName() .. " is shutting down...")
end

function setblock(Split, Player)
    if (#Split ~= 4) then
        -- There was more or less than one argument (excluding the "/explode" bit)
        -- Send the proper usage to the player and exit
        Player:SendMessage("Usage: /setblock X Y Z [blocktype]")
        return true
    end

    Player:GetWorld():SetBlock(Split[2], Split[3], Split[4], Split[5])

    return true
end
Console Log output:
Code:
[12:55:56] Player muellerCAM3 is executing command "/setblock" in world "world" at world age 237160.
[12:55:56] Player muellerCAM3 tried to execute forbidden command: "/setblock"
Reply
Thanks given by:


Messages In This Thread
Not able to run command inside plugin - by mueller_minki - 02-18-2021, 10:01 PM



Users browsing this thread: 4 Guest(s)