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

oufit for new player

Simonp1512

DBhispano
Joined
Feb 22, 2009
Messages
62
Reaction score
3
hi people.

how can i put an certain looktype for a new player i mean when login for first time then you will have that outfit or looktype? is only posible un mysql or in sqlite too? any idea thanks
 
Solution
@
Simonp1512


config.lua

Code:
allowChangeOutfit = "no"

creaturescripts/scripts/outfit.lua
Code:
ConstantOutfit = {
    {["voc"] = 1, ["outfit"] = 10},
    {["voc"] = 2, ["outfit"] = 20} -- last shouldn't have "," after }
}

function onLogin(cid)

   for i = #ConstantOutfit, 1, -1 do

    -- if player dont have vocation defined in table, returns nothing (dont go through script = dont change outfit)
        if getPlayerVocation(cid) ~= ConstantOutfit[i].voc then
        return true
        end

        if getPlayerVocation(cid) == ConstantOutfit[i].voc then
            doCreatureChangeOutfit(cid, {lookType=ConstantOutfit[i].outfit})
        end
    end

return true
end
...
Try adding this in creaturescripts/scripts/outfit.lua
Replace 150 by the outfit ID you want.

Code:
local storage = 3000

function onLogin(cid)
    if isPlayer(cid) and getCreatureStorage(cid, storage) < 0 then
        local outfit = getCreatureOutfit(cid)
        doCreatureChangeOutfit(cid, {lookType = 150}) 
        doCreatureSetStorage(cid, storage, 1)
    end
    return true
end

And this in creaturescripts.xml

Code:
<event type="login" name="newoutfit" event="script" value="outfit.lua"/>
 
oh sorry bro that is fine but i need a outfit for a certain vocation, i mean when the knight connect will have only this outfi, when the paladin connect will have only this outfit
 
@
Simonp1512


config.lua

Code:
allowChangeOutfit = "no"

creaturescripts/scripts/outfit.lua
Code:
ConstantOutfit = {
    {["voc"] = 1, ["outfit"] = 10},
    {["voc"] = 2, ["outfit"] = 20} -- last shouldn't have "," after }
}

function onLogin(cid)

   for i = #ConstantOutfit, 1, -1 do

    -- if player dont have vocation defined in table, returns nothing (dont go through script = dont change outfit)
        if getPlayerVocation(cid) ~= ConstantOutfit[i].voc then
        return true
        end

        if getPlayerVocation(cid) == ConstantOutfit[i].voc then
            doCreatureChangeOutfit(cid, {lookType=ConstantOutfit[i].outfit})
        end
    end

return true
end

creaturescripts.xml
Code:
<event type="login" name="newoutfit" event="script" value="outfit.lua"/>
 
Solution
Back
Top