Jump to content

Aexec on IRC


Ma5ter

Recommended Posts

I'm not sure what i have wrong here, its supposed to behave just like the console command except you use it from the irc resource, i checked if any errors were made, any warnings, or any outputs on chat that say "test ok" to indicate it did indeed read my code, and it didnt read my code. So im confused and like I said, idk what's wrong.

addIRCCommandHandler("!aexec",function(Me,Cmd,pName,Cmd,...) 
 if ( player ) then 
          outputChatBox ( "test ok", getRootElement())--testing only 
 if ( not pName or not Cmd ) then 
          outputChatBox ( "test ok", getRootElement())--testing only 
 outputChatBox("Syntax: /"..Cmd.." [player name] [cmd name] [arguments]", Me, 255, 0, 0) 
             return 
end 
       local args = table.concat({...}," ") 
       local target = getPlayerFromName(pName) 
        if not target then 
         outputChatBox ( "test ok", getRootElement())--testing only 
             outputChatBox("Player does not exist!",Me,255,0,0,true) 
             return 
        end 
        if executeCommandHandler(Cmd,target,tostring(args)) then 
          outputChatBox ( "test ok", getRootElement())--testing only 
            outputChatBox("Command Execution successful!", Me, 0, 255, 0) 
        else 
         outputChatBox ( "test ok", getRootElement())--testing only 
              outputChatBox("Command Execution failed!", Me, 255, 0, 0) 
        end 
     else 
         outputChatBox("This.",Me,255,0,0) 
     end 
end ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...