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

Update script to TFS 1.2?

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi, it's possible to update this script to TFS 1.2? I think it's all outdated functions.

Code:
talkactions = {
["/flags"] = {acctype = 5, group = 0, rec = false},
["/save"] = {acctype = 4, group = 0, rec = false},
["/cls"] = {acctype = 5, group = 0, rec = false},
["/mounts"] = {acctype = 5, group = 4, rec = true},
["/addons"] = {acctype = 5, group = 4, rec = true},
["/looktype"] = {acctype = 5, group = 0, rec = false},
["/o"] = {acctype = 5, group = 0, rec = false},
["/newtype"] = {acctype = 5, group = 0, rec = false},
["/invisible"] = {acctype = 4, group = 0, rec = false},
["/ghost"] = {acctype = 4, group = 0, rec = false},
["/ban"] = {acctype = 4, group = 0, rec = true},
["/ipban"] = {acctype = 5, group = 4, rec = true},
["/unban"] = {acctype = 5, group = 4, rec = true},
["/c"] = {acctype = 5, group = 4, rec = true},
["/owner"] = {acctype = 5, group = 4, rec = true},
["/t"] = {acctype = 4, group = 0, rec = false},
["/a"] = {acctype = 4, group = 0, rec = false},
["/info"] = {acctype = 4, group = 0, rec = true},
["/r"] = {acctype = 5, group = 4, rec = true},
["/kick"] = {acctype = 4, group = 0, rec = true},
["/closeserver"] = {acctype = 5, group = 4, rec = false},
["/m"] = {acctype = 5, group = 4, rec = true},
["/i"] = {acctype = 5, group = 0, rec = true},
["/s"] = {acctype = 5, group = 4, rec = true},
["/blogin"] = {acctype = 4, group = 3, rec = false},
-- /execute is hidden
-- commands not registered are ignored
["!help"] = {acctype = 0, group = 0},
}

function doSavePlayerTalkaction(cid, words, param, reason)
   local pos = getThingPos(cid)
   file = io.open("talkactions_log.txt", "a+")
   file:write("[" .. tostring(reason) .. "][" .. os.date("%a %d %B %Y %X", os.time()).."][" .. Game.convertIpToString(Player(cid):getIp()) .. "][x: ".. pos.x ..", y: ".. pos.y ..", z: ".. pos.z .."][".. getPlayerName(cid) .."]: ".. words .." ".. param .."\n")
   file:close()
return true
end

function canUseCommand(cid, words, param)
   if talkactions[words] == nil then
     if (getPlayerGroupId(cid) == 4 and getPlayerAccountType(cid) == 5) then
       return true
     else
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not execute this talkaction.")
       if talkactions[words].rec then
         doSavePlayerTalkaction(cid, words, param, "error not_listed")
       end
       return false
     end
   end
   
   if getPlayerGroupId(cid) < talkactions[words].group then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not execute this talkaction.")
     if talkactions[words].rec then
       doSavePlayerTalkaction(cid, words, param, "error group_id")
     end
     return false
   end

   if getPlayerAccountType(cid) < talkactions[words].acctype then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not execute this talkaction.")
     if talkactions[words].rec then
       doSavePlayerTalkaction(cid, words, param, "error acctype")
     end
     return false
   end
   
   if talkactions[words].rec then
     doSavePlayerTalkaction(cid, words, param, "executed")
   end
return true
end
 
I only ask'd if it's possible to update it not if I can't read the language what I suppost to do :)

Buy anyway, thanks you for your reply.
 
Last edited:
Back
Top