Jump to content

Little bug


Lucario

Recommended Posts

Posted

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  
) 

560x95.png

430x73.png

Posted

That's because "onResourceStart/Stop" has no player argument.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ) 

560x95.png

430x73.png

Posted

getRootElement is not a player element, read about what is it on the wiki.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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  
) 

560x95.png

430x73.png

Posted

You obviously don't read what I said, "onResourceStart/Stop" has NO PLAYER ARGUMENT.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You don't understand what he wants, he wants to output the name of the player that started/stopped the resource.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
You don't understand what he wants, he wants to output the name of the player that started/stopped the resource.

Sorry i don't understand because it's not english :roll: the chat box i think that u can modify the admin panel .

  

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