What's new

Transform-problem

Joined
Apr 27, 2008
Messages
15
Reaction score
0
Witam
Mam problem z transfem.
Uzywam tego skryptu:
Do Talkaction.xml dodaje:
Kod:
<talkaction words="!transform" script="transform.lua"/>

A do folderu data/talkaction/scripts/tranform.lua
Kod:
-- Transformation System by Piotrek1447
local configuration =
{
playerVocation = {1, 2, 5, 6},
playerNewVocation = 9,
playerNewLookType = 12,
playerLevel = 10,
manaCost = 100,
soulCost = 2,
timeActive = 10
}
local VOCATION_STORAGE = 10000
local outfit = {lookType = configuration.playerNewLookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
function onSay(cid, words, param)
if(isInArray(configuration.playerVocation, getPlayerVocation(cid)) == TRUE) then
if(getPlayerLevel(cid) >= configuration.playerLevel) then
if(getPlayerMana(cid) >= configuration.manaCost) then
if(getPlayerSoul(cid) >= configuration.soulCost) then
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
doPlayerSetVocation(cid, configuration.playerNewVocation)
doPlayerAddMana(cid, - configuration.manaCost)
doPlayerAddSoul(cid, - configuration.soulCost)
doSetCreatureOutfit(cid, outfit, configuration.timeActive * 1000)
addEvent(transformBack, configuration.timeActive * 1000, cid)
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required soul points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required mana points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required level.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.")
end
end
function transformBack(cid)
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
end

Wszystko ladnie,pieknie tylko jak trans zniknie to nie da sie spowrotem zamienic bo numer voc sie zmienia na zawsze.(zwykly kina voc=4 a super kina voc=8 i te 8 zostaje)Jak zrobic zeby voc wracalo tak jak bylo przed transfem ?? Pomozcie plz.
 

Qeenty

User
Joined
Aug 18, 2008
Messages
19
Reaction score
0
Odp: Transform-problem

Wg mnie w playerVocation = {1, 2, 5, 6},i w miejscach 1,2,5,6 to dodaj te 8 i wtedy powinno dzia?a? [niejestem pewien do ko?ca ale spr?buj]
 
Joined
Apr 27, 2008
Messages
15
Reaction score
0
Odp: Transform-problem

Wtedy da sie zrobic transfa drugi raz itd ale nie wraca do voc=4.;/
 

gicu0770

Active User
Joined
Aug 12, 2008
Messages
116
Reaction score
15
Odp: Transform-problem

Postaram sie Ci pomuc:
Zastosuj moj skrypt raczej 2
wiec tak:
Linijka do talkaction.xml:
<talkaction words="trans" script="trans.lua" />
----I nastepnie scripts, dodaj plisk trans.lua
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
local lvl = 8
local voc = 2 --w jaki voc nas zmienia
local outfit = {lookType=118,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}
local outfitTime = 99999999
local napis = "AAAAAaaaaaa!!!" -- Jaki napis sie ma pojawic w nawiasie.
local effekt = 12 -- Jaki efekt ma sie pojawic po wpisaniu czaru.
local pos = getPlayerPosition(cid)

if getPlayerVocation(cid) == 1 --wymagany VOC and getPlayerLevel(cid) >= lvl then
doSetCreatureOutfit(cid, outfit, outfitTime)
doPlayerSetVocation(cid,voc)
doPlayerSay(cid,napis,16)
doSendMagicEffect(pos,12)
else
end

I 2 skrypt na powrot do poprzedniego VOC: skrypt na odwrut UP/
Talkaction.xml
<talkaction words="revert" script="revert.lua" />
i Scripts revert.lua
function onSay(cid, words, param)
playerpos = getPlayerPosition(cid)
local lvl = 1
local voc = 1
local outfit = {lookType=118,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}
local outfitTime = 99999999
if getPlayerVocation(cid) == 2 and getPlayerLevel(cid) >= lvl then
doSetCreatureOutfit(cid, outfit, outfitTime)
doPlayerSetVocation(cid,voc)
else
end
return 1
end
@Jesli bedzie cos zle pisz!
SKRYPT NIE MOJ MAM GO JUZ DAWNO Z JAKIEGOS FORUM
 

AoW2

Active User
Joined
Dec 26, 2008
Messages
131
Reaction score
8
Odp: Transform-problem

@up Dzi?ki zaraz go przetestuje bo go szuka?em xD

Edit: Niestety nie dzia?a ...
 

dram

Active User
Joined
Apr 6, 2008
Messages
70
Reaction score
6
Odp: Transform-problem

O ludzie:p Szkoda ,?e posty by?y usuwane, bo ja kiedy? robi?em transform, mo?e kto? ma?

Wtedy jako 1 zrobi?em transform. Pozdro.
 

AoW2

Active User
Joined
Dec 26, 2008
Messages
131
Reaction score
8
Odp: Transform-problem

Dram napewno ^^ uwie?? ci xD
 
Top