• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Request function

Coca Cola

New Member
Joined
Apr 10, 2010
Messages
164
Reaction score
0
Hey everyone, someone could help me with this?
I need a function like getItemNameById , because in my server , i am used to change the name of the item,and with this function, i pretend to do something like like this:
you use an stone on the item , then the item get the original name by the id,
ex:. you see a lunar staff (Power +5) , now you use the stone : you see a lunar staff




ty ,cya
 
Code:
function getItemNameById(id)
	return getItemInfo(id).name and getItemInfo(id).name or ''
end
 
Last edited:
what's wrong?

Code:
function onSay(cid, words, param, channel)
 if(param == "a") then
 doPlayerSendCancel(cid, "You have to type name.")
 return true 
end 
local pos = getCreatureLookPosition(cid)
 pos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE 
local item = getThingFromPos(pos).uid
local p = param
local v = getItemNameById(item)
 if(item) then doItemSetAttribute(item, "name", " .. v .. ") 
end 
return true
 end
 
it's id not uid, for getItemNameById, so you should use .itemid and not .uid from the "item" var ^.^
 
Back
Top