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

Current Outfit -> XML Line (For making NPCs)

Synthetic_

deathzot.net
Joined
Dec 30, 2008
Messages
2,535
Reaction score
574
I make a lot of custom NPC's in my server and it's pretty annoying to get your colors through the database or whatever. So I made a simple talkaction to create the XML line that is used in the NPC's xml.

outfit.lua
Code:
function onSay(cid, words, param)
local o = getCreatureOutfit(cid)
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "<look type =\"".. o.lookType .."\" head =\"".. o.lookHead .."\" body =\"".. o.lookBody .."\" legs =\"".. o.lookLegs.."\" feet =\"".. o.lookFeet .."\" addons =\"".. o.lookAddons .."\"/>")
end

talkactions.xml
Code:
    <talkaction log="yes" access="5" words="/looktype" event="script" value="outfit.lua"/>

MQwRd.png
 
Last edited:
Very nice! I use. Thank you!

Is possible add mount?
yes possible to add mount :p
here you are
Lua:
function onSay(cid, words, param)
local o = getCreatureOutfit(cid)
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "<look type =\"".. o.lookType .."\" head =\"".. o.lookHead .."\" body =\"".. o.lookBody .."\" legs =\"".. o.lookLegs.."\" feet =\"".. o.lookFeet .."\" addons =\"".. o.lookAddons .."\" mount =\"".. o.lookMount .."\"/>")
end
 
If it's any good to anybody, I edited the code to allow a param.
IE. /looktype Red

Lua:
function onSay(cid, words, param)
	if(param == '') then
		local o = getCreatureOutfit(cid)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "<look type =\"".. o.lookType .."\" head =\"".. o.lookHead .."\" body =\"".. o.lookBody .."\" legs =\"".. o.lookLegs.."\" feet =\"".. o.lookFeet .."\" addons =\"".. o.lookAddons .."\" mount =\"".. o.lookMount .."\"/>")
	else
		local o = getCreatureOutfit(getPlayerByNameWildcard(param))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "<look type =\"".. o.lookType .."\" head =\"".. o.lookHead .."\" body =\"".. o.lookBody .."\" legs =\"".. o.lookLegs.."\" feet =\"".. o.lookFeet .."\" addons =\"".. o.lookAddons .."\" mount =\"".. o.lookMount .."\"/>")		
	end
	return true
end

Great release though ;)
Red
 
Which the diff from the other one? I didnt get it

If it's any good to anybody, I edited the code to allow a param.
IE. /looktype Red

Lua:
function onSay(cid, words, param)
	if(param == '') then
		local o = getCreatureOutfit(cid)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "<look type =\"".. o.lookType .."\" head =\"".. o.lookHead .."\" body =\"".. o.lookBody .."\" legs =\"".. o.lookLegs.."\" feet =\"".. o.lookFeet .."\" addons =\"".. o.lookAddons .."\" mount =\"".. o.lookMount .."\"/>")
	else
		local o = getCreatureOutfit(getPlayerByNameWildcard(param))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "<look type =\"".. o.lookType .."\" head =\"".. o.lookHead .."\" body =\"".. o.lookBody .."\" legs =\"".. o.lookLegs.."\" feet =\"".. o.lookFeet .."\" addons =\"".. o.lookAddons .."\" mount =\"".. o.lookMount .."\"/>")		
	end
	return true
end

Great release though ;)
Red
 
Which the diff from the other one? I didnt get it

It provides an *optional* param if you'd like to get the XML output of the looktype of a player on your server as opposed to the character you're on.
Like if you saw a player wearing an outfit you think would make for a great new NPC outfit you can use /looktype playerName.

That's all.
Red
 
Back
Top