Lucario Posted May 29, 2013 Posted May 29, 2013 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 )
Castillo Posted May 29, 2013 Posted May 29, 2013 That's because "onResourceStart/Stop" has no player argument.
Lucario Posted May 29, 2013 Author Posted May 29, 2013 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 )
Castillo Posted May 29, 2013 Posted May 29, 2013 getRootElement is not a player element, read about what is it on the wiki.
Lucario Posted May 29, 2013 Author Posted May 29, 2013 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 )
Castillo Posted May 29, 2013 Posted May 29, 2013 You obviously don't read what I said, "onResourceStart/Stop" has NO PLAYER ARGUMENT.
iPrestege Posted May 29, 2013 Posted May 29, 2013 for _,key in pairs ( getElementsByType('player') ) do key = the player .
Castillo Posted May 29, 2013 Posted May 29, 2013 You don't understand what he wants, he wants to output the name of the player that started/stopped the resource.
iPrestege Posted May 29, 2013 Posted May 29, 2013 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 the chat box i think that u can modify the admin panel .
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now