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

TalkAction Few "things" to control gms on your server.

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Solutions
2
Reaction score
160
./data/talkactions/scripts/kick.lua, above doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been kicked."):
Code:
doWriteLogFile("data/logs/kicks.txt", "[".. os.date('%d %B %y - %H:%M') .."] ".. getCreatureName(cid) .." has kicked out ".. getCreatureName(pid) .." (Skull: ".. getCreatureSkullType(pid) ..", in fight: ".. hasCondition(pid, CONDITION_INFIGHT) and 1 or 0 ..")")
Output:
Code:
[27 August 09 - 17:31] Chojrak has kicked Futurista (Skull: None, in fight: 0)


./data/talkactions/scripts/teleporthere.lua, above doSendMagicEffect(tmp, CONST_ME_POFF):
Code:
doWriteLogFile("data/logs/teleports.txt", "[".. os.date('%d %B %y - %H:%M') .."] ".. getCreatureName(cid) .." has teleported ".. getCreatureName(pid) .." to position x : ".. pos.x ..", y : ".. pos.y ..", z : ".. pos.z ..".")
Output:
Code:
[28 August 09 - 01:36] Futurista has teleported Chojrak to positions: 558 : 632 : 8


./data/talkactions/createitem.lua, above doSendMagicEffect(tmp, CONST_ME_MAGIC_RED)
:
Code:
doWriteLogFile("data/logs/items.txt", "[".. os.date('%d %B %y - %H:%M') .."] ".. getCreatureName(cid) .." has created item ".. t[1] ..".")
Output:
Code:
[28 August 09 - 14:46] Chojrak has created item "sudden death rune".

It's kinda old, did it in 0.3.4pl2 times. But should work with 0.3.5+.
 
Last edited:
@wilkerhell:
Code:
local gms = {"GM Wilkherhell", "GM Noob", "CM Doopa"}
if (isInArray(getCreatureName(cid), gms) then
 
Why do you open the file twice? For reading and writing... Can't you use append mode? Perhaps, your 'w' won't create a file if it doesn't exists. Try 'a+' next time.

Also, on 0.3.1+ there's simple function 'doWriteLogFile'-

doWriteLogFile('data/logs/kicks.log', getCreatureName(cid) .. ' has kicked out ' .. getCreatureName(pid) .. '.')

Its hell unecessary, but sometimes simplifies your life.
 
Why do you open the file twice? For reading and writing... Can't you use append mode? Perhaps, your 'w' won't create a file if it doesn't exists. Try 'a+' next time.
Thanks for the tip. :p

Also, on 0.3.1+ there's simple function 'doWriteLogFile'-

doWriteLogFile('data/logs/kicks.log', getCreatureName(cid) .. ' has kicked out ' .. getCreatureName(pid) .. '.')
Didn't know, first post updated :p
 
Last edited:
Good work, please include on the next TFS release.
 
Definitely!

Would at least reduce the "unproven-corrupt-staff-member" deals from most servers out there :D

Great work Chojrak, +reppek!
:thumbup:

It also allows easy knowledge of what was created, instead of looking up the ID.
 
Rep, Rep, Rep :)

#Edit#
When I past this code:
Code:
doWriteLogFile("data/logs/kicks.txt", "[".. os.date('%d %B %y - %H:%M') .."] ".. getCreatureName(cid) .." has kicked out ".. getCreatureName(pid) .." (Skull: ".. skulls[getCreatureSkullType(pid)] ..", in fight: ".. hasCondition(pid, CONDITION_INFIGHT) and 1 or 0 ..")")
Then this command stopped working. (Don't recorded in the files)

So it is with teleporthere.lua. This command shows the default channel, but at least teleports players.(Don't recorded in the files)

A fully working only kick.lua. It only saves the results in files.
Please help.
 
Last edited:
When I modfied kick.lua as you said it shows an error:

[05/12/2009 19:03:04] Lua Script Error: [TalkAction Interface]
[05/12/2009 19:03:04] data/talkactions/scripts/kick.lua:eek:nSay

[05/12/2009 19:03:04] data/talkactions/scripts/kick.lua:20: attempt to index global 'skulls' (a nil value)
[05/12/2009 19:03:04] stack traceback:
[05/12/2009 19:03:04] data/talkactions/scripts/kick.lua:20: in function <data/talkactions/scripts/kick.lua:1>
 
What about the talkaction log?

yourot\data\logs <- Here you can find every command a Gm has used.
Also go to talkaction.xml and put <talkaction log="yes"

at the beginning of every GM command.

Code:
	<talkaction log="yes" words="/s" access="4" event="script" value="summon.lua"/>
 
Code:
[06/12/2009 21:12:51] Lua Script Error: [TalkAction Interface] 
[06/12/2009 21:12:51] data/talkactions/scripts/teleporthere.lua:onSay

[06/12/2009 21:12:51] luaGetCreatureName(). Creature not found

[06/12/2009 21:12:51] Lua Script Error: [TalkAction Interface] 
[06/12/2009 21:12:51] data/talkactions/scripts/teleporthere.lua:onSay

[06/12/2009 21:12:51] data/talkactions/scripts/teleporthere.lua:29: attempt to concatenate a boolean value
[06/12/2009 21:12:51] stack traceback:
[06/12/2009 21:12:51] 	data/talkactions/scripts/teleporthere.lua:29: in function <data/talkactions/scripts/teleporthere.lua:1>

I'm getting this error:S and I rechecked it twice. same error with Kick but Items is working
 
Last edited:
Back
Top