Hey, I've made a script that'll send a message box to the hoster 
Simply, you write /message "hey moron, login
and he'll receive a message box saying that 
So, this goes to data/talkactions/scripts:
- message.lua
- talkactions.xml:
- global.lua (top)
- global.lua (bottom)
Download this program:
http://claudiosoft.online.fr/msgbox.zip
Take MSGBOX.exe and place it in your servers folder (where config.lua and the distro is).
Now, I must tell you that I don't use TFS for testing so I'm unsure if escapeString will do as I think it does... So... You'll have to tell me if it works with texts like "'"*"*2'*"'2'2 xD
Regards,
Colandus

Simply, you write /message "hey moron, login


So, this goes to data/talkactions/scripts:
- message.lua
PHP:
local STORAGE_VALUE = 4353
local EXHAUST_TIME = 20
local ACCESS_TO_USE = 1
function onSay(cid, words, param)
if (getPlayerGroupId(cid) >= ACCESS_TO_USE) then
if (exhaust(cid, STORAGE_VALUE, EXHAUST_TIME) == 1) then
if param:len() >= 5 then
if param:len() <= 1950 then
io.popen('msgbox.exe "' .. escapeString(param) .. '" "' .. getPlayerName(cid) .. ' [' .. os.date("%d/%m/%Y") .. ']\"')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, message is too long.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please enter a message consisting atleast 5 letters.")
end
if (MESSAGE_SAVE_LOG == true) then
logs = io.open("./data/logs/commands.log", "a")
logs:write("[" .. os.date("%d/%m/%Y") .. "] " .. getPlayerName(cid) .. ": " .. words .. " " .. escapeString(param) .. "\n")
logs:close()
end
else
doPlayerSendCancel(cid, "Please wait before sending another message to the hoster.")
end
else
doPlayerSendCancel(cid, "You can not execute this command.")
end
return 1
end
- talkactions.xml:
PHP:
<talkaction words="/message" script="message.lua" />
- global.lua (top)
PHP:
MESSAGE_SAVE_LOG=true
- global.lua (bottom)
PHP:
function exhaust(cid, storevalue, exhausttime)
-- Exhaustion function by Alreth, v1.1 2006-06-24 01:31
-- Returns 1 if not exhausted and 0 if exhausted
newExhaust = os.time()
oldExhaust = getPlayerStorageValue(cid, storevalue)
if (oldExhaust == nil or oldExhaust < 0) then
oldExhaust = 0
end
if (exhausttime == nil or exhausttime < 0) then
exhausttime = 1
end
diffTime = os.difftime(newExhaust, oldExhaust)
if (diffTime >= exhausttime or diffTime < 0) then
setPlayerStorageValue(cid, storevalue, newExhaust)
return 1
else
return 0
end
end
Download this program:
http://claudiosoft.online.fr/msgbox.zip
Take MSGBOX.exe and place it in your servers folder (where config.lua and the distro is).
Now, I must tell you that I don't use TFS for testing so I'm unsure if escapeString will do as I think it does... So... You'll have to tell me if it works with texts like "'"*"*2'*"'2'2 xD
Regards,
Colandus
Last edited: