• 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!

[Talkaction] Create item with special description

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Hio,
someone can make for me an talkaction, example:
/iex 2400, Powerful weapon

then you created item with ID 2400, and description "Powerful weapon".
Please guys, i always help if i can, i need that for an medals system


Once again, Please :3


Greetz,
Erexo.
 
Try edit the /additem function in talkactions and add something like that:
PHP:
doSetItemSpecialDescription(medal,"This medal was given to " ..getCreatureName(cid).. " for " .. reason .. ".")

You must declare the reason parameter.
I dont have distro and scripts on my computer now, but this tip what i gave to you, should work.
Use brain and imagination :)
 
LUA:
function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end

	local t = string.explode(param, ",")
	local ret = RETURNVALUE_NOERROR
	local tmp = getCreaturePosition(cid)

	local id = tonumber(t[1])
	if(not id) then
		id = getItemIdByName(t[1], FALSE)
		if(id == LUA_ERROR) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
			return TRUE
		end
	end

	local amount = 100
	if(t[2]) then
		amount = t[2]
	end

	local item = doCreateItemEx(id, amount)
	if(t[3] and getBooleanFromString(t[3]) == TRUE) then
		if(t[4] and getBooleanFromString(t[4]) == TRUE) then
			tmp = getPlayerLookPos(cid)
		end

		ret = doTileAddItemEx(tmp, item)	
	else
		ret = doPlayerAddItemEx(cid, item, TRUE)
	end

	if(ret ~= RETURNVALUE_NOERROR) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
		return TRUE
	end

	doSendMagicEffect(tmp, CONST_ME_MAGIC_RED)
	return TRUE
end

Here u are "createitem.lua" :)

My pro...
 
PHP:
function onSay(cid, words, param, channel)
		local id = 5785
        if(param == '') then
			doSetItemSpecialDescription(doPlayerAddItem(cid,id,1), ""..param.."")
			doPlayerSendTextMessage(cid, 19,"You successfully created Medal with ID: "..id..", description: \""..param.."\".")
		else
		    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must write in sentence medal description.")
        return true
		end
end

Not tested.
 
Back
Top