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

[SOLVED] Report talkaction.

Guitar Freak

_LüA_n☺b_
Joined
Dec 27, 2008
Messages
831
Reaction score
13
Location
Caracas, Venezuela
Hello all, Ive already posted a thread with a similar request a while ago (Ctrl+R one) and got a working answer (Thanks Syntax ;)) but it was a script for 0.3.5 which isnt released yet (for non-donators), so I cant put it to work in my current project.

Now Im wondering something else but with a similar functionality.

Im wondering if its possible to make a talkaction script so when people make reports in-game using the talkaction /report "Text, a .txt file is created (or any extension for that matter, if it is more convenient) on my server's folder called something like "reports.txt" and then every subsequent report made in-game would appear there separated by commas, spaces, lines, numbers or whatever if possible.

(Like the file "Players Record.txt" that gets modified automatically when a player record is made in the server)

Or better yet, Id make a folder called like "Reports" and everytime someone makes a report it creates a file with the person's name or maybe the date of the report? Something like "Report 5/8/2009 - Guitar Freak.txt" and it makes different .txts for every different report.

So, is this possible? Or anything working similar to this?

Im using TFS 0.3.2, but if for any reason you can only make it for 0.3.4+ (or anything aslong as it is 0.3+, with the exception of 0.3.5) its ok to me.

Big thanks in advance.
{Needless to say, Ill + Rep any helpful answers, as always}
 
Last edited:
Lua:
function onSay(cid, words, param, channel)

	-- !report
	-- by Maxi (Shawak)

	level = 20    -- level to post an error

	if getPlayerLevel(cid) >= level then
		Log = io.open(getDataDir().."logs/Reports (!report).txt", "a+")
		Log:write("Date: "..os.date("%d/%m/%y").."\n")
		Log:write(""..getPlayerName(cid)..": "..param.."\n\n")
		Log:close()
		doPlayerSendTextMessage(cid,18,"Report Manager: Report have successfully sent.")
	else
		doPlayerSendTextMessage(cid,18,"Report Manager: You have to be level "..level.." to post an error.")
	end	
	return TRUE
end

I hope it works :D.

Regards,
Shawak
 
@Shawak:

It works perfectly mate, I deeply love you right now :D However I need to wait a while before +repping you again but I will :thumbup:

+Rep to you too Pyro, didnt know bout that thread but will learn from it aswell!

PS: The script works perfectly but I tweaked it a bit (and mixed it with Colandus's broadcast script) to make it more configurable (I know you could've done that too Shawak, but I wanted to learn a bit myself too :)), so if anyone is interested here it is:

http://otland.net/f81/working-report-talkaction-0-3-a-44500/

Cheers.
 
Last edited:
Back
Top