• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Stamina refuel ! Good item to shop in real RPG ot.

Backy

Vivere militare est
Joined
Feb 25, 2009
Messages
157
Reaction score
2
Location
P(r)oland/Sanok
Hello i present my first script.
I think is a good item to SMS shop.

Ok, made file ...data/actions/scripts/stamina-refuel.lua
And paste
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.refuel = 42 * 60 * 1000
	if(getPlayerStamina(cid) >= cfg.refuel) then
		doPlayerSendCancel(cid, "Your stamina is already full.")
	elseif(not isPremium(cid)) then
		doPlayerSendCancel(cid, "You must have a premium account.")
	else
		doPlayerSetStamina(cid, cfg.refuel)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
		doRemoveItem(item.uid)
	end
	return true
end

*Find a item what you want to use ! Its can be santa doll or something.

To actions.xml paste :
Code:
<action itemid="[COLOR="Red"]ITEMID-PUT ID HERE[/COLOR]" script="stamina-refuel.lua"/>

Please report bugs.

CREDITS TO JDB
IDEA BY ME : o

Thanks.
 
Last edited:
Code:
local refuel = 42 * 60 * 1000
function onUse(cid, item, fromPosition, itemEx, toPosition) return getPlayerStamina(cid) >= refuel and doPlayerSendCancel(cid, "Your stamina is already full.") or not isPremium(cid) and doPlayerSendCancel(cid, "Hey guy, premium account need.") or doPlayerSetStamina(cid, refuel) and doRemoveItem(item.uid, 1) and doSendAnimatedText(cid, "You got full stamina now!", TEXTCOLOR_LIGHTBLUE) end
xDD!
 
Code:
local refuel = 42 * 60 * 1000
function onUse(cid, item, fromPosition, itemEx, toPosition) return getPlayerStamina(cid) >= refuel and doPlayerSendCancel(cid, "Your stamina is already full.") or not isPremium(cid) and doPlayerSendCancel(cid, "Hey guy, premium account need.") or doPlayerSetStamina(cid, refuel) and doRemoveItem(item.uid, 1) and doSendAnimatedText(cid, "You got full stamina now!", TEXTCOLOR_LIGHTBLUE) end
xDD!

why put all in one line?? it's just stupid....

~hopin u was kiddin~
 
i rly like the cyko style :) i will try it is short, simple and do the same thing of another style but in 1 or 2 lines and understandable :)
i wont stop to say it, you are good on it and keep working :)
 
i think this would be awesome for smart botters :p
but i think if you could see wich characters are buying them that you can keep an eye on them
 
My sugest Scrypt

local refuel = 42 * 60 * 1000
function onUse(cid, item, fromPosition, itemEx, toPosition) return getPlayerStamina(cid) >= refuel and doPlayerSendCancel(cid, "Your stamina is already full.") or not isPremium(cid) and doPlayerSendCancel(cid, "Hey guy, premium account need.") or doPlayerSetStamina(cid, refuel) and doRemoveItem(item.uid, 1) and doSendAnimatedText(getPlayerPosition(cid), "OMAGAD", TEXTCOLOR_RED) and doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Stamina FULL Now.') end
 
Looks like a script I wrote not to long ago.
I always put my "configs" on the inside of the script, Cykotitan hates that.

No credits to thread creator.

AND it doesn't even work because you changed the message incorrectly.

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.refuel = 42 * 60 * 1000
	if(getPlayerStamina(cid) >= cfg.refuel) then
		doPlayerSendCancel(cid, "Your stamina is already full.")
	elseif(not isPremium(cid)) then
		doPlayerSendCancel(cid, "You must have a premium account.")
	else
		doPlayerSetStamina(cid, cfg.refuel)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
		doRemoveItem(item.uid)
	end
	return true
end
 
@Backy
Code:
doPlayerSendCancel(cid, "Hey " .. (getPlayerSex(cid) == 0 and "girl" or "guy") .. ", premium account need.")
Pic unrelated.

anonymiss.jpg
 
Back
Top