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

doSendAnimatedText - Storage

Winnerandy

Experienced Web Design'er
Joined
Oct 23, 2008
Messages
2,251
Reaction score
50
Location
Tellus.
I need a script that sends animated text when have x storage.
If the player have'nt the x storage, then the player won't say anything (animated text), but if the player have the storage, then do send animated text.

Regards,
Winnerandy.
 
Code:
local config = {
	storage = 10000,
	text = "Text",
	color = 30
}

function onThink(interval, lastExecution, thinkInterval)
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerStorageValue(cid, config.storage) > 0 then
			doSendAnimatedText(getThingPos(cid), config.text, config.color)
		end
	end
	return true
end
Code:
	<globalevent name="Anim00tedShit" interval="2" event="script" value="text.lua"/>
 
Code:
local config = {
	storage = 10000,
	text = "Text",
	color = 30
}

function onThink(interval, lastExecution, thinkInterval)
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerStorageValue(cid, config.storage) > 0 then
			doSendAnimatedText(getThingPos(cid), config.text, config.color)
		end
	end
	return true
end
Code:
	<globalevent name="Anim00tedShit" interval="2" event="script" value="text.lua"/>

Pwns! :thumbup::wub:

btw, is it possible to make a talkactions, (optional for ppl) that can disable the globalevent? For example /text off (text = :
PHP:
local config = {
	storage = 10000,
	text = "Text",
	color = 30
}

:peace:
 
Last edited:
Lua:
local storage = 10000

function onSay(cid, words, param, channel)
    local val = getPlayerStorageValue(cid, storage) ~= 1 and 1 or 0
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, val == 1 and "AFK MSG IS NOW ON" or "AFK MSG IS NOW OFF")
    return setPlayerStorageValue(cid, storage, val)
end
 
Lua:
local storage = 10000

function onSay(cid, words, param, channel)
    local val = getPlayerStorageValue(cid, storage) ~= 1 and 1 or 0
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, val == 1 and "AFK MSG IS NOW ON" or "AFK MSG IS NOW OFF")
    return setPlayerStorageValue(cid, storage, val)
end

1- Ty for the script.
2- It's not for the afk.
3- Don't smoke.
:wub:
 
Back
Top