Ir para conteúdo

Featured Replies

Postado

Galera preciso de ajuda neste script, o mesmo esta dando esse erro quando o player tentar entrar usando o comando "!battle Join".
 
Segue o erro:

 

[05/05/2014 17:43:19] > Broadcasted message: "Battle Event is going to start in 5 minutes. You can join to the event by saying "!battle join".".



[05/05/2014 17:43:29] [Error - TalkAction Interface]
[05/05/2014 17:43:29] buffer:onSay
[05/05/2014 17:43:29] Description:
[05/05/2014 17:43:29] (luaCreateConditionObject) This function can only be used while loading the script.

[05/05/2014 17:43:29] [Error - TalkAction Interface]
[05/05/2014 17:43:29] buffer:onSay
[05/05/2014 17:43:29] Description:
[05/05/2014 17:43:29] (luaDoAddCondition) Condition not found

 

Segue o script do mesmo: (Parece ser muito bom esse script)

 




configRushEvent = {
storages = {
main = '6594', -- set free storage
player = '25698', -- set free storage
joining = '45695', -- set free storage
b_score = '02365', -- set free storage
r_score = '48795', -- set free storage
exhaust = '99999999',
countEvent = '14875'
},

position = {
blue = {x=1447, y=1045, z=7}, -- posiotion to which player is teleporting
red = {x=1511, y=1046, z=7} -- posiotion to which player is teleporting
},

room = {
from = {x=1441,y=1030,z=7}, -- left top corner of event room
to = {x=1520,y=1063,z=7} -- right bottom corner of event room
},

rewards = {8979, 12665, 10063}, -- reward id which player can win (reward is random)
players = {
max = 40,
min = 2,
minLevel =7
},

days = {['Monday'] = {'17:00:00'},
['Tuesday'] = {'17:00:00'},
['Wednesday'] = {'17:00:00'},
['Thursday'] = {'17:00:00'},
['Friday'] = {'17:00:00'},
['Saturday'] = {'17:00:00'},
['Sunday'] = {'17:00:00'}
},

fragLimit = 30, -- frag limit

waitTime = 1, -- sekundy [ile gracz ma czekac jak padnie]

delayTime = 5.0, -- time in which players who joined to event are teleporting to teleport position [miuntes]
startEvent = 1, -- time from teleport to start event [seconds]
stopEvent = 60, -- [seconds]
text = 'Walka przez 10min lub 100 fragow, bez ue.'
}

]]>



domodlib('config_rush_event')

local conditionBlue = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})

local conditionRed = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})

function doStartRushEvent()
doSetStorage(configRushEvent.storages.joining, -1)

if configRushEvent.players.min <= doCountPlayersRushEvent()[1] then
for _, cid in ipairs(getPlayersOnline()) do
local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player))
if p ~= '' then
doTeleportThing(cid, p ~= 'blue' and configRushEvent.position.red or configRushEvent.position.blue)
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
doAddCondition(cid, p ~= 'blue' and conditionRed or conditionBlue)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Battle Event starts in '..configRushEvent.startEvent..' seconds.')
end
end

addEvent(doSetStorage, configRushEvent.startEvent * 1000, configRushEvent.storages.main, 1)
addEvent(doStopRushEvent, configRushEvent.stopEvent * 1000)
doBroadcastMessage('Rush Event has started. LET\'S GO!')
else
for _, cid in ipairs(getPlayersOnline()) do
if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
doCreatureSetStorage(cid, configRushEvent.storages.player, '')
end
end

doBroadcastMessage('Battle Event hasn\'t started beacuse there not were enough players.')
end
end

function doStopRushEvent()
if getStorage(configRushEvent.storages.main) > 0 then
local team = nil
if getStorage(configRushEvent.storages.b_score) == configRushEvent.fragLimit then
team = 'blue'
elseif getStorage(configRushEvent.storages.r_score) == configRushEvent.fragLimit then
team = 'red'
else
if getStorage(configRushEvent.storages.r_score) >= getStorage(configRushEvent.storages.b_score) then
team = 'red'
else
team = 'blue'
end
end

local prize = math.random(#configRushEvent.rewards)
for _, cid in ipairs(getPlayersOnline()) do
if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then
if team == tostring(getCreatureStorage(cid, configRushEvent.storages.player)) then
doPlayerAddItem(cid, configRushEvent.rewards[prize], 1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Your team won! You have received '.. getItemNameById(configRushEvent.rewards[prize]) ..' as reward.')
end

doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doCreatureSetStorage(cid, configRushEvent.storages.player, '')
doRemoveCondition(cid, CONDITION_OUTFIT)
end
end

doBroadcastMessage('Battle Event has finished. The winner is '..team..' team ('..getStorage(configRushEvent.storages.r_score)..':'..getStorage(configRushEvent.storages.b_score)..'). Congratulations!')
db.executeQuery("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Rush\", \""..team.."\", \""..prize.."\", "..getStorage(configRushEvent.storages.countEvent)..");")
doSetStorage(configRushEvent.storages.main, -1)
doSetStorage(configRushEvent.storages.countEvent, getStorage(configRushEvent.storages.countEvent) + 1)
doSetStorage(configRushEvent.storages.r_score, 0)
doSetStorage(configRushEvent.storages.b_score, 0)
end
end

function doCountPlayersRushEvent()
local x, blue, red = 0,0,0
for _, cid in ipairs(getPlayersOnline()) do
local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player))
if p ~= '' then
if p ~= 'blue' then
red = red + 1
else
blue = blue + 1
end
x = x + 1
end
end
return {x, blue, red}
end

function doStartCountingRushEvent(x)
if configRushEvent.delayTime-x > 0 then
doBroadcastMessage('Battle Event is going to start in '..configRushEvent.delayTime-x..' minutes. You can join to the event by saying "!battle join".')
addEvent(doStartCountingRushEvent, 60*1000, x+1)
end
end
]]>



domodlib("lib_rush_event")

function onSay(cid, words, param)
if getStorage(configRushEvent.storages.main) < 1 then
return doPlayerSendCancel(cid, 'You can not do it if Rush Event is not enabled.')
end

doStopRushEvent()
return true
end
]]>



domodlib("lib_rush_event")

function onSay(cid, words, param)
if getStorage(configRushEvent.storages.main) > 0 then
return doPlayerSendCancel(cid, 'Rush Event is already running.')
end

for _, pid in ipairs(getPlayersOnline()) do
if tostring(getCreatureStorage(pid, configRushEvent.storages.player)) ~= '' then
doCreatureSetStorage(pid, configRushEvent.storages.player, '')
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
doRemoveCondition(pid, CONDITION_OUTFIT)
end
end

doStartCountingRushEvent(0)
doSetStorage(configRushEvent.storages.joining, 1)
addEvent(doStartRushEvent, configRushEvent.delayTime * 60 * 1000)
return true
end
]]>



domodlib("lib_rush_event")

function onSay(cid, words, param)
if getStorage(configRushEvent.storages.joining) ~= 1 then
return doPlayerSendCancel(cid, 'Rush Event hasn\'t started yet.')
elseif param == '' then
return doPlayerSendCancel(cid, 'Command param required (say: "!battle join" or "!battle leave.").')
elseif getPlayerLevel(cid) < configRushEvent.players.minLevel then
return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configRushEvent.players.minLevel..' level.')
elseif getTileInfo(getThingPos(cid)).protection ~= true then
return doPlayerSendCancel(cid, 'You can\'t join to the event if you aren\'t in protection zone.')
elseif exhaustion.check(cid, configRushEvent.storages.exhaust) ~= false then
return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configRushEvent.storages.exhaust)..' seconds to use this command again.')
end

if param == 'join' then
if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.')
elseif doCountPlayersRushEvent()[1] == configRushEvent.players.max then
return doPlayerSendCancel(cid, 'Max players in the event have been reached.')
end

for _, v in ipairs(getPlayersOnline()) do
if tostring(getCreatureStorage(v, configRushEvent.storages.player)) ~= '' then
if getPlayerIp(cid) == getPlayerIp(v) then
return doPlayerSendCancel(cid, 'In Rush event there is arleady player who have same ip like you.')
end
end
end

doCreatureSetNoMove(cid, true)
if configRushEvent.text ~= '' then
doPlayerPopupFYI(cid, configRushEvent.text)
end

doCreatureSetStorage(cid, configRushEvent.storages.player, doCountPlayersRushEvent()[3] >= doCountPlayersRushEvent()[2] and 'blue' or 'red')
doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1))
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Rush Event. You can\'t move until event don\'t start. Wait patiently for the event start.')
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have joined to Rush Event.')
elseif param == 'leave' then
if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.')
end

doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
doCreatureSetStorage(cid, configRushEvent.storages.player, '')
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Rush Event.')
end

exhaustion.set(cid, configRushEvent.storages.exhaust, 5)
return true
end
]]>




domodlib("lib_rush_event")

local daysOpen = {}
for k, v in pairs(configRushEvent.days) do
table.insert(daysOpen, k)
end

function onThink(cid, interval)
if isInArray(daysOpen, os.date('%A')) then
if isInArray(configRushEvent.days[os.date('%A')], os.date('%X', os.time())) then
if getStorage(configRushEvent.storages.joining) ~= 1 then
doStartCountingRushEvent(0)

for _, pid in ipairs(getPlayersOnline()) do
if tostring(getCreatureStorage(pid, configRushEvent.storages.player)) ~= '' then
doCreatureSetStorage(pid, configRushEvent.storages.player, '')
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
doRemoveCondition(pid, CONDITION_OUTFIT)
end
end

doSetStorage(configRushEvent.storages.joining, 1)
addEvent(doStartRushEvent, configRushEvent.delayTime * 60 * 1000)
end
end
end

return true
end
]]>



domodlib("lib_rush_event")

function onStatsChange(cid, attacker, type, combat, value)
if type == 1 and getCreatureHealth(cid) <= value then
if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then
if isPlayer(cid) then
local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doTeleportThing(cid, p ~= 'blue' and configRushEvent.position.red or configRushEvent.position.blue)
doCreatureSetNoMove(cid, true)
addEvent(doCreatureSetNoMove, configRushEvent.waitTime * 1000, cid, false)

if p ~= 'blue' then
doSetStorage(configRushEvent.storages.b_score, math.max(getStorage(configRushEvent.storages.b_score), 0) + 1)
if getStorage(configRushEvent.storages.b_score) == configRushEvent.fragLimit then
doStopRushEvent()
end
else
doSetStorage(configRushEvent.storages.r_score, math.max(getStorage(configRushEvent.storages.r_score), 0) + 1)
if getStorage(configRushEvent.storages.r_score) == configRushEvent.fragLimit then
doStopRushEvent()
end
end
return false
end
end
elseif isInArray({1,3}, type) and isPlayer(attacker) and isPlayer(cid) then
if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then
if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) == tostring(getCreatureStorage(attacker, configRushEvent.storages.player)) then
return false
end
end
end
return true
end
]]>



domodlib("config_rush_event")

function onLogin(cid)
if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
doCreatureSetStorage(cid, configRushEvent.storages.player, '')
doRemoveCondition(cid, CONDITION_OUTFIT)
end

registerCreatureEvent(cid, 'Rush_Event_Dead')
return true
end
]]>



domodlib("config_rush_event")

function onStartup()
doSetStorage(configRushEvent.storages.main, -1)
doSetStorage(configRushEvent.storages.r_score, 0)
doSetStorage(configRushEvent.storages.b_score, 0)
doSetStorage(configRushEvent.storages.joining, -1)
return true
end
]]>

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo