Jump to content

IRC Messages


Recommended Posts

Here's the thing, I'm a member of a server which already has an irc channel for MTA. One of our members who was in charge of managing and handling all the scripts had stepped down. So i'm not sure how our irc bot works. Anyway, I had been working on some new additions for the server. Some of these additions include messages that have to be broadcasted on our irc channel since they are admin-related messages.

Getting back to the problem, i think i will have to call these functions from my resource right ?

I've just attached a sample code! Tell me if i'm doing this right :P

  
  
addEventHandler ("onPlayerChat",getRootElement(), 
function(message,type) 
if (string.find(message,"@warnings")) and not (string.find(message," @warnings")) then 
    local W_Number = loadNumberData (source) 
    if (tonumber(W_Number) == 0) then 
       setTimer(outputChatBox,50,1," #E9F006" .. getPlayerName (source) .. " #06F0DDhas #E9F006zero #06F0DDwarnings!",getRootElement(),255,0,0,true) 
       call(getResourceFromName("irc"),"outputIRC",getPlayerName(source).." has zero warnings") 
  end 
  end 
end 
  

Link to comment
if (string.find(message,"@warnings")) and not (string.find(message," @warnings")) then 

This line doesn't make any sense, you're checking the string contains @warnings and if the string doesn't doesn't contain @warnings.

local W_Number = loadNumberData (source) 

Is loadNumberData function defined?

Link to comment
if (string.find(message,"@warnings")) and not (string.find(message," @warnings")) then 

This line doesn't make any sense, you're checking the string contains @warnings and if the string doesn't doesn't contain @warnings.

local W_Number = loadNumberData (source) 

Is loadNumberData function defined?

Link to comment
if (string.find(message,"@warnings")) and not (string.find(message," @warnings")) then 

This line doesn't make any sense, you're checking the string contains @warnings and if the string doesn't doesn't contain @warnings.

I guess you missed the "space" before "@warnings"

I have basically made an exception for "[space]@warnings"

local W_Number = loadNumberData (source) 

Is loadNumberData function defined?

Yes, loadNumberData is defined. Well, these aren't even my issues lol.

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...