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

[Error] in 2 Script :(

Status
Not open for further replies.

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hiho, i have 2 script and have bug :x

temple.lua
LUA:
 function onSay(cid, words, param)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if ((getplayerlevel(cid) <= 30) and (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE)) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Temple!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
end
return 1
end

LUA:
--Config--
local lenght = 70 -- Max number of characters to contair the menssage
local messagesort = MESSAGE_STATUS_WARNING -- can be "MESSAGE_STATUS_WARNING" or "TALKTYPE_ORANGE_1" check your global.lua for more...
local exhaustTime = 4 * 60 * 1000 -- time exausted bettewen message (4 = min)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, exhaustTime)
--End of config--

function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_EXHAUST) == TRUE then
doPlayerSendCancel(cid, "Sorry, not posible")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end

local name = getPlayerName(cid)
local level = getPlayerLevel(cid)

-- Here you add staff
local staff = {}
staff[1] =
{
Sgz,
nwtr,
Robson,
Acordion,
Nyd Mort
}
-- Staff end

if isCreature(cid) == TRUE then
if param ~= nil then
if string.len(param) < lenght then
for i = 1, table.maxn(staff[1]) do
doPlayerSendTextMessage(staff[1][i], messagesort, ''..name..' ['..level..'] report: ' .. param .. '') 
doPlayerSendCancel(cid, Your report will be send)  
--exhaustion.set(cid, storageValue,exhaustTime)
doAddCondition(cid, exhaust)
end
return TRUE
else
doPlayerSendCancel(cid, 'Sorry, Just ' .. lenght .. ' caracteres')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
else
doPlayerSendCancel(cid, 'Sorry, You Need to write something')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
else
doPlayerSendCancel(cid, 'You haven\'t a target')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
return TRUE
end

thx all :)


imagem_wsqsew.bmp
 
temple
LUA:
function onSay(cid, words, param)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
      if ((getplayerlevel(cid) <= 30) and (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE)) then
             doTeleportThing(cid, temple, TRUE)
             doSendMagicEffect(ppos,66)
             doSendAnimatedText(frompos,'Temple!',16)
      else
             doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
             doSendMagicEffect(ppos,2)
      end

return true
end
 
Last edited:
LUA:
local length = 70
local messagesort = MESSAGE_STATUS_WARNING
local exhaustTime = 4 * 60 * 1000

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 5)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, exhaustTime)

local staff = {
	'Sgz', 'nwtr', 'Robson', 'Acordion', 'Nyd Mort'
}
	
function onSay(cid, words, param, channel)
	if getCreatureCondition(cid, CONDITION_EXHAUST, 5) then
		doPlayerSendCancel(cid, 'You are exhausted.')
	elseif not param then
		doPlayerSendCancel(cid, 'Sorry, You Need to write something')
	elseif param:len() > length then
		doPlayerSendCancel(cid, 'Sorry, max ' .. length .. ' characters.')
	else
		local name, level, sent = getCreatureName(cid), getPlayerLevel(cid), nil
		for _, v in ipairs(staff) do
			local pid = getPlayerByName(v)
			if pid then
				doPlayerSendTextMessage(pid, messagesort, name .. ' [' .. level .. '] report: ' .. param)
				if not sent then sent = true end
			end
		end
		doAddCondition(cid, exhaust)
		if sent then
			return doPlayerSendCancel(cid, 'Your report has been sent.')
		else
			doPlayerSendCancel(cid, 'Sorry, no staff members are online.')
		end
	end
	return doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
 
Status
Not open for further replies.
Back
Top