vinigas Posted October 28, 2016 Posted October 28, 2016 I use logIn, logOut functions in my script and I see that I getting chat messages then I am testing. Can I turn off those automatic messages ? Quote login: You successfully logged in. login: You are already logged in.
Gravestone Posted October 28, 2016 Posted October 28, 2016 12 minutes ago, vinigas said: login: You successfully logged in. login: You are already logged in This means that the logIn function is being triggered twice. Mostly happens when you double click on a gui button. Clan war system http://sh.st/7r4nI
vinigas Posted October 28, 2016 Author Posted October 28, 2016 Yea I know, but that's is not a problem. The problem is that i do not use outputChatBox, but I'm still getting this chat messages.
Gravestone Posted October 28, 2016 Posted October 28, 2016 You can do something like this addEventHandler("onPlayerLogin", root, function() cancelEvent() logIn() -- login the player somehow end ) Clan war system http://sh.st/7r4nI
GTX Posted October 28, 2016 Posted October 28, 2016 Those messages are hardcoded, you cannot turn them off as far as I know. Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
Gravestone Posted October 28, 2016 Posted October 28, 2016 22 minutes ago, GTX said: Those messages are hardcoded, you cannot turn them off as far as I know. You can, by cancelling the event. Clan war system http://sh.st/7r4nI
GTX Posted October 28, 2016 Posted October 28, 2016 If you cancel onPlayerLogin then you won't login (According to wiki). What you're doing in your code now is called stack overflow. Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
Addlibs Posted October 28, 2016 Posted October 28, 2016 Pretty sure you can cancelEvent() on onClientChatMessage if the string.sub(message, 1, 6) is "login:" or "logout:" 3 Previously known as MrTasty.
Walid Posted October 28, 2016 Posted October 28, 2016 You can use sth like this: Server side addEventHandler("onPlayerLogin", root, function() setTimer(triggerClientEvent,1000,1,source,"removeLoginMessage",source) end ) Client side addEvent("removeLoginMessage",true) addEventHandler("removeLoginMessage",localPlayer, function() for i = 1, 200, 1 do outputChatBox("") end end ) 1 Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
GTX Posted October 28, 2016 Posted October 28, 2016 (edited) @Walid No... MrTasty's solution would work just fine. To put it into an example: function onChatMessage(text) if(string.sub(text,1,6) == "login:" or string.sub(text,1,7) == "logout:") then -- Check if it contains login: or logout: strings cancelEvent() -- Cancel it end end addEventHandler("onClientChatMessage",root,onChatMessage) Edited October 28, 2016 by GTX 2 Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
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