English Using commands in chat with "!"

9 replies
Goto Page
To the start Previous 1 Next To the start
Up
KidJony
User
Offline Off
Can SomeOne can give me some commands for add in my server
Like !rs command for resetscore
and !b command for !broadcast say every 1 sec
etc...

Thanks.
Im kidd me is idiat

Admin/mod comment:

"Can SomeOne give me ..." give what? Leaving the most important part of the title away? Seriously? Did a random fucking zombie eat your stupid brain or what? Fixed! /DC
05.09.12 09:03:10 pm
Up
Happy eyes
User
Offline Off
user KidJony has written:
Can SomeOne can give me some commands for add in my server
Like !rs command for resetscore
and !b command for !broadcast say every 1 sec
etc...

Thanks.


Use admin script.... Im too lazy to write how bad you are because asking of things already scripted and uploaded millions times ago.
05.09.12 09:50:10 pm
Up
krabob
User
Offline Off
user Happy eyes has written:
millions times ago.


People help the people
05.09.12 10:10:48 pm
Up
Blunt
User
Offline Off
@user KidJony: you can do it. use your luaskills o,o
or your scripts not write by you??
Inaktiv.
06.09.12 08:55:57 am
Up
MikuAuahDark
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
commands = {
     {
          cmd = "say",
          script = function(id,...)
               local args = {...}
               msg(id,string.char(169).."255255255"..os.date("%H:%M:%S").." "..player(id,"name")..": "..table.concat(args))
          end,
     },
}

addhook("say","yellcmd")
function yellcmd(id,txt)
     if txt:sub(1,1)=="!" then
          cmdd = false
          argument = {}
          for word in string.gmatch(txt,"[^%s]+") do
               table.insert(argument,word)
          end
          for n,v in pairs(commands) do
               if txt:sub(2,#v.cmd)==v.cmd then
                    cmdd=true
                    v.script(id,unpack(argument))
               end
          end
          if cmdd==false then msg2(id,string.char(169).."255000000Unknown Command!")
          end
          return 1
     end
end

the code above is used by RL Roleplay Citylife. it's easy to add command just add
Code:
1
2
3
4
{
     cmd = "<cmdname>",
     script = function(id,<another argument>) end,
},
before the end of table
EDIT: Forgot something on code, thanks to user Infinite Rain's code because it remind me
edited 1×, last 07.09.12 12:31:29 pm
file cs2d LuaJIT for Dedicated Server (13) JIT POWER! | Know your Lua errors! | Part of LÖVE development team since 11.3
06.09.12 10:17:33 am
Up
Zins
User
Offline Off
user KidJony has written:
Can SomeOne can give me some commands for add in my server
Like !rs command for resetscore
and !b command for !broadcast say every 1 sec
etc...

Thanks.

u want to get ideas for commands or u want the lua ready ?
06.09.12 11:05:26 am
Up
ExecL
User
Offline Off
user Blunt has written:
@user KidJony: you can do it. use your luaskills o,o
or your scripts not write by you??


Editing the tibia script is not skills.
06.09.12 01:12:13 pm
Up
Chingy
User
Offline Off
user ExecL has written:
user Blunt has written:
@user KidJony: you can do it. use your luaskills o,o
or your scripts not write by you??


Editing the tibia script is not skills.

It's far far away from it.
06.09.12 02:30:50 pm
Up
Infinite Rain
Reviewer
Offline Off
First of all you need special string function:

Code:
1
2
3
4
5
6
7
function StrToTable(str)
     local tbl = {}
     for word in string.gmatch("[%S]+") do
          table.insert(tbl, word)
     end
     return tbl
end


After that you must program the commands

Code:
1
2
3
4
5
6
7
addhook('say', 's')
function s(id, text)
     local tbl = StrToTable(text)
     if tbl[1] == "!die" then
          parse('killplayer '.. id)
     end
end


easy
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
14.09.12 06:06:08 pm
Up
KidJony
User
Offline Off
Thanks For Users Replyed With a Code
I don't want Lua Script Already Ready i Just want Codes

For New Lua Script
Im kidd me is idiat
To the start Previous 1 Next To the start