Hello guys.
I have a script that finds every single item by finding its ID,
Here it is.
that ingame returns:
The problem is....
I'm trying to return a 'UID' value, to add it on scripts.
I've tried to add this line, but it returns errors:
or getItemAttribute(coisas.uid,"uid") etc.
If you guys know a way to fix and return the UID, fixed by other command, I'll be grateful.
PS: My vip npc, adds a UID value in every vip item, that he sells. Like this -> setItemAttribute(item,"uid", math.random(00001,65355))
So I want to see that number returned by command, and not only by looking with GM.
Sorry bout english, Imma brazilian.
I have a script that finds every single item by finding its ID,
Here it is.
HTML:
function onSay(cid, words, param)
local coisas = db.getResult("SELECT `player_id` FROM `db`.`player_items` WHERE `itemtype` = '".. param .."';")
if (coisas:getID() ~= -1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Players with item = ID: ".. param .." (".. getItemNameById(param) ..").")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "------------------------------")
contador = 1
repeat
local paes = db.getResult("SELECT `name` FROM `db`.`players` WHERE `id` = '" ..coisas:getDataInt("player_id") .."';")
local xaxa = paes:getDataString("name")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "".. contador ..". ".. xaxa .."")
contador = contador + 1
until not coisas:next()
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "------------------------------")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bad parameters or nobody has the item.")
return TRUE
end
end
that ingame returns:
Code:
23:52 Players with item = ID: 7424 (lunar staff).
23:52 ------------------------------
23:52 1. God New
23:52 2. Gabi Luthai
23:52 3. Terrorist
23:52 4. Weed Smoker
23:52 -----------------------------
The problem is....
I'm trying to return a 'UID' value, to add it on scripts.
I've tried to add this line, but it returns errors:
Code:
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "".. contador ..". ".. xaxa .." ".. getItemAttribute(param.uid,"uid") .."")
or getItemAttribute(coisas.uid,"uid") etc.
If you guys know a way to fix and return the UID, fixed by other command, I'll be grateful.
PS: My vip npc, adds a UID value in every vip item, that he sells. Like this -> setItemAttribute(item,"uid", math.random(00001,65355))
So I want to see that number returned by command, and not only by looking with GM.
Sorry bout english, Imma brazilian.