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

Time

VirrageS

←•†ĿuĀ && ©¤¤•→
Joined
May 30, 2010
Messages
984
Reaction score
63
Location
Poland
Hello :)

I looking for script. So when you say: "!countdown, 5" then it will be something like this (it will show every 1 second):

Code:
Count: 5
Count: 4
Count: 3
Count: 2
Count: 1
(And when 0 then) Hurra!!
I have tried to make script:
LUA:
function onSay(cid, words, param)
	param = param.explode(param, ',')
	
	if (param[1] ~= nil) then
		local count = param[1]
		
		for i = 1, param[1] do
			doSendAnimatedText(getPlayerPosition(cid), 'Count: '.. param[1] - 1 ..'', 11)
			if (param[1] == 0) then
				doSendAnimatedText(getPlayerPosition(cid), 'Hurra!!', 11)
			end
		end
	else
		doPlayerSendCancel(cid, 'You must set param!')
	end
end
And it is only showing "Count: 2".

Can someone make this script?? :thumbup:
Rep and thanks for script.
 
Last edited:
Not a cool way to make it without storage and storage is a better way.

Yeah. I think that using storages is better way than tabels. Also storages are simpler.

But both scripts are good. And thanks for help. :thumbup:


#Edit: Move is stoping casting but attack isn't doing it. :(
 
Last edited:
try
LUA:
local countdownEvent = 12300
 
function finalCountdown(cid, countLeft, playerPos)
    if(not isPlayer(cid) or countLeft == 0) then
        setPlayerStorageValue(cid, countdownEvent,-1)
        return
    end
    local tmpPos = getCreaturePosition(cid)
    if((tmpPos.x == playerPos.x) and (tmpPos.y == playerPos.y) and (tmpPos.z == tmpPos.z) or (not isPlayerPzLocked(cid))) then
        doSendAnimatedText(getCreaturePosition(cid), 'Count: '.. countLeft ..'', 11)
		addEvent(finalCountdown, 1000, cid, countLeft - 1, playerPos)
    else
        doPlayerSendCancel(cid,'You moved or start fight. You can\'t logout.')
         setPlayerStorageValue(cid, countdownEvent,-1)
    end
end
 
function onSay(cid,words,param)
    c = tonumber(param)
    if(c) then
        if(getPlayerStorageValue(cid,countdownEvent) ~= cid) then
            setPlayerStorageValue(cid, countdownEvent,cid)
			addEvent(finalCountdown, 0, cid, c, getCreaturePosition(cid))
        else
            doPlayerSendCancel(cid,'Event is running.')
        end
    else
        doPlayerSendCancel(cid,'Requires numberic value.')
    end
    return true
end
 
Back
Top