Postado Novembro 13, 2017 7 anos Maybe if you use it like this ... item:setAttribute(ITEM_ATTRIBUTE_DATE, X) And then search by sql command: table player_depotitems: SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) FROM `player_depotitems` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%data%' table player_items: SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) FROM `player_items` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%data%' STYLLER OT 2022
Postado Novembro 13, 2017 7 anos Autor 5 horas atrás, luanluciano93 disse: Maybe if you use it like this ... item:setAttribute(ITEM_ATTRIBUTE_DATE, X) And then search by sql command: table player_depotitems: SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) FROM `player_depotitems` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%data%' table player_items: SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) FROM `player_items` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%data%' I do not have much experience with MySQL. How could I use it in global event, to find atribute item:setSpecialAttribute("timerOnExp", os.time()+60*60) how declare delete items, if os.time() > getSpecialAttribute("timerOnExp") ? I plan to implement it in a globalevent.xml Editado Novembro 13, 2017 7 anos por BennyDz (veja o histórico de edições)
Postado Novembro 13, 2017 7 anos First of all, you need to know how is your attribute stored. Try executing the MySQL command that luanluciano posted. For example: SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) FROM `player_items` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%timerOnExp%' After that, you'll get the results and know how the attribute is stored, then you need to figure out how to retrieve the data. If you're not able to do it yourself, post the results so we can try to help you with that. Ajudei? De nada \o/ Att Rusherzin
Postado Novembro 13, 2017 7 anos Autor 7 horas atrás, Rusherzin disse: First of all, you need to know how is your attribute stored. Try executing the MySQL command that luanluciano posted. For example: SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) FROM `player_items` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%timerOnExp%' After that, you'll get the results and know how the attribute is stored, then you need to figure out how to retrieve the data. If you're not able to do it yourself, post the results so we can try to help you with that. my results: I would appreciate your' help, since I do not know how to finish it
Postado Novembro 13, 2017 7 anos I'm not sure if it's going to work because I did not test the code. Anyway, I think you can do something like this: local TItoDelete = db.storeQuery("SELECT `player_id`,`pid`,`sid`,CONVERT(`attributes` USING latin1 ) AS `attr` FROM `player_items` WHERE CONVERT(`attributes` USING latin1 ) LIKE '%timerOnExp%'") if TItoDelete then -- if the MySQL result is not empty repeat local attrstring = result.getString(TItoDelete, "attr") -- get the attribute local attrnumber = tonumber(string.sub(attrstring, -12, string.len(attrstring)-2)) -- here I try to get only the number (I'm not sure if it will work) if (os.time() >= attrnumber) then local playerid = result.getNumber(TItoDelete, "player_id") local pid = result.getNumber(TItoDelete, "pid") local sid = result.getNumber(TItoDelete, "sid") db.storeQuery("DELETE FROM `player_items` WHERE `player_id`="..playerid.." AND `pid` = "..pid.." AND `sid` ="..sid) -- deletes item end until not result.next(TItoDelete) end By the way, this one is just an example that should work for `player_items`. Ajudei? De nada \o/ Att Rusherzin
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.