• 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!

Edit Script

J u Z e K

Banned User
Joined
Feb 27, 2011
Messages
141
Reaction score
1
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStamina(cid) == 2520) then
		return doPlayerSendCancel(cid, "Your stamina is already full.")
	end
	doPlayerSetStamina(cid, 2520)
	doRemoveItem(item.uid, 1)
	return true
end
I need edit it to can use 1x on 24h and never end
 
LUA:
local waittime = 300 -- (300 seconds) do seconds for 24 hours
local storage = 5560

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStamina(cid) == 2520) then
		return doPlayerSendCancel(cid, "Your stamina is already full.")
	end
	if exhaustion.get(cid, storage) == FALSE then
	exhaustion.set(cid, storage, waittime)
	doPlayerSetStamina(cid, 2520)
    else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. exhaustion.get(cid, storage) .. " seconds.")
	end	
	return true
end-- writed in browser
 
Thanks rep++
But i think it need edit because
It Take storage xxxx So if someone got more stamina tickets he cant use it because he already use this storage.
I want
If players got more stamina ticket
So they can use it.
But one item can be use 1 time in 24h ;s

Any idea?

Someone got 2 stamina tickets from sms shop :
Stamina ticket - A
Stamina ticket - B

If players use today at 8;00 stamina ticket A he lost bonus stamina (42-40:00) so he want use next. but got storage ;/
 
make another item like that, when you use the original stamina ticket, it changes to the new item(which doesn't have the script) and that it decays to the original stamina ticket after 24 hours(86400 seconds if im not mistaken)

as an example:
Code:
    <item id="5957" article="a" name="stamina ticket">        
    <attribute key="weight" value="120" />
    </item>
    <item id="5958" article="a" name="stamina ticket">
        <attribute key="description" value="This ticket still can't be used" />
        <attribute key="weight" value="120" />
        <attribute key="decayTo" value="5957" />
        <attribute key="duration" value="86400" />
    </item>

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerStamina(cid) == 2520) then
        return doPlayerSendCancel(cid, "Your stamina is already full.")
    end
    doTransformItem(item.uid, 5958) --Dont forget to change depending on your item used on items.xml
    doDecayItem(item.uid)
end
 
Last edited:
Back
Top