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

Lua Outfit-website-shop-php

Ns Sparkz

Just a Normal Ns King
Joined
Mar 6, 2011
Messages
466
Reaction score
25
Location
Egypt
I want Outfit Id "1" For Certain Vocation.. ---------------------- Am Done With it
And Outfit 3 For Second Promotion :( how could i do that?
HTML:
<?xml version="1.0"?>
<outfits>
	<outfit id="1">
		<list gender="0" lookType="5" name="Orc"/>
		<list gender="1" lookType="5" name="Orc"/>
	</outfit>

	<outfit id="2"> premium="yes" default="0">
		<list gender="0" lookType="8" name="Orc Berserker"/>
		<list gender="1" lookType="8" name="Orc Berserker"/>
	</outfit>

	<outfit id="3"> premium="yes" default="0">
		<list gender="0" lookType="2" name="Orc Leader"/>
		<list gender="1" lookType="2" name="Orc Leader"/>
	</outfit>

Second thing.

<< Need this.
I want to Remove The Normal Vocs And Add Mine.

Third - Shop
-- FIXED BY polat_alemdar
Please Help,And i Rep.
 
Last edited:
Here is a sample, dunno if it works:

Creaturescripts.xml
XML:
	<event type="outfit" name="VocOutfit" event="script" value="vocoutfit.lua"/>

Creaturescripts/scripts:
Lua:
function onOutfit(cid, old, current)
	local outfits = {
		sorcerersOutfits = {128, 136},
		druidsOutfits = {128, 136},
		paladinsOutfits = {128, 136},
		knightsOutfits = {128, 136}
	}
 
	if(isSorcerer(cid)) then
		if(isInArray(sorcerersOutfit, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return true
		end
	elseif(isDruid(cid)) then
		if(isInArray(druidssOutfit, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return true
		end
	elseif(isPaladin(cid)) then
		if(isInArray(palaindsOutfit, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return true
		end
	elseif(isKnight(cid)) then
		if(isInArray(knightsOutfit, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return true
		end
	end
    return true
end

Register it in login.lua, else it wont work.

creaturescript/scripts/login.lua:
Under
Lua:
	registerCreatureEvent(cid, "ReportBug")
put
Lua:
	registerCreatureEvent(cid, "VocOutfit")

done
 
Last edited:
Didnt Work
Vocoutfit.lua:9: in function Etc.
Look what i changed.

function onOutfit(cid, old, current)
local outfits = {
sorcerersOutfits = {8, 8},
druidsOutfits = {128, 136},
paladinsOutfits = {128, 136},
knightsOutfits = {128, 136}
}

if(isOrc(cid)) then
if(isInArray(orcsOutfit, current.lookType)) then
doCreatureChangeOutfit(cid, current)
return true
end
elseif(isDruid(cid)) then
if(isInArray(druidssOutfit, current.lookType)) then
doCreatureChangeOutfit(cid, current)
return true
end
elseif(isPaladin(cid)) then
if(isInArray(palaindsOutfit, current.lookType)) then
doCreatureChangeOutfit(cid, current)
return true
end
elseif(isKnight(cid)) then
if(isInArray(knightsOutfit, current.lookType)) then
doCreatureChangeOutfit(cid, current)
return true
end
end
return true
end
 
Last edited:
Oh ... You don't have any function that is called "isOrc"... Go to your lib/031-vocation.lua and put this:
Code:
function isOrc(cid)
	return isInArray({[COLOR="#B22222"]1, 5[/COLOR]}, getPlayerVocation(cid))
end
- Change the red to all orc vocation ids.

under
Lua:
function isSorcerer(cid)
	return isInArray({1, 5}, getPlayerVocation(cid))
end
 
That script isn't giving you the outfit. It just makes you not change your outfit to anything else than the looktypes you choosed for that certain vocation.

If you want a script that is giving you the outfit, you can do a "onLogin" script that gives the player that outfit you want when first login.

Lua:
function onLogin(cid)
	local storage = 111
	local orcLooks = {8, 12} -- If you only want looktype 8 then remove ", 12" so it is like "{8}"
	local elfLooks = {8, 12} -- I dont know elfs looktype...
	if(getPlayerStorageValue(cid, storage) < 0) then
		if(isOrc(cid)) then
			for i = 1, #orcLooks do
				doPlayerAddOutfit(cid, orcLooks[i])
			end
		elseif(isElf(cid)) then
			for i = 1, #elfLooks do
				doPlayerAddOutfit(cid, elfLooks[i])
			end
		end
		setPlayerStorageValue(cid, storage, 1)
	end
	return true
end
 
Oh... -.-
First of all:

1. Make 2 ".lua" files into creaturescripts/scripts.
2. Call 1 of them "vocoutfit.lua" and the other "vocloginoutfit.lua".
3. Paste this in into "vocoutfit.lua":
Lua:
function onOutfit(cid, old, current)
	local sorcerersOutfits = {5, 4}
	local druidsOutfits = {62, 64}
	local paladinsOutfits = {128, 136}
	local knightsOutfits = {128, 136}
 
	if(isSorcerer(cid)) then
		if not(isInArray(sorcerersOutfits, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return false
		end
	elseif(isDruid(cid)) then
		if not(isInArray(druidssOutfits, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return false
		end
	elseif(isPaladin(cid)) then
		if not(isInArray(palaindsOutfits, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return false
		end
	elseif(isKnight(cid)) then
		if not(isInArray(knightsOutfits, current.lookType)) then
			doCreatureChangeOutfit(cid, current)
			return false
		end
	end
    return true
end

4. Put this into "vocloginoutfit.lua":
Lua:
function onLogin(cid)
	local storage = 111
	local orcLooks = {5, 4} -- If you only want looktype 8 then remove ", 12" so it is like "{8}"
	local elfLooks = {62, 64} -- I dont know elfs looktype...
	
	if(getPlayerStorageValue(cid, storage) < 0) then
		if(isSorcerer(cid)) then
				doCreatureChangeOutfit(cid, {lookType = orcLooks[1], lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
			for i = 1, #orcLooks do
				doPlayerAddOutfit(cid, orcLooks[i], 1)
			end
		elseif(isDruid(cid)) then
				doCreatureChangeOutfit(cid, {lookType = elfLooks[1], lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
			for i = 1, #elfLooks do
				doPlayerAddOutfit(cid, elfLooks[i], 1)
			end
		end
		setPlayerStorageValue(cid, storage, 1)
	end
	return true
end

5. Paste these two into creaturescripts/creaturescripts.xml:
XML:
 <event type="outfit" name="VocOutfit" event="script" value="vocoutfit.lua"/>
 <event type="login" name="VocLoginOutfit" event="script" value="vocloginoutfit.lua"/>

6. And these into login.lua:
Lua:
registerCreatureEvent(cid, "VocOutfit")
registerCreatureEvent(cid, "VocLoginOutfit")

...
 
Last edited:
[error - Creaturescripts Interface]
Data/Creaturescripts/scripts/vocloginoutfit.lua:eek:n login
Description:
<luaDoplayeraddoutfit> Player not Found
 
Back
Top