NeO_DUFFMAN Posted June 17, 2013 Share Posted June 17, 2013 Hello MTA'ers! Since my problem is pretty straightforward, I'm hoping to get a quick and simple reply lol. Anyway, my problem is with displaying messages on Irc! How can I do this ? I desperately need a solution for this. Link to comment
dzek (varez) Posted June 17, 2013 Share Posted June 17, 2013 Explain your problem a bit further Link to comment
blehmeh Posted June 17, 2013 Share Posted June 17, 2013 Maybe this is what you seek: https://wiki.multitheftauto.com/wiki/Resource:Irc Link to comment
NeO_DUFFMAN Posted June 17, 2013 Author Share Posted June 17, 2013 I basically want to display certain script related messages on an irc channel. Initially, i had tried testing with outputIRC sadly i couldn't make it work. Btw, sorry for being so unclear. Link to comment
blehmeh Posted June 17, 2013 Share Posted June 17, 2013 Did you install the sockets module first? Did you install the irc resource? Did you add outputIRC to the resource? Link to comment
NeO_DUFFMAN Posted June 18, 2013 Author Share Posted June 18, 2013 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 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
NeO_DUFFMAN Posted June 20, 2013 Author Share Posted June 20, 2013 Bump! I really need some guidance here Link to comment
blehmeh Posted June 21, 2013 Share Posted June 21, 2013 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
blehmeh Posted June 21, 2013 Share Posted June 21, 2013 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
NeO_DUFFMAN Posted June 21, 2013 Author Share Posted June 21, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now