Malganys21 Posted May 12, 2015 Posted May 12, 2015 Buenas, como dice el título, ese es mi problema. Aquí está el código: function imprimir(player, cmd, dinero) triggerClientEvent(player, "modificarmasa", player, masa) outputChatBox("Se han imprimido $" .. dinero.. " pesos") end addCommandHandler("imprimir", imprimir) local antiguamasa = 0 function modificarmasa(dinero) if antiguamasa < 1 then masatotal = dinero else masatotal = antiguamasa + dinero end guiSetText(masa, "Masa monetaria: $" .. tostring(masatotal)) antiguamasa = tonumber(masatotal) end addEvent("modificarmasa", true) Espero puedan ayudarme, saludos.
Tomas Posted May 12, 2015 Posted May 12, 2015 IMPRIMIDO??!?!?!?! local antiguamasa = 0 function modificarmasa(dinero) if antiguamasa < 1 then masatotal = dinero else masatotal = antiguamasa + dinero end guiSetText(masa, "Masa monetaria: $" .. tostring(masatotal)) antiguamasa = tonumber(masatotal) end addEvent("modificarmasa", true) addEventHandler("modificarmasa", resourceRoot, modificarmasa)
Malganys21 Posted May 12, 2015 Author Posted May 12, 2015 IMPRIMIDO??!?!?!?! Gracias por la ayuda. Y sí, imprimido. http://www.rae.es/consultas/dobles-participios-imprimidoimpreso-freidofrito-proveidoprovisto
Enargy, Posted May 12, 2015 Posted May 12, 2015 Nunca enviaste el valor 'dinero' al client. function imprimir(player, cmd, dinero) if not dinero then return end if ( type(dinero) == "number" ) then triggerClientEvent(player, "modificarmasa", player, dinero); outputChatBox("Se han imprimido $" .. dinero.. " pesos"); end end addCommandHandler("imprimir", imprimir)
Malganys21 Posted May 12, 2015 Author Posted May 12, 2015 Nunca enviaste el valor 'dinero' al client. function imprimir(player, cmd, dinero) if not dinero then return end if ( type(dinero) == "number" ) then triggerClientEvent(player, "modificarmasa", player, dinero); outputChatBox("Se han imprimido $" .. dinero.. " pesos"); end end addCommandHandler("imprimir", imprimir) Sí, me dí cuenta de ese error justo cuando postee, gracias de todas formas. Problema resuelto, gracias a los dos. Saludos.
Recommended Posts