The name is just an example, you can use any valid name, and don't worry about the case(lower/upper). This is an easier way to use the /newtype command to change of outfit.eace:
You can write either the outfit looktype number or the outfit name:$
...etc
Install my OutfitLIB from here:
http://otland.net/f163/0-6-outfitlib-get-name-any-outfit-099-outfits-lua-91436/
And this is the modified newtype.lua, with a funny effect
this is the main function that was used:
You can write either the outfit looktype number or the outfit name:$
HTML:
/newtype YaLaHaRi
/newtype DOG
/newtype Jester
/newtype dragon
/newtype wArmaster
/newtype gamemaster
/newtype 99
Install my OutfitLIB from here:
http://otland.net/f163/0-6-outfitlib-get-name-any-outfit-099-outfits-lua-91436/
And this is the modified newtype.lua, with a funny effect
Lua:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Command requires param.')
return true
end
local t = string.explode(param, ',')
if tonumber(t[1]) then
t[1] = tonumber(t[1])
elseif tostring(t[1]) then
t[1] = getOutfitLookTypeByName(t[1])
end
if not t[1] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Command requires valid param.')
return true
end
local pid = cid
if(t[2]) then
pid = getPlayerByNameWildcard(t[2])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Player ' .. t[2] .. ' not found.')
return true
end
end
if not isOutfit(t[1]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Such outfit does not exist.')
return true
end
doSendMagicEffect(getThingPos(pid),2)
addEvent(doCreatureChangeOutfit, 10, pid, {lookType = t[1]})
return true
end
this is the main function that was used:
Lua:
function getOutfitLookTypeByName(name)
t, name = '', string.fix(name)
if not tostring(name) or tonumber(name) then
return error[5]
end
for i, j in pairs(list) do
if name == j then
t = i
break
else
t = setup.XML:match('lookType="(%d+)"%s*name="'..name..'"/>')
end
end
return not tonumber(t) and error[5] or t
end
Last edited: