Jump to content

Function


CapY

Recommended Posts

Posted
function outputOnLogin (thePlayer, current_account ) 
    outputConsole(getPlayerName(thePlayer)).." Logged into "..getAccountName(current_account))  
end 
addEventHandler("onClientLogin",getRootElement(),outputOnLogin )  

Error : unexpected symbol near '..' in first line

Posted
outputConsole(getPlayerName(thePlayer).." Logged into "..getAccountName(current_account)) 

Seriously, not every problem you encounter you post it here, try something yourself first.

Posted

Hmm .. no errors on debug , but still alert is not displayed in the chatbox a when player logins.

function outputOnLogin (thePlayer, current_account ) --when a player logs in 
    outputChatBox(getPlayerName(thePlayer).." Logged into "..getAccountName(current_account),getRootElement(),255,0,0, true) 
end 
addEventHandler("onClientLogin",getRootElement(),outputOnLogin )  

Posted

There is no such event. Use onPlayerLogin. If this is your custom event then make sure you trigger it properly.

Posted

Maybe because is onPlayerLogin not onClientLogin?

function outputOnLogin (thePlayer, current_account ) --when a player logs in 
    outputChatBox(getPlayerName(thePlayer).." Logged into "..getAccountName(current_account),getRootElement(),255,0,0, true) 
end 
addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin )  

Posted

Bump*

I've never seen that error and then i dont know how to fix it.

local root = getRootElement() 
  
addEventHandler("onPlayerLogin", root, 
  function(thePlayer,current_account) 
  outputChatBox(getPlayerName(thePlayer).." has logged into"..getAccountName(current_account), root,255,0,0, true) 
  end) 

attempt to concatenate a boolean value  

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