Jump to content

cancelEvent


Recommended Posts

Hi.

How can i cancel this, when player account not exist?

login: No known account for 'sad'

 

I want to cancel the "No known account for 'sad' message like this:

 

    if text == "ACL: Access denied for 'start'" then
        cancelEvent()
    end

 

Link to comment

i know... already done this.

But i can not cancel this, because the "username" always changing. How can i cancel that?

i tried with this

addEventHandler ( "onClientChatMessage", root, function ( text ,username)
    if text == "No known account for '"..username.."'" then
        cancelEvent()
    end
end)

 

Edited by TheMOG
Link to comment
31 minutes ago, TheMOG said:

i know... already done this.

But i can not cancel this, because the "username" always changing. How can i cancel that?

i tried with this


addEventHandler ( "onClientChatMessage", root, function ( text ,username)
    if text == "No known account for '"..username.."'" then
        cancelEvent()
    end
end)

 

tested :

 

addEventHandler ( "onClientChatMessage", root, function ( text)
    if text >= "login: No known account for" then
        cancelEvent()
    end
end)

 

Link to comment
addEventHandler ( "onClientChatMessage", root, function ( text )
    if string.find(text, "login:") then
        cancelEvent()
    end
end)

Are you trying to block a message from being outputted from the default login system or from a script? I'm not sure if you can but normally the above example should work.

Edited by Tails
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...