What's new

Superheal

Fridek

Active User
Joined
May 1, 2009
Messages
80
Reaction score
2
Witam,

Zrobi?em superheal , lecz na podstawie mojej manaruny ,wi?c wyskakuje mi (I? moge tego uzywa? tylko na ludziach.)
Chcia?bym aby u?ywa? tego przedmiotu od razu na sobie co? w stylu funkcji w hotkeyach "Use on yourself"

Tutaj kawa?ek skryptu z superheal'a

Code:
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
-- Exhausted Settings --
local exhausted_seconds = 0.5 -- How many seconds manarune will be unavailible to use. --
local exhausted_storagevalue = 1555 -- Storage Value to store exhaust. It MUST be unused! --
-- Exhausted Settings END --
-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local health_minimum = (level * 1) + (mlevel * 5) - 500
local health_maximum = (level * 2) + (mlevel * 5)
-- Mana Formula Settings END --
local health_add = math.random(health_minimum, health_maximum)
-- We check the charges. --
if(item.type > 1) then
-- Exhausted check. --
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
-- Entity is player? --
if(isPlayer(item2.uid) == 1) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Ten przedmiot moze byc uzywany tylko na ludziach.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Jestes wyczerpany.")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Jestes wyczerpany.")
else
if(isPlayer(item2.uid) == 1) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerSay(cid,"[++]HP",1)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Ten przedmiot moze byc uzywany tylko na ludziach.")
end
end
end
return 1
end
 

JackQ

User
Joined
May 8, 2009
Messages
22
Reaction score
3
Odp: Superheal

Musisz zmienic item na jakis, na ktorym jest "Use", a nie "Use with".
Mam nadzieje ze zrozumiales...
do tego zamiast tego skryptu wstaw taki:
Code:
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
-- Exhausted Settings --
local exhausted_seconds = 0.5 -- How many seconds manarune will be unavailible to use. --
local exhausted_storagevalue = 1555 -- Storage Value to store exhaust. It MUST be unused! --
-- Exhausted Settings END --
-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local health_minimum = (level * 1) + (mlevel * 5) - 500
local health_maximum = (level * 2) + (mlevel * 5)
-- Mana Formula Settings END --
local health_add = math.random(health_minimum, health_maximum)
-- We check the charges. --
if(item.type > 1) then
-- Exhausted check. --
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Jestes wyczerpany.")
end
else
doRemoveItem(item.uid, 1)
end
return 1
end

Zrob kopie zapasowa tamtego, i jak napisalem wczesniej wstaw ten skrypt i zmien id runki na id itema "Use".

P.S. - mozliwe ze nie bedzie dzialac, ale to przez ten balagan w skrypcie. Nie lubie takich nieposprzatanych ^^
 

Maly Wizak

Advanced User
Joined
Oct 5, 2008
Messages
172
Reaction score
5
Odp: Superheal

Wi?c jak zrobisz czar "Superheal" to ci pisze np.+1045?
Chcia?em kiedy? tak samo zrobi? ,ale jaki? b??d mi wyszed? :)

Nawet nie wiem jak na TFSie si? to robi ,ma?o os?b to umie...
 

Azizzy

Advanced User
Joined
May 15, 2008
Messages
163
Reaction score
6
Odp: Superheal

7/10 Skrypt przydatny gdy robimy SMS SHOP, lub na Serverach Enfo.
 
Top