You want a slash command to do something, is that it? In your code you use "/gt dtoff" to do GmTool_HookAllChatFrames();
Your slash code is just a bit off then. You need parenthesis in your IF statement. Like this:
----------------------------------------------------------------
-- Evenement d'appel de /gt
----------------------------------------------------------------
function GmTool_perso_Slash(cmd)
DEFAULT_CHAT_FRAME:AddMessage("Command: " .. cmd);
if (cmd == "dtoff") then
-- Met en place le Hook
GmTool_HookAllChatFrames();
-- Met en place l'indicateur de filtre
filtre = "true";
end
end
I thought you were trying to parse a command with options like in your first example:
aaaaa 18 eeeee
With aaaaa being the slash command and 18 eeeee being the options for that command.
I also noticed a problem with your GmTool_HookAllChatFrames() function.
This line - cf.AddMessage = GmTool_ChatFrame_AddMessage
Try changing it to this
GmTool_ChatFrame_AddMessage(cf.AddMessage);
This will call your AddMessage function with your message as a variable.
You will need to remove the Self from function GmTool_ChatFrame_AddMessage(self, msg) because there is nothing defining it in your code (whats Self supposed to be anyway?).
__________________
"Don"t tase me bro!" ~ Andrew Meyer
Last edited by mulesh : 09-30-07 at 09:20 AM.
|