• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction /newtype demon, using the OutfitLIB:099-outfits.lua

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
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.:peace:

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
...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 :D
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:
/newtype mudkipz
elf should commit:wub:
 
nvm all errors fixed
 
Last edited:
ye :p thanks for teh string function
 
Last edited:
A yea, also:
Code:
doSendMagicEffect(getPlayerPosition(pid),2)

Would be nice to use constant here, instead of 2.
 
A yea, also:
Code:
doSendMagicEffect(getPlayerPosition(pid),2)
Would be nice to use constant here, instead of 2.
looolool its the same shit thats why they are called CONSTANTS
 
What if effects will be changed some day? Your script will send another effect instead of desired one, it's better to use loooooooool!
 
hsuhsushuhag it will be always the same, and if it happens players ask for support here and i fix it
 
amg you made me talk :ninja:
0.2.1
CONST_ME_POFF = 2
0.2.2
CONST_ME_POFF = 2
0.2.3
CONST_ME_POFF = 2
0.2.4
CONST_ME_POFF = 2
0.2.5
CONST_ME_POFF = 2
0.2.7
CONST_ME_POFF = 2
0.2pl11
CONST_ME_POFF = 2
0.2pl12
CONST_ME_POFF = 2
0.2pl13
CONST_ME_POFF = 2
0.2pl14
CONST_ME_POFF = 2
0.2pl15
CONST_ME_POFF = 2
0.2pl16
CONST_ME_POFF = 2
0.2pl17
CONST_ME_POFF = 2
0.2pl18
CONST_ME_POFF = 2
0.2pl19
CONST_ME_POFF = 2
0.2pl20
CONST_ME_POFF = 2
0.2pl21
CONST_ME_POFF = 2
0.2pl22
CONST_ME_POFF = 2
0.2pl23
CONST_ME_POFF = 2
0.3.2
CONST_ME_POFF = 2
0.3.3
CONST_ME_POFF = 2
0.3.4
CONST_ME_POFF = 2
0.3.4pl2
CONST_ME_POFF = 2
0.3.5
CONST_ME_POFF = 2
0.3.6
CONST_ME_POFF = 2
0.3.6pl1
CONST_ME_POFF = 2
..etc

i'm not a liar:
[forgottenserver] Index of /tags

do you think it will change in a century?:mad::peace:
 
Why did u post const of all versions? Do you think I don't know them or what? And it's only for let's say "security reasons".

" thumbz up, men "
 
whatever:p
:peace:
@THREAD
all bugs fixed, use OutfitLIB 0.6 :wub:
 
Last edited:
Back
Top