Deniel Posted June 24, 2020 Share Posted June 24, 2020 addEvent("progress", true) addEventHandler("progress", getRootElement(), function(client) if (db) then local Drogas = getElementData(client, "Drogas") or 0 setElementFrozen(client, true) setPedAnimation(client, ajuste.animation.animList, ajuste.animation.animDance, ajuste.animation.timePlant, true, false, false, false) outputChatBox(ajuste.texts.plant, client, 255, 255, 255, true) setTimer(function() setElementData(client, "Drogas",getElementData(client, "Drogas") +10) outputChatBox(ajuste.textos.plantarEnd, client, 255, 255, 255, true) --dbFree(dbQuery(db, "INSERT INTO plantacao (ID, nick, marker_id) VALUES (?, ?, ?) ", getElementData(client, "ID"), getPlayerName(client), tonumber(markerTraf), 0)) end,30000, 1) setTimer (setElementFrozen, 30000, 1, client, false) end end) Um script de drogas simples. Porém não da a droga ao jogador, erro no debugscript: ERROR: [DrogaSys]Server.Lua:9: attempt to perfom arithmetic on a boolean value Link to comment
DNL291 Posted June 24, 2020 Share Posted June 24, 2020 getElementData(client, "Drogas") não está retornando o valor esperado Link to comment
Deniel Posted June 26, 2020 Author Share Posted June 26, 2020 On 24/06/2020 at 19:12, DNL291 said: getElementData(client, "Drogas") não está retornando o valor esperado Não entendi Link to comment
DNL291 Posted June 26, 2020 Share Posted June 26, 2020 Troque 'getElementData(client, "Drogas")' por Drogas na linha 9 1 Link to comment
Sucrilhex Posted June 28, 2020 Share Posted June 28, 2020 On 24/06/2020 at 17:15, Deniel said: addEvent("progress", true) addEventHandler("progress", getRootElement(), function(client) if (db) then local Drogas = getElementData(client, "Drogas") or 0 setElementFrozen(client, true) setPedAnimation(client, ajuste.animation.animList, ajuste.animation.animDance, ajuste.animation.timePlant, true, false, false, false) outputChatBox(ajuste.texts.plant, client, 255, 255, 255, true) setTimer(function() setElementData(client, "Drogas",getElementData(client, "Drogas") +10) outputChatBox(ajuste.textos.plantarEnd, client, 255, 255, 255, true) --dbFree(dbQuery(db, "INSERT INTO plantacao (ID, nick, marker_id) VALUES (?, ?, ?) ", getElementData(client, "ID"), getPlayerName(client), tonumber(markerTraf), 0)) end,30000, 1) setTimer (setElementFrozen, 30000, 1, client, false) end end) Um script de drogas simples. Porém não da a droga ao jogador, erro no debugscript: ERROR: [DrogaSys]Server.Lua:9: attempt to perfom arithmetic on a boolean value addEvent("progress", true) addEventHandler("progress", getRootElement(), function(client) if (db) then local Drogas = getElementData(client, "Drogas") or 0 setElementFrozen(client, true) setPedAnimation(client, ajuste.animation.animList, ajuste.animation.animDance, ajuste.animation.timePlant, true, false, false, false) outputChatBox(ajuste.texts.plant, client, 255, 255, 255, true) setTimer(function() setElementData(client, "Drogas", Drogas+10) outputChatBox(ajuste.textos.plantarEnd, client, 255, 255, 255, true) --dbFree(dbQuery(db, "INSERT INTO plantacao (ID, nick, marker_id) VALUES (?, ?, ?) ", getElementData(client, "ID"), getPlayerName(client), tonumber(markerTraf), 0)) end,30000, 1) setTimer (setElementFrozen, 30000, 1, client, false) end end) On 25/06/2020 at 23:40, DNL291 said: Troque 'getElementData(client, "Drogas")' por Drogas na linha 9 não vi que tinha o respondido, perdão : ) Link to comment
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