Skrypty & Kody Na?o?enie Exhaust'u na d?wignie

sempele

Active User
Zarejestrowany
Dołączył
Listopad 19, 2010
Posty
107
Liczba reakcji
3
Witam. Jest mo?liwo?? na?o?enia exhaustu na d?wignie powiedzmy 5 sekund na ten skrypt ? TFS 0.4


[LUA]local uid =
{
[1253] = {id = 7620, count = 1, cost = 5000}, -- mana potion
[1254] = {id = 7589, count = 1, cost = 8000}, -- strong mana potion
[1255] = {id = 7590, count = 1, cost = 12000}, -- great mana potion
[1248] = {id = 7618, count = 1, cost = 4500}, -- health potion
[1249] = {id = 7588, count = 1, cost = 10000}, -- strong health potion
[1250] = {id = 7591, count = 1, cost = 19000}, -- great health potion
[1251] = {id = 8473, count = 1, cost = 31000}, -- ultimate health potion
[1252] = {id = 8472, count = 1, cost = 19000}, -- great spirit potion

[1256] = {id = 2268, count = 1, cost = 9500}, -- sudden death rune
[1257] = {id = 2293, count = 1, cost = 35000}, -- magic wall rune
[1258] = {id = 2278, count = 1, cost = 20000}, -- paralyze rune
[1259] = {id = 2269, count = 1, cost = 20000}, -- grav
[1260] = {id = 2273, count = 1, cost = 20000}, -- uh
[1261] = {id = 2305, count = 1, cost = 20000}, -- fire bomb
[1262] = {id = 2304, count = 1, cost = 20000}, -- gfb
[1263] = {id = 2274, count = 1, cost = 20000}, -- ava
-- [uid] = {id = id_rune/potion, count = count, cost = cost (gp) --
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local t = uid[item.uid]
if t then
if (getPlayerFreeCap(cid) >= getItemWeightById(t.id, t.count)) then
if doPlayerRemoveMoney(cid, t.cost) then
doPlayerAddItem(cid, t.id, t.count)
doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Purchased! "..t.count.." "..getItemInfo(t.id).name.."s for "..t.cost.." gold coins")
else
doPlayerSendCancel(cid, "You need money")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You need cap")
doSendMagicEffect(getCreaturePosition(cid), 3)
end
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid+1)
else
doTransformItem(item.uid, item.itemid-1)
end
end
return true
end[/LUA]


Je?eli jest to mo?liwe m?g?by kto? zmieni? ten skrypt i wyja?ni? w miar? mo?liwo?ci jak na?o?y? ten exhaust w kodzie ? wtedy stara?bym si? sam nak?ada? na inne skrypty :) z g?ry dzi?ki
 
Odp: Na?o?enie Exhaust'u na d?wignie

Wpisa?em w google "command exhaust" i pierwsze co wyskoczy?o:
Kod:
if exhaustion.get(cid, 101) then
        doPlayerSendCancel(cid, 'You can use this command only once per 5 seconds.')
        return true
    end
    exhaustion.set(cid, 101, 5)
end
Na pocz?tku skryptu wystarczy sprawdzi? czy kto? ma exhaust, je?li nie ma, to trzeba mu go przydzieli? i przej?? do dalszej cz??ci skryptu.
Nie wiem czy masz w libach funkcj? na exhaust, je?li nie, to mo?esz j? skopiowa? st?d, sk?d te? poda?em powy?szy skrypt.
 
Odp: Na?o?enie Exhaust'u na d?wignie

Wpisa?em w google "command exhaust" i pierwsze co wyskoczy?o:
Kod:
if exhaustion.get(cid, 101) then
        doPlayerSendCancel(cid, 'You can use this command only once per 5 seconds.')
        return true
    end
    exhaustion.set(cid, 101, 5)
end
Na pocz?tku skryptu wystarczy sprawdzi? czy kto? ma exhaust, je?li nie ma, to trzeba mu go przydzieli? i przej?? do dalszej cz??ci skryptu.
Nie wiem czy masz w libach funkcj? na exhaust, je?li nie, to mo?esz j? skopiowa? st?d, sk?d te? poda?em powy?szy skrypt.

Czyli skrypt mniej wi?cej powinien wygl?da? tak ?

[LUA]local uid =
{
[1253] = {id = 7620, count = 1, cost = 5000}, -- mana potion
[1254] = {id = 7589, count = 1, cost = 8000}, -- strong mana potion
[1255] = {id = 7590, count = 1, cost = 12000}, -- great mana potion
[1248] = {id = 7618, count = 1, cost = 4500}, -- health potion
[1249] = {id = 7588, count = 1, cost = 10000}, -- strong health potion
[1250] = {id = 7591, count = 1, cost = 19000}, -- great health potion
[1251] = {id = 8473, count = 1, cost = 31000}, -- ultimate health potion
[1252] = {id = 8472, count = 1, cost = 19000}, -- great spirit potion

[1256] = {id = 2268, count = 1, cost = 9500}, -- sudden death rune
[1257] = {id = 2293, count = 1, cost = 35000}, -- magic wall rune
[1258] = {id = 2278, count = 1, cost = 20000}, -- paralyze rune
[1259] = {id = 2269, count = 1, cost = 20000}, -- grav
[1260] = {id = 2273, count = 1, cost = 20000}, -- uh
[1261] = {id = 2305, count = 1, cost = 20000}, -- fire bomb
[1262] = {id = 2304, count = 1, cost = 20000}, -- gfb
[1263] = {id = 2274, count = 1, cost = 20000}, -- ava
-- [uid] = {id = id_rune/potion, count = count, cost = cost (gp) --
}


function onUse(cid, item, fromPosition, itemEx, toPosition)
if exhaustion.get(cid, 101) then
doPlayerSendCancel(cid, 'Wait only once per 5 seconds.')
return true
end
exhaustion.set(cid, 101, 5)
local t = uid[item.uid]
if t then
if (getPlayerFreeCap(cid) >= getItemWeightById(t.id, t.count)) then
if doPlayerRemoveMoney(cid, t.cost) then
doPlayerAddItem(cid, t.id, t.count)
doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Purchased! "..t.count.." "..getItemInfo(t.id).name.."s for "..t.cost.." gold coins")
else
doPlayerSendCancel(cid, "You need money")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You need cap")
doSendMagicEffect(getCreaturePosition(cid), 3)
end
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid+1)
else
doTransformItem(item.uid, item.itemid-1)
end
end
return true
end[/LUA]

I np ?adnego storage nie musz? przypisa? ? Sorry za takie pytania ale nie wiem a chcia?bym si? dowiedzie? :)
 
Odp: Na?o?enie Exhaust'u na d?wignie

[lua]local storage = 1234 -- exhaust storage
local time = 3 -- sekundy exhaustu

local uid =
{
[1253] = {id = 7620, count = 1, cost = 5000}, -- mana potion
[1254] = {id = 7589, count = 1, cost = 8000}, -- strong mana potion
[1255] = {id = 7590, count = 1, cost = 12000}, -- great mana potion
[1248] = {id = 7618, count = 1, cost = 4500}, -- health potion
[1249] = {id = 7588, count = 1, cost = 10000}, -- strong health potion
[1250] = {id = 7591, count = 1, cost = 19000}, -- great health potion
[1251] = {id = 8473, count = 1, cost = 31000}, -- ultimate health potion
[1252] = {id = 8472, count = 1, cost = 19000}, -- great spirit potion

[1256] = {id = 2268, count = 1, cost = 9500}, -- sudden death rune
[1257] = {id = 2293, count = 1, cost = 35000}, -- magic wall rune
[1258] = {id = 2278, count = 1, cost = 20000}, -- paralyze rune
[1259] = {id = 2269, count = 1, cost = 20000}, -- grav
[1260] = {id = 2273, count = 1, cost = 20000}, -- uh
[1261] = {id = 2305, count = 1, cost = 20000}, -- fire bomb
[1262] = {id = 2304, count = 1, cost = 20000}, -- gfb
[1263] = {id = 2274, count = 1, cost = 20000}, -- ava
-- [uid] = {id = id_rune/potion, count = count, cost = cost (gp) --
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local t = uid[item.uid]
if(exhaustion.check(cid, storage) == false) then -- sprawdza czy gracz na exhaust
if t then
if (getPlayerFreeCap(cid) >= getItemWeightById(t.id, t.count)) then
if doPlayerRemoveMoney(cid, t.cost) then
doPlayerAddItem(cid, t.id, t.count)
doPlayerSendTextMessage(cid, MESSAGE_FIRST, "Purchased! "..t.count.." "..getItemInfo(t.id).name.."s for "..t.cost.." gold coins")
exhaustion.set(cid, storage, time) -- nadaje exhaust
else
doPlayerSendCancel(cid, "You need money")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You need cap")
doSendMagicEffect(getCreaturePosition(cid), 3)
end
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid+1)
else
doTransformItem(item.uid, item.itemid-1)
end
end
else
doPlayerSendCancel(cid, "You are exhausted.") -- jesli gracz ma exhaust wyswietli wiadomosc
end
return true
end[/lua]

exhaustion.set(cid, storage, time) -- da?em w miejsce gdzie akcja sie powiod?a(gracz kupi? przedmiot), bo po co dawa? exhaust po ka?dym naci?ni?ciu? ;d
 
Odp: Na?o?enie Exhaust'u na d?wignie

Dzi?ki buchaLL wszystko git teraz na spokojnie sobie przeanalizuje skrypt
 
Odp: Na?o?enie Exhaust'u na d?wignie

Przyda si? zna?am tak? miejsc?wk? gdzie to wykorzystam dzi?ki :)
 
Back
Do góry