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

Linux tfs 0.4 - talkaction

Scooty

Enemia.EU
Joined
Jul 24, 2010
Messages
564
Reaction score
14
Location
Kraków
Hi

please look at my:

globalevents.xml

PHP:
<globalevent name="castle" time="18:30:00" event="script" value="castle.lua"/>

globalevents/scripts/castle.lua

PHP:
function onTimer()
	if not(isInArray(CASTLE_DAYS, tonumber(os.date("%w")))) then
		return true
	else
		Castle_enableSaving()
	end
return true
end

and i have that error in my console:

Code:
[18:36:44.966] [Warning - Event::loadScript] Event onTime not found (data/globalevents/scripts/castle.lua)


can someone help me?

i have tfs 0.4
i tried with only 18:30(not 18:30:30)
it works fine on tfs 0.3.6, but not on tfs 0.4



REPAIRED, LOOK AT MY NEXT POST
 
Last edited:
ok thanks, now it work, but i have second problem.

i have this talkaction:

function onSay(cid, words, param, channel)
Castle_trySave(cid)
return true
end

and when i say talkaction word(!castle)

i have it in console:

[18:56:15.756] [Error - TalkAction Interface]
[18:56:15.756] data/talkactions/scripts/castlewar.lua:onSay
[18:56:15.756] Description:
[18:56:15.756] data/talkactions/scripts/castlewar.lua:2: attempt to call global 'Castle_trySave' (a nil value)
[18:56:15.756] stack traceback:
[18:56:15.756] data/talkactions/scripts/castlewar.lua:2: in function <data/talkactions/scripts/castlewar.lua:1>


this function in 102-castle.lua in lib folder

function Castle_trySave(cid)
if not(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER) then
doPlayerSendCancel(cid, "Sorry, but you have to be a leader of guild.")
return true
end

if (getGlobalStorageValue(castleConfig.enabledStorage) ~= 1) then
doPlayerSendCancel(cid, "Sorry, but it's not time yet.")
return true
end

if (getPlayerLevel(cid) < castleConfig.leaderLevel) then
doPlayerSendCancel(cid, "Sorry, but your level is too low.")
return true
end

local players = Castle_getGuildMembers(getPlayerGuildId(cid))
if (#players == 1) then
doPlayerSendCancel(cid, "Sorry, but you haven't any online members in guild.")
return true
end

if (#players < castleConfig.membersNeeded) then
doPlayerSendCancel(cid, "Sorry, but you need at least ".. castleConfig.membersNeeded .." guild members online.")
return true
end
if (tonumber(getGlobalStorageValue(castleConfig.guildOwnStorage)) == tonumber(getPlayerGuildId(cid))) then
doPlayerSendCancel(cid, "Your guild should protect Castle, not attack.")
return true
end

if (#Castle_getAttackers() == 3) then
doPlayerSendCancel(cid, "Sorry, we have already 3 attacking guilds.")
return true
end
if (isInArray(Castle_getAttackers(), getPlayerGuildId(cid))) then
doPlayerSendCancel(cid, "Be patient, war will start in a few minutes.")
return true
end

setGlobalStorageValue(castleConfig.attackersStorage, getGlobalStorageValue(castleConfig.attackersStorage)..getPlayerGuildId(cid)..",")
doBroadcastMessage("[ Castle Event Info ]\n\nGuild ".. getPlayerGuildName(cid) .." will fight for Castle.\nAttackers: ".. #Castle_getAttackers() .." / 3", MESSAGE_INFO_DESCR)

for i, pid in ipairs(getPlayersOnline()) do
if (isInArray(getPlayerGuildId(cid), getPlayerGuildId(pid))) then
doTeleportThing(pid, castleConfig.startAttackers[#Castle_getAttackers()])
end
end
return true
end

can someone help?

on tfs 0.3.6 it works
 
if (isInArray(getPlayerGuildId(cid), getPlayerGuildId(pid))) then
should be
if (isInArray(getPlayerGuildId(pid), getPlayerGuildId(pid))) then
(perhaps, i'm not entirely sure)

not entirely sure where the error is sorry
 
i think changing a lib doesn't require restart etc
they're only loaded when needed (or at least the one i made for my arena mode didn't need restart to work)
 
heh, im noob;d i forgot to upload my lib folder to ftp.

i uploaded it, and /reload globalevents and nothing

i open my private server on my pc(with xampp)

1. i open my private server with lib
2. i deleted my lib(102-castle.lua)
3. /reload globalevents
4. and script works fine ;d


so deleting my lib didnt changed nothing
 
Back
Top