Forum

> > CS2D > Scripts > Commands
Forums overviewCS2D overview Scripts overviewLog in to reply

English Commands

2 replies
To the start Previous 1 Next To the start

old Commands

OutstandingPP
BANNED Off Offline

Quote
Hello Guys.

I want admin commands because i am learning scripting and i need help.

Just send me code for the commands so i can use it

Example: !kill <id> or !kick <id>


yep i am noob scripting u don't need to reply me with it

old Re: Commands

GeoB99
Moderator Off Offline

Quote
You should search for Lua tutorials such as the one user Yates provided if you want to succeed at learning the language. It'd roughly take several days to weeks to cope with Lua basics if you have never coded in your life.

https://www.tutorialspoint.com/lua/ (pretty useful, I recommend it - you can find more on Google)
http://www.cs2d.com/help.php (CS2D Lua Commands/Hooks/etc. reference)

Here's also an example code of how you build the commands you need.
The Code >

Easy stuff. However note that it uses
string.sub()
which is inefficient and slow in performance. It must be used only when you add few commands. Once you have got the basic knowledge, I suggest that you use the pattern matching (thread cs2d [Tip] Stop using string.sub() for commands) if you decide to create a script with many commands.
edited 1×, last 13.01.17 08:38:25 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview