Addon doll

Status
Zamknięty.

mcfly

Advanced User
Zarejestrowany
Dołączył
Marzec 12, 2009
Posty
163
Liczba reakcji
12
Potrzebuj? skryptu na addon doll. Ale nie tak? co daje addon, tylko tak? co zamienia outfit na podany dop?ki sie nie zmieni na inny lub nie wyloguje.

:D
 
Odp: Addon doll

W data/actions/scripts tworzysz plik addondoll.lua, a w ni
PHP:
-- Date: 2010-07-25
-- By Piaskillers
local outfit = {male = 128, female = 136} -- Id outfit?w male - facet, female - babka
local nazwa = Citizen -- nazwa outfitu (opcjonalnie)
local plec = getPlayerSex(cid)
function onUse(cid, item, frompos, item2, topos)
    if plec == 0 then
    doPlayerChangeOutfit(cid, outfit.female)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Gratulacje zmieniles outfit na " .. nazwa .. "a.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLUE)
    else
    doPlayerChangeOutfid(cid, outfit.male)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Gratulacje zmieniles outfit na " .. nazwa .. "a.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLUE)
	return TRUE
end
 
Odp: Addon doll

A jak do tego zrobi? ?e losuje outfity (chodzi mi tutaj nie o same outfity tylko raczej o wygl?dy potwork?w)
 
Odp: Addon doll

PHP:
-- Date: 2010-07-25
-- By Piaskillers
local outfit = {male = {id outfitu, id outfitu, id outfitu}, female = {id outfitu, id outfitu, id outfitu}} -- Id outfit?w male - facet, female - babka
local zmiana = {facet = math.random(cid,outfit.male), babka = math.random(cid,outfit.female)}
local plec = getPlayerSex(cid)
function onUse(cid, item, frompos, item2, topos)
    if plec == 0 then
    doPlayerChangeOutfit(cid, zmiana.babka)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Gratulacje zmieniles outfit!.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLUE)
    else
    doPlayerChangeOutfit(cid, zmiana.facet)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Gratulacje zmieniles outfit!.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLUE)
    return TRUE
end

Nie testowalem ale mysle ze bedzie dzia?ac.
 
Ostatnia edycja:
Odp: Addon doll

Eh.. Chodzi o to ?e mam np. tablice outfits = {127, 123, 244}
i wybiera losowo jaki? looktype, potem zmienia w?a?nie na ten looktype.
Widzia?em kiedy? takie co? ale nie moge znale??, jest ten skrypt w wi?kszo?ci ots?w z du?ym expem zwane jako "outfit doll". Z g?ry dzi?ki.
 
Odp: Addon doll

Przecie? tak zrobi?em. Przej?yj i uzupe?nij skrypt.
PHP:
{male = {id outfitu, id outfitu, id outfitu}, female = {id outfitu, id outfitu, id outfitu}}
Dodajesz id outfit?w i losowo dostajesz out.
 
Odp: Addon doll

Zale?y mi troche o optymalizacji i to z p?ci? jest zb?dne po mojej edycji wychodzi tak:

local outfit = {1, 2, 3}
local zmiana = math.random(cid,outfit)

function onUse(cid, item, frompos, item2, topos)
doPlayerChangeOutfit(cid, zmiana)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLUE)
return TRUE
end

no i nie dzia?a
b??d :

cotam.png
 
Odp: Addon doll

Spr?buj u?y? funkcji "doSetCreatureOutfit(cid, outfit, time)" zamiast "doPlayerChangeOutfit(cid, outfit)"
 
Odp: Addon doll

Niestety ?adne nie dzia?a ale znalaz?em ten skrypt w jakim? evo.
Dla tych co chc?
local outfits = {5, 6, 7, 8, 9, 15, 18, 23, 24, 25, 29, 33, 37, 40, 48, 50, 53, 54, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 76, 78, 93, 96, 97, 98, 100, 126, 127, 193,
194, 195, 196, 203, 214, 215, 216, 229, 232, 235, 237, 246, 249, 253, 254, 255, 259, 260, 264, 281, 282, 287, 296, 297, 298, 300, 301}
local outfit =
{
lookType = 2,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0
}
local outfit0 =
{
lookType = 2,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,1921) == -1 or getPlayerStorageValue(cid,1921) == #outfits then
setPlayerStorageValue(cid,1921,1)
doSetCreatureOutfit(cid, outfit0, -1)
else
for i=1,#outfits do
if getPlayerStorageValue(cid,1921) == i then
outfit.lookType = outfits
doSetCreatureOutfit(cid, outfit, -1)
setPlayerStorageValue(cid,1921,i+1)
break
end
end
end
end


Za ch?ci rep++
 
Status
Zamknięty.
Back
Do góry