What's new

Creaturescripts Looktype dla danej profesji (przydane do Dragon Balla, Naruto, RPG)

Status
Not open for further replies.

DanJ93

ElfBot Helper
Joined
Jan 18, 2009
Messages
2,631
Reaction score
200
Skrypt polega na tym ?e do ka?dej profesji mo?emy przypisa? sobie osobny outfit.

config.lua
PHP:
allowChangeOutfit = false
data/creaturescripts/creaturescripts.xml
PHP:
    <event type="login" name="Outfitek" event="script" value="outfitek.lua"/>
data/creaturescripts/scripts/login.lua
PHP:
    registerCreatureEvent(cid, "Outfitek")
tworzymy outfitek.lua w data/creaturescripts/
  • v1
PHP:
function onLogin(cid) 
local outfity = {
	[1] = {121},
	[2] = {122},
	[3] = {123}
				}
local i = 1, #outfity
if getPlayerVocation(cid) == outfity[i] then 
doSetCreatureOutfit(cid, outfity[i][1], -1) 
end 
return true 
end
[1], [2], [3] id profesji
121, 122, 123 outfit dla danej profesji

  • v2
PHP:
function onLogin(cid) 
local outfity = {
	[1] = {121, 141},
	[2] = {122, 142},
	[3] = {123, 143}
				}
local i = 1, #outfity
if getPlayerVocation(cid) == outfity[i] then
if getPlayerSex(cid) == 1
doSetCreatureOutfit(cid, outfity[i][1], -1)
else
doSetCreatureOutfit(cid, outfity[i][2], -1)
end 
return true 
end
[1], [2], [3] id profesji
121, 122, 123 outfit dla m??czyzn
141, 142, 143 outfit dla kobiet
 

Miziak

Advanced User
Joined
Sep 16, 2008
Messages
175
Reaction score
27
Odp: Looktype dla danej profesji (przydane do Dragon Balla, Naruto, RPG)

Na prawd? nie wiem po choler? ta p?tla to po pierwsze, po 2 w tablicy konfiguracyjnej nie rozumiem pomys?u tworzenia tablicy przypisanej danemu indeksowi w kt?rej jest tylko jedna warto??, po trzecie w tablicy brakuje przecink?w poprawia?em:

Code:
local outfity = {  
    [1] = 121,
    [2] = 122, 
    [3] = 123
}

function onLogin(cid)   
	local v = getPlayerVocation(cid)
	if(outfity[v] ~= nil)then   
		doSetCreatureOutfit(cid, outfity[v], -1)   
	end
	return true   
end

Regards.
 

Dantez

Moim sekretem jest ciasto
Joined
May 22, 2008
Messages
1,206
Reaction score
202
Odp: Looktype dla danej profesji (przydane do Dragon Balla, Naruto, RPG)

Brakowa?o jeszcze 'do' i 'end'
 

Arkam

Forum friend
Joined
Dec 20, 2008
Messages
1,980
Reaction score
180
Odp: Looktype dla danej profesji (przydane do Dragon Balla, Naruto, RPG)

a '?er ys mad?ik funkszyn?'
Co nam da ten skrypt skoro mozemy zmieniac outfity?;s dodaj blokade zmiany outfitow
iszluz xd
 

Dantez

Moim sekretem jest ciasto
Joined
May 22, 2008
Messages
1,206
Reaction score
202
Odp: Looktype dla danej profesji (przydane do Dragon Balla, Naruto, RPG)

config.lua
allowChangeOutfit = false
 

DanJ93

ElfBot Helper
Joined
Jan 18, 2009
Messages
2,631
Reaction score
200
Odp: Looktype dla danej profesji (przydane do Dragon Balla, Naruto, RPG)

Drobne poprawki,
dodano wersj? 2
 
Status
Not open for further replies.
Top