What's new

Scrypt Actions

DaViDeQ24

Advanced User
Joined
Jul 13, 2008
Messages
274
Reaction score
6
Witam jak zrobi? ?eby senzu si? ko?czy?o mimo ?e na serwerze jest niesko?czona amunicja oraz nieko?cz?ce si? runy KOD:

senzu.lua
Code:
function onUse(cid, item, frompos, item2, topos)

	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	
	local exhausted_seconds = 0
	local exhausted_storagevalue = 74
	
	local mana_minimum = 70000
	local mana_maximum = 70000

	local mana_add = math.random(mana_minimum, mana_maximum)
	
		
		if(item.type >= 1) then
			if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
				if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
					doPlayerAddMana(cid, mana_add)
                                        doPlayerAddHealth(cid, mana_add)
doPlayerSay(cid,":)",1)
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doChangeTypeItem(item.uid, item.type - 0)
				else
					doSendMagicEffect(frompos, CONST_ME_POFF)
					doPlayerSendCancel(cid, "You are exchausted.")
				end
			else
				doSendMagicEffect(frompos, CONST_ME_POFF)
				doPlayerSendCancel(cid, "You are exhausted.")
			end
		else
			if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
				doSendMagicEffect(frompos, CONST_ME_POFF)
				doPlayerSendCancel(cid, "You are exhausted.")
			else
				if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
					doPlayerAddMana(cid, mana_add)
                                        doPlayerAddHealth(cid, mana_add*1.5)
doPlayerSay(cid,"I feel the best",1)
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				else
					doSendMagicEffect(frompos, CONST_ME_POFF)
					doPlayerSendCancel(cid, "You are exchausted.")
				end
			end
		end
						
	return 1
end
 

Amino12

Advanced User
Joined
Jun 12, 2008
Messages
292
Reaction score
48
Odp: Scrypt Actions

Code:
function onUse(cid, item, frompos, item2, topos)
	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	local exhausted_seconds = 0
	local exhausted_storagevalue = 74
	local mana_minimum = 70000
	local mana_maximum = 70000
	local mana_add = math.random(mana_minimum, mana_maximum)
		if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
			doSendMagicEffect(topos,12)
			doPlayerAddMana(cid, mana_add)
                        doRemoveItem(item.uid, 1)
            doPlayerAddHealth(cid, mana_add)
			doPlayerSay(cid,":)",1)
			setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
		else
			doSendMagicEffect(frompos, CONST_ME_POFF)
			doPlayerSendCancel(cid, "You are exhausted.")
		end
	return 1
end

@DOWN
To twoje nie usuwa senzu.
 
Last edited:
T

Tairens

Guest
Odp: Scrypt Actions

Code:
function onUse(cid, item, frompos, item2, topos)
	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	local exhausted_seconds = 0
	local exhausted_storagevalue = 74
	local mana_minimum = 70000
	local mana_maximum = 70000
	local mana_add = math.random(mana_minimum, mana_maximum)
		if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
			doSendMagicEffect(topos,12)
			doPlayerAddMana(cid, mana_add)
            doPlayerAddHealth(cid, mana_add)
			doPlayerSay(cid,":)",1)
			setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
		else
			doSendMagicEffect(frompos, CONST_ME_POFF)
			doPlayerSendCancel(cid, "You are exhausted.")
		end
	return 1
end
 

DaViDeQ24

Advanced User
Joined
Jul 13, 2008
Messages
274
Reaction score
6
Odp: Scrypt Actions

@Amino12
Dzia?a Elegancko ju? DZI?KI ! :D
@Tairens
Nie dzia?a
 
Last edited:
Top