• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action TFS 1.0 Stamina Doll

Jabra

Banned User
Joined
Jan 11, 2014
Messages
19
Reaction score
0
actions.xml

<!-- Stamina Doll -->
<action itemid="ITEMID" script="other/staminadoll.lua"/>

staminadoll. lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {}
cfg.refuel = 42 * 60 * 1000
if(Player(cid):getStamina() >= cfg.refuel) then
doPlayerSendCancel(cid, "Your stamina is already full.")
elseif(not isPremium(cid)) then
doPlayerSendCancel(cid, "You must have a premium account.")
else
Player(cid):setStamina(cfg.refuel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
doRemoveItem(item.uid)
end
return true
end

Thanks to Ninja.
 
Good!, But you should write how to do it step by step, it's not so difficult do write that so people know how do to exactly. :))
 
You can use it always, it doesn't send the message if your stamina is full doPlayerSendCancel(cid, "Your stamina is already full.") @Ninja
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if player:getStamina() >= 2520 then
        player:sendCancelMessage("Your stamina is already full.")
    elseif player:getPremiumDays() < 1 then
        player:sendCancelMessage("You must have a premium account.")
    else
        player:setStamina(2520)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your stamina has been refilled.")
        Item(item.uid):remove(1)
    end
    return true
end
 
Last edited:
Back
Top