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

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
./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:
OP
chojrak

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
@KaAmil43:
Ty, gz first post xd
 
Joined
Sep 29, 2009
Messages
224
Best answers
0
Reaction score
0
Can Make For Work With Only Some GM's ?

Nice Scripts ;]
 
OP
chojrak

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
@wilkerhell:
Code:
local gms = {"GM Wilkherhell", "GM Noob", "CM Doopa"}
if (isInArray(getCreatureName(cid), gms) then
 

elf

Sing, sing blue silver
Joined
Dec 11, 2007
Messages
3,665
Best answers
1
Reaction score
116
Location
Cracow, Poland
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.
 
OP
chojrak

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
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:

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
851
Location
Caribbean Sea
seems useful
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Good work, please include on the next TFS release.
 

elf

Sing, sing blue silver
Joined
Dec 11, 2007
Messages
3,665
Best answers
1
Reaction score
116
Location
Cracow, Poland
You could also add 'isPlayerPzLocked' for /kick ;)
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
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.
 

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Best answers
14
Reaction score
76
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:

Saint

New Member
Joined
Jun 16, 2007
Messages
231
Best answers
0
Reaction score
1
Location
Łódź, Poland
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>
 

Northnorial

Member
Joined
May 30, 2009
Messages
742
Best answers
0
Reaction score
5
Location
Germany
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"/>
 

Artiniix

New Member
Joined
Dec 7, 2008
Messages
168
Best answers
0
Reaction score
0
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:
OP
chojrak

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
Bad luck guys. :)
 

Artiniix

New Member
Joined
Dec 7, 2008
Messages
168
Best answers
0
Reaction score
0
Why bad luck?:p don't you know a solution for it?:(
 
Top