Jump to content

Little bug


Lucario

Recommended Posts

I have a little bug with a resource, when a staff start a resource, output in the chatbox, the problem is:

Bad argument @getPlayerName expected element at argument 1 got nil.

Attenpt to cancatenate a boolean value

Server side:

function displayLoadedRes ( res, thePlayer ) 
    outputChatBox ( "El Resource '#FAAAAF" .. getResourceName(res) .. "#00FF00' Ha Sido Iniciado #0000FFPor " .. getPlayerName (thePlayer), getRootElement(), 0, 255, 0, true ) 
end 
addEventHandler ( "onResourceStart", getRootElement(), displayLoadedRes ) 
  
addEventHandler ( "onResourceStop", root,  
function ( res, thePlayer ) 
    outputChatBox ( "#FF0000Maquina: El Resource '#00faaf" .. getResourceName (res) .. "#FF0000' Ha Sido Parado #0000FFPor " .. getPlayerName (thePlayer), getRootElement(), 255, 0, 0, true ) 
end  
) 

Link to comment

getRootElement() and root are the player arguments there i think, i think there are problems with the sintax of:

outputChatBox ( "El Resource '#FAAAAF" .. getResourceName(res) .. "#00FF00' Ha Sido Iniciado #0000FFPor " .. getPlayerName (thePlayer), getRootElement(), 0, 255, 0, true ) 

and

outputChatBox ( "#FF0000Maquina: El Resource '#00faaf" .. getResourceName (res) .. "#FF0000' Ha Sido Parado #0000FFPor " .. getPlayerName (thePlayer), getRootElement(), 255, 0, 0, true ) 

Link to comment

Only output the error attempt to concatenate a boolean value.

function displayLoadedRes ( res ) 
    outputChatBox ( "El Resource '#FAAAAF" .. getResourceName(res) .. "#00FF00 Ha Sido Iniciado #0000FFPor " .. getPlayerName (source), source, 0, 255, 0, true ) 
end 
addEventHandler ( "onResourceStart", root, displayLoadedRes ) 
  
addEventHandler ( "onResourceStop", root,  
function ( res ) 
    outputChatBox ( "#FF0000Maquina: El Resource '#00faaf" .. getResourceName (res) .. "#FF0000 Ha Sido Parado #0000FFPor " .. getPlayerName (source), source, 255, 0, 0, true ) 
end  
) 

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