Jump to content

Using chat to Login [HELP?]


Recommended Posts

Is there a script that allows the player as few as you are logged into your account can use the Chat?

For example: Login to your account to use chat

addEventHandler( "onPlayerChat", getRootElement(), sendMessageToNearbyPlayers ) 
  
function blockChatMessage() 
    cancelEvent() 
end 
-- attach it as a handler to onPlayerChat 
addEventHandler( "onPlayerChat", getRootElement(), blockChatMessage ) 

Something like this

Link to comment
addEventHandler("onPlayerChat", root,  
    function()  
    local account = getPlayerAccount( source ); 
        if ( not isGuestAccount(account) ) then 
        return 
        else 
        outputChatBox("Login to your account to use chat", source); 
        end 
    end 
); 

Link to comment
addEventHandler("onPlayerChat", root,  
    function()  
    local account = getPlayerAccount( source ); 
        if ( not isGuestAccount(account) ) then 
        return 
        else 
        outputChatBox("Login to your account to use chat", source); 
        end 
    end 
); 

You never canceled the event.

addEventHandler("onPlayerChat", root, function()  
    local account = getPlayerAccount( source ); 
    if ( isGuestAccount(account) ) then 
        outputChatBox("Login to your account to use chat", source); 
        cancelEvent ( ); 
    end 
end ); 

Link to comment
addEventHandler("onPlayerChat", root,  
    function()  
    local account = getPlayerAccount( source ); 
        if ( not isGuestAccount(account) ) then 
        return 
        else 
        outputChatBox("Login to your account to use chat", source); 
        end 
    end 
); 

You never canceled the event.

addEventHandler("onPlayerChat", root, function()  
    local account = getPlayerAccount( source ); 
    if ( isGuestAccount(account) ) then 
        outputChatBox("Login to your account to use chat", source); 
        cancelEvent ( ); 
    end 
end ); 

I forgot cancelEvent :D, thanks

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