Jump to content

MTA:SA logIn logOut messages


vinigas

Recommended Posts

Posted

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.

 

Posted

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.

Posted

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
Posted

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
Posted

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 
)

 

  • Like 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

Posted (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 by GTX
  • Like 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

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