Inquestion! Problem w skrypcie!rep++

Cgf

Advanced User
Zarejestrowany
Dołączył
Sierpień 17, 2009
Posty
334
Liczba reakcji
8
Nie dzia?aj? mi skrzynki,chocia? mam skrypt zrobiony !
To tak mam skrypt:
Actions->Script
Kod:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 1300 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found robe of the underworld.")
doPlayerAddItem(cid,8890,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1301 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Spellbook of Dark Mysteries.")
doPlayerAddItem(cid,8918,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1302 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Fireborn Giant Armor.")
doPlayerAddItem(cid,8881,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1303 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Master Archer's Armor.")
doPlayerAddItem(cid,8888,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1304 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Royal Crossbow.")
doPlayerAddItem(cid,8851,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1305 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Hellforged Axe.")
doPlayerAddItem(cid,8924,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1306 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Obsidian Truncheon.")
doPlayerAddItem(cid,8928,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1307 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Emerald Sword.")
doPlayerAddItem(cid,8930,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 1308 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Warsinger Bow.")
doPlayerAddItem(cid,8854,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
end
return 1
end
Oraz w actions.xml

Kod:
<action uniqueid="1300" script="inqchests.lua" />
<action uniqueid="1301" script="inqchests.lua" />
<action uniqueid="1302" script="inqchests.lua" />
<action uniqueid="1303" script="inqchests.lua" />
<action uniqueid="1304" script="inqchests.lua" />
<action uniqueid="1305" script="inqchests.lua" />
<action uniqueid="1306" script="inqchests.lua" />
<action uniqueid="1307" script="inqchests.lua" />
<action uniqueid="1308" script="inqchests.lua" />
A w skrzynkach mam wpisane Action id:
1300
1301
1302 itd jak w skrypcie i mi nie dzia?a ;/
ZDJ:
Mam jeszcze problem,?eby zrobi? quest na cc w temple od lvla np. wbije kto? 50 lvl b?dzie m?g? wzi?? cc, w innym temacie kto? mi napisa?:
jak chcesz ?eby skrzynka by?a od lvl to daj ID 1000+np.10=1010 i bedzie od 10 lvlu. Jak wpiszesz 1000 to od 50
Zrobi?em tak i nie dzia?a domy?lam si?, ?e trzeba skrypt ale jaki? z g?ry dzi?ki b?dzie reput!
 
Odp: Inquestion! Problem w skrypcie!rep++

W skrzynkach masz actionid, a w actions.xml masz uniqueid. W map editorze zmie? w skrzynkach actionid na uniqueid i powinno dzia?a?.
 
Odp: Inquestion! Problem w skrypcie!rep++

S? b??dy w consoli?
Pojawia si? jaki? napis a mo?e chmurka (taka jak kto? cie bije a nie trafia)
 
Odp: Inquestion! Problem w skrypcie!rep++

Nic dok?adnie tak jak by? zwyk?? skrzynk? otiwera? ;/
 
Odp: Inquestion! Problem w skrypcie!rep++

Sproboj tak:
PHP:
<action fromuid="1300" touid="1308" event="script" value="inqchests.lua" />
 
Odp: Inquestion! Problem w skrypcie!rep++

Sproboj tak:
PHP:
<action fromuid="1300" touid="1308" event="script" value="inqchests.lua" />

To nie dzia?a zaraz spr?buje tego:
W skrzynkach masz actionid, a w actions.xml masz uniqueid. W map editorze zmie? w skrzynkach actionid na uniqueid i powinno dzia?a?.

A z tym questem na cc kto? wie?
 
Odp: Inquestion! Problem w skrypcie!rep++

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = 50
local nagroda = 2160
local ilosc = 10
local storage = 5436
if item.uid == 6000 then
	if getPlayerStorageValue(cid, storage) == -1 then
		if getPlayerLevel(cid) >= level then
			doPlayerAddItem(cid, nagroda, ilosc)
			setPlayerStorageValue(cid, storage, 0)
			doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." "..nagroda..".")
		else
			doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.")
		end
	else
		doPlayerSendTextMessage(cid, 22, "Pusto.")
	end
end
return true
end
 
Odp: Inquestion! Problem w skrypcie!rep++

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = 50
local nagroda = 2160
local ilosc = 10
local storage = 5436
if item.uid == 6000 then
	if getPlayerStorageValue(cid, storage) == -1 then
		if getPlayerLevel(cid) >= level then
			doPlayerAddItem(cid, nagroda, ilosc)
			setPlayerStorageValue(cid, storage, 0)
			doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." "..nagroda..".")
		else
			doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.")
		end
	else
		doPlayerSendTextMessage(cid, 22, "Pusto.")
	end
end
return true
end
No ok ale jak zrobi? jak mam questy np. 50 lvl 5 cc 100 lvl 10 cc?
 
Odp: Inquestion! Problem w skrypcie!rep++

Nie wiem czy ci? dobrze zrozumia?em, ale chyba ci chodzi o to, ?e co 50 lvli ilo?? cc wzrasta o 5.

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
local level = 50 
local nagroda = 2160 
local ilosc = math.floor(getPlayerLevel(cid)/50) *5
local storage = 5436 
if item.uid == 6000 then 
    if getPlayerStorageValue(cid, storage) == -1 then 
        if getPlayerLevel(cid) >= level then 
            doPlayerAddItem(cid, nagroda, ilosc) 
            setPlayerStorageValue(cid, storage, 0) 
            doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." "..nagroda..".") 
        else 
            doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.") 
        end 
    else 
        doPlayerSendTextMessage(cid, 22, "Pusto.") 
    end 
end 
return true 
end

A je?li chodzi?o ci o zrobienie 2 quest?w, pierwszy od 50 lvla na 5 cc, a drugi od 100 na 10 cc to ?ap.

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
if item.uid == 6000 then
   level = 50 
   ilosc = 5
   storage = 5436
elseif item.uid == 6001 then
   level = 100
   ilosc = 10
   storage = 5437
end
local nagroda = 2160 
if item.uid == 6000 or item.uid == 6001 then 
    if getPlayerStorageValue(cid, storage) == -1 then 
        if getPlayerLevel(cid) >= level then 
            doPlayerAddItem(cid, nagroda, ilosc) 
            setPlayerStorageValue(cid, storage, 0) 
            doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." "..nagroda..".") 
        else 
            doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.") 
        end 
    else 
        doPlayerSendTextMessage(cid, 22, "Pusto.") 
    end 
end 
return true 
end
Uniqueid pierwszej skrzynki 6000, a drugiej 6001.

Powinno dzia?a?, jak nie to poprawie.

Pozdrawiam,
Amino12
 
Ostatnia edycja:
Odp: Inquestion! Problem w skrypcie!rep++

Zrobi?em tak tylko,?e w actions mam action id doda?em:
<action itemid="1050" script="questcctemple.lua"/>
<action itemid="1100" script="questcctemple.lua"/>
i nie dzia?a :((
 
Odp: Inquestion! Problem w skrypcie!rep++

Dodaj
Kod:
<action actionid="1050" script="questcctemple.lua"/>
<action actionid="1100" script="questcctemple.lua"/>

a skrypt taki:

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
if item.uid == 1050 then
   level = 50 
   ilosc = 5
   storage = 5436
elseif item.uid == 1100 then
   level = 100
   ilosc = 10
   storage = 5437
end
local nagroda = 2160 
if item.uid == 1050 or item.uid ==1100 then 
    if getPlayerStorageValue(cid, storage) == -1 then 
        if getPlayerLevel(cid) >= level then 
            doPlayerAddItem(cid, nagroda, ilosc) 
            setPlayerStorageValue(cid, storage, 0) 
            doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." "..nagroda..".") 
        else 
            doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.") 
        end 
    else 
        doPlayerSendTextMessage(cid, 22, "Pusto.") 
    end 
end 
return true 
end

Pozdrawiam,
Amino12
 
Odp: Inquestion! Problem w skrypcie!rep++

Dodaj
Kod:
<action actionid="1050" script="questcctemple.lua"/>
<action actionid="1100" script="questcctemple.lua"/>
a skrypt taki:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
if item.uid == 1050 then
   level = 50 
   ilosc = 5
   storage = 5436
elseif item.uid == 1100 then
   level = 100
   ilosc = 10
   storage = 5437
end
local nagroda = 2160 
if item.uid == 1050 or item.uid ==1100 then 
    if getPlayerStorageValue(cid, storage) == -1 then 
        if getPlayerLevel(cid) >= level then 
            doPlayerAddItem(cid, nagroda, ilosc) 
            setPlayerStorageValue(cid, storage, 0) 
            doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." "..nagroda..".") 
        else 
            doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.") 
        end 
    else 
        doPlayerSendTextMessage(cid, 22, "Pusto.") 
    end 
end 
return true 
end
Pozdrawiam,
Amino12
To tak jak by? m?g? popraw skrypt bo jak klikne w questan na 5 cc pisze "Znalaz?e? 5 2160" ale kas? dostaje. Jak by? m?g? dor?b jeszcze skrypt na 200 lvl-20 cc i 300 lvl-30 cc. Z g?ry dzi?ki b?dzie reput :))
A inq dalej mi nie dzia?a :((
 
Odp: Inquestion! Problem w skrypcie!rep++

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
if item.uid == 1050 then 
   level = 50  
   ilosc = 5 
   storage = 5436 
elseif item.uid == 1100 then 
   level = 100 
   ilosc = 10 
   storage = 5437 
elseif item.uid == 1200 then 
   level = 200 
   ilosc = 20 
   storage = 5438 
elseif item.uid == 1300 then 
   level = 300 
   ilosc = 30 
   storage = 5439 
end 
local nagroda = 2160  
if item.uid == 1050 or item.uid ==1100 then  
    if getPlayerStorageValue(cid, storage) == -1 then  
        if getPlayerLevel(cid) >= level then  
            doPlayerAddItem(cid, nagroda, ilosc)  
            setPlayerStorageValue(cid, storage, 0)  
            doPlayerSendTextMessage(cid, 22, "Znalazles "..ilosc.." cc.")  
        else  
            doPlayerSendTextMessage(cid, 22, "Wymagany poziom to "..level..", brakuje Ci jeszcze "..level-getPlayerLevel(cid).." by moc wziac nagrode.")  
        end  
    else  
        doPlayerSendTextMessage(cid, 22, "Pusto.")  
    end  
end  
return TRUE
end
I ustawiasz temu na 200 lvl uniqueid 1200, a temu na 300 lvl uniqueid 1300.

Pozdrawiam,
Amino12
 
Odp: Inquestion! Problem w skrypcie!rep++

CC dzia?a a co do inquetion to dalej to samo ;/ W skrzynkach zmieni?em jak poradzili?cie i nic :/
Inq te? dzia?a dzi?ki all.
 
Ostatnia edycja:
Back
Do góry