View difference between Paste ID: u1KryWDv and MDLvStch
SHOW: | | - or go back to the newest paste.
1
function onUse(cid, item, fromPosition, itemEx, toPosition)
2-
    local player = Player(cid)
2+
	
3-
    if player:getStamina() >= 2520 then
3+
	local player = Player(cid)
4-
        player:sendCancelMessage("Your stamina is already full.")
4+
	
5-
    elseif player:getPremiumDays() < 1 then
5+
	if player:getStamina() >= 2520 then
6-
        player:sendCancelMessage("You must have a premium account.")
6+
		player:sendCancelMessage("Your stamina is already full.")
7-
    else
7+
	elseif player:getPremiumDays() < 1 then
8-
        player:setStamina(2520)
8+
		player:sendCancelMessage("You must have a premium account.")
9-
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your stamina has been refilled.")
9+
	else
10-
        Item(item.uid):remove(1)
10+
		if player:getStamina() > 2280 then
11-
    end
11+
			player:setStamina(2520)
12-
    return true
12+
		else
13
			player:setStamina(player:getStamina() + 240)
14
		end
15
		player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your stamina has been refilled.")
16
		Item(item.uid):remove(1)
17
	end
18
	
19
	return true
20
end