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

TFS 1.X+ !commands + /commands TFS 1.3 HELP

jo31

New Member
Joined
May 24, 2010
Messages
70
Reaction score
1
Location
Sweden
Hello guys, ive been trying alots of !commands scripts and i cant seem to find one that works, so i tried to make my own.
And i am a really bad Lua scripter as you can see, almost Zero knowledge :D
Im better at mapping and administrative stuff and managing stuff.

Heres the code (which i am embarrased to share :D)
Lua:
function onSay(cid, words, param, player)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,
                .. "!buypremium" .. "\n"
                .. "!buyhouse" .. "\n"
                .. "!sellhouse" .. "\n"
                .. "!leavehouse" .. "\n"
                .. "!spells" .. "\n"
                .. "!uptime" .. "\n"
                .. "!kills" .. "\n"
                .. "!online" .. "\n"
                .. "!serverinfo" .. "\n"
                .. "!commands" .. "\n"
                .. "!aol" .. "\n"
                .. "!blessing" .. "\n"
                .. "!blessings" .. "\n"
                .. "!skillpoints" .. "\n"
                .. "!points" .. "\n"
                .. "!point" .. "\n"
                .. "!home" .. "\n"
                .. "!autoloot")
      return true
    end


Can anyone help me?
 
oooups, i missclicked it as "Solved" but i tried that and it didnt work..?
Post automatically merged:

Lua:
function onSay(player, words, param)
    if player:getExhaustion(1000) <= 0 then
        player:setExhaustion(1000, 2)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Player commands:" .. "\n"
        .. "!buypremium" .. "\n"
        .. "!buyhouse" .. "\n"
        .. "!sellhouse" .. "\n"
        .. "!leavehouse" .. "\n"
        .. "!spells" .. "\n"
        .. "!uptime" .. "\n"
        .. "!kills" .. "\n"
        .. "!online" .. "\n"
        .. "!serverinfo" .. "\n"
        .. "!commands" .. "\n"
        .. "!aol" .. "\n"
        .. "!blessing" .. "\n"
        .. "!blessings" .. "\n"
        .. "!skillpoints" .. "\n"
        .. "!points" .. "\n"
        .. "!point" .. "\n"
        .. "!home" .. "\n"
        .. "!autoloot")
        return false
    else
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You\'re exhausted for: '..player:getExhaustion(1000)..' seconds.')
    end
end
 
This one work for me.

data/talkactions/talkactions.xml
XML:
<talkaction words="!commands" script="commands.lua"/>

data/talkactions/scripts/commands.lua
Lua:
function onSay(cid, words, param)
local p = Player(cid)
local file = io.open("data/talkactions/commands.xml", "r+")
local str = ""
local text = ""
for line in (file:lines()) do
  str = str.."\n"..line
end
file:close()

for a in string.gmatch(str, 'words="(.-)"') do
  text = text..'\n'..a
end

  p:showTextDialog(2160, text)
  return true
end

In data/talkaction create new file commands.xml and inside put your commands.
My looks like:
XML:
    words="!afk - activate afk mode"
    words="!find - find any player on server"
    words="!go - change guild outfit"
    words="!stamina - buy stamina"
    words="!bank - bank system"
    words="!shop - shop system"
    words="!backpack - buy backpack"
    words="!aol - buy aol"
    words="!rank - show rank"
    words="!buyhouse - buy house"
    words="!leavehouse - leave house"
    words="!sellhouse - sell house"
    words="!uptime - show uptime"
    words="!online - how much online player"
    words="!serverinfo - server info"
    words="!report - report bug"
    words="!bless - buy bless"
    words="!pvpbless - buy twist of fate"
    words="!addon - make addon"
    words="!changesex - change your sex"
    words="!kills - check frags"

Ingame
comm.png
 
Last edited:
This one work for me.

data/talkactions/talkactions.xml
XML:
<talkaction words="!commands" script="commands.lua"/>

data/talkactions/scripts/commands.lua
Lua:
function onSay(cid, words, param)
local p = Player(cid)
local file = io.open("data/talkactions/commands.xml", "r+")
local str = ""
local text = ""
for line in (file:lines()) do
  str = str.."\n"..line
end
file:close()

for a in string.gmatch(str, 'words="(.-)"') do
  text = text..'\n'..a
end

  p:showTextDialog(2160, text)
  return true
end

In data/talkaction create new file commands.xml and inside put your commands.
My looks like:
XML:
    words="!afk - activate afk mode"
    words="!find - find any player on server"
    words="!go - change guild outfit"
    words="!stamina - buy stamina"
    words="!bank - bank system"
    words="!shop - shop system"
    words="!backpack - buy backpack"
    words="!aol - buy aol"
    words="!rank - show rank"
    words="!buyhouse - buy house"
    words="!leavehouse - leave house"
    words="!sellhouse - sell house"
    words="!uptime - show uptime"
    words="!online - how much online player"
    words="!serverinfo - server info"
    words="!report - report bug"
    words="!bless - buy bless"
    words="!pvpbless - buy twist of fate"
    words="!addon - make addon"
    words="!changesex - change your sex"
    words="!kills - check frags"

Ingame
View attachment 46515
This is working so cool! Im using TFS 1.2.
 
Back
Top