Jump to content

cancelEvent acting weird on 'onPlayerConnect'


Xinoz

Recommended Posts

Posted

Hi guys,

I am trying to display a message to the players upon joining.

When using the cancelEvent upon the 'onPlayerConnect' event no message is being displayed.

When joining the server it shows no message.. well it does, the default one that is supposed to show for when you don't declare a message.

Am I doing something wrong or is there actually something bugged?

Thanks in advance.

Posted
Hi guys,

I am trying to display a message to the players upon joining.

When using the cancelEvent upon the 'onPlayerConnect' event no message is being displayed.

When joining the server it shows no message.. well it does, the default one that is supposed to show for when you don't declare a message.

Am I doing something wrong or is there actually something bugged?

Thanks in advance.

What do you mean? this?

addEventHandler("onPlayerConnect", getRootElement(), 
function () 
cancelEvent(true, "TEXT") 
end) 

Posted

I discovered that it doesn't work when resources are starting. It does when there aren't any.

For me it defeats the purpose of using this right now since I wanted to refuse players from joining when resources were starting.

EDIT: Yes, I can still refuse them, but it would be nice to have a message too.

EDIT 2: I came to know that the problem wasn't the resources starting up, but using dbPoll is, using it while joining causes this.

Posted

hmmmmm

try to use this:

addEventHandler("onPlayerConnect", getRootElement(), 
function () 
cancelEvent(true, "Welcome to my server") 
                end          
end 

Posted
hmmmmm

try to use this:

addEventHandler("onPlayerConnect", getRootElement(), 
function () 
cancelEvent(true, "Welcome to my server") 
                end          
end 

This is exactly the same code. Nothing changed here.

Posted
hmmmmm

try to use this:

addEventHandler("onPlayerConnect", getRootElement(), 
function () 
cancelEvent(true, "Welcome to my server") 
                end          
end 

lol it's the same as iLol's code just changed the text and made an espace to end xD

Posted

Its not the same ...

There is an "end" too much and a ")" is missing at the end.

It won't even work :D

But I had the same issue and could never fix it.

Still don't know why I had this problem.

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