Hey guys,
First of all, C++ server, Awesome!
Now for my problem,
I seem to have the same errors, but fixing it as detailed above didn't help.
Trying to get a simple command going, but my Lua knowledge is limited.
Here is the code: "As I originaly figured it should work"
And here is the drama the console gave me:
--Warn [21:43:59] LUA: Plugins/STONED/stoned.lua:31: attempt to call global 'SendMessage' (a nil value)
--Warn [21:43:59] Stack trace:
--Warn [21:43:59] Plugins/STONED/stoned.lua(31): (no name)
--Warn [21:43:59] Stack trace end
--Warn [21:43:59] Error in plugin STONED calling function <callback>()
--Warn [21:43:59] LUA: Plugins/STONED/stoned.lua:31: attempt to call method 'GetName' (a nil value)
--Warn [21:43:59] Stack trace:
--Warn [21:43:59] Plugins/STONED/stoned.lua(31): (no name)
--Warn [21:43:59] Stack trace end
--Warn [21:43:59] Error in plugin STONED calling function <callback>()[/php]
Tried changing SendMessage to Player:SendMessage and the other solutions pointed out in the post above..
What am I overlooking here?
First of all, C++ server, Awesome!
Now for my problem,
I seem to have the same errors, but fixing it as detailed above didn't help.
Trying to get a simple command going, but my Lua knowledge is limited.
Here is the code: "As I originaly figured it should work"
function Initialize(Plugin)
Plugin:SetName("STONED")
Plugin:SetVersion(1)
-- Hooks
cPluginManager:AddHook(cPluginManager.HOOK_EXECUTE_COMMAND, RollJoint);
PLUGIN = Plugin
-- Command Bindings
cPluginManager.BindCommand("/j", "STONED.j", RollJoint, " - is rolling a joint."); -- RollJoint binding
LOG("Initialised " ..Plugin:GetName() .. " v." .. Plugin:GetVersion())
return true
end
function OnDisable()
LOG(PLUGIN:GetName() .. " is shutting down.")
end
-- Default callback name is: function OnExecuteCommand(Player, Command)
-- RollJoint Command:
function RollJoint(Player, j)
SendMessage(Player, " " .. Player:GetName(Player) .. " is rolling a joint.")
return true
end
And here is the drama the console gave me:
--Warn [21:43:59] LUA: Plugins/STONED/stoned.lua:31: attempt to call global 'SendMessage' (a nil value)
--Warn [21:43:59] Stack trace:
--Warn [21:43:59] Plugins/STONED/stoned.lua(31): (no name)
--Warn [21:43:59] Stack trace end
--Warn [21:43:59] Error in plugin STONED calling function <callback>()
--Warn [21:43:59] LUA: Plugins/STONED/stoned.lua:31: attempt to call method 'GetName' (a nil value)
--Warn [21:43:59] Stack trace:
--Warn [21:43:59] Plugins/STONED/stoned.lua(31): (no name)
--Warn [21:43:59] Stack trace end
--Warn [21:43:59] Error in plugin STONED calling function <callback>()[/php]
Tried changing SendMessage to Player:SendMessage and the other solutions pointed out in the post above..
What am I overlooking here?

