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

Exhausted in Talkactions :/

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
Hello, tried to make exhauster in !online & dont work :O , tried on making in other - same.

People crash server spamming command :( , take a look at script.

Code:
function onSay(cid, words, param)
	if getPlayerPremiumDays(cid) <= 360 then
		if doPlayerRemoveMoney(cid, 50000) == TRUE then
			doPlayerAddPremiumDays(cid, 10)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought 10 days of premium account.")
		else
			doPlayerSendCancel(cid, "You don't have enough money, 10 days premium account costs 50000 gold coins.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

thats script for !pacc , i am trying to make exhaust in every command so if anyone can tell me what i should add & where?

Thanks.
 
The function you need is:
Lua:
exhaustion.set(cid, storage, time)

So in order to make a player get exhausted you just need to do something like this:
Lua:
exhaustion.set(cid, 2000, 2000)
This is 2 seconds exhaustion.
 
Code:
function exhaustion.set(cid, storage, time)
exhaustion.set(cid, 2000, 2000)
end
not work T_T , tried to add

Code:
exhaustion.set(cid, 2000, 2000)

inside script & many errors ...
 
Code:
function exhaustion.set(cid, storage, time)
exhaustion.set(cid, 2000, 2000)
end
not work T_T , tried to add

Code:
exhaustion.set(cid, 2000, 2000)

inside script & many errors ...

the first "2000" is the storage value where the exhaustion will be saved, make sure it's not used
 
mhm ok , if i add:

Code:
function exhaustion.set(cid, storage, time)
exhaustion.set(cid, 93817, 2000)
end

above function onSay(cid, words, param)...

that error appear:
Warning: [Event::loadScript] Can not load script. data/talkactions/scripts/online.lua
data/talkactions/scripts/online.lua:10: '<eof>' expected near 'end'

Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/online.lua

data/talkactions/scripts/online.lua:7: attempt to index global 'exhaustion' (a nil value)
Warning: [Event::loadScript] Can not load script. data/talkactions/scripts/online.lua

else if i add
Code:
exhaustion.set(cid, 93817, 2000)

Code:
local config = {

	showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))

}

function onSay(cid, words, param)
	local players = getPlayersOnline()
	local strings = {}

	local i = 1
	local position = 1
	for _, pid in ipairs(players) do
		if(i > (position * 7)) then
			strings[position] = strings[position] .. ","
			position = position + 1
			strings[position] = ""
		else
			strings[position] = i == 1 and "" or strings[position] .. ", "
		end

		if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, 

PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, 

PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > 

getPlayerAccess(pid))) then

			strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. 

getPlayerLevel(pid) .. "]"
			i = i + 1
		end
	end

[B]		exhaustion.set(cid, 93817, 2000)[/B]
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) 

online:")
	for i, str in ipairs(strings) do
		if(str:sub(str:len()) ~= ",") then
			str = str .. "."
		end

[B]		exhaustion.set(cid, 93817, 2000)[/B]
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)

	end

	return TRUE
end

that error appear:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/online.lua:eek:nSay

data/talkactions/scripts/online.lua:29: attempt to index global 'exhaustion' (a
nil value)
stack traceback:
data/talkactions/scripts/online.lua:29: in function <data/talkactions/sc
ripts/online.lua:7>
 
Check functions, sec;d

this ?

Lua:
function onSay(cid, words, param)
	if getCreatureCondition(cid, CONDITION_EXHAUST) == FALSE then
		doAddCondition(cid, CONDITION_EXHAUST)
	else
		doPlayerSendCancel(cid, "You are exhausted")
		end
	return TRUE
end
 
Last edited:
Check functions, sec;d

this ?

Lua:
function onSay(cid, words, param)
	if getCreatureCondition(cid, CONDITION_EXHAUST) == FALSE then
		doAddCondition(cid, CONDITION_EXHAUST)
	else
		doPlayerSendCancel(cid, "You are exhausted")
		end
	return TRUE
end
tyyy! , now it works perfect , i know how to add now thank you.
 
Back
Top