Forum

> > CS2D > Scripts > How to make an "Admin Script"?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to make an "Admin Script"?

4 replies
To the start Previous 1 Next To the start

old How to make an "Admin Script"?

Quiet
User Off Offline

Quote
Hi guys,
I need your help to tell me what are the basic rules for starting an admin script. i don't want the full code it's made.
I want to know where to start, how to add hudtxt, commands to the admins, mods, etc.
thanks and srry for my english!

old Re: How to make an "Admin Script"?

GeoB99
Moderator Off Offline

Quote
Normally, to begin at developing an administration script you must first create a sort of groups depending on their privileges and powers. Let's say the Admin group for example. Usually, the group verification is based upon player's USGN ID. Like this:

1
2
3
4
5
6
7
Admins = {}

for _, i in ipairs(Admins) do
	if i == player(id, "usgn") then
		-- Admin privileges here
	end
end
Note that this is an example only. Admins is a table (link - for Table reference) which holds only USGN IDs inside of constructor (or let's call inside the brackets). There you must add your own USGN ID to be in "Admins' position. You can add also multiple USGN IDs to give to others the admin privilege according to their USGN ID by separating every USGN ID with a comma.

Afterwards, here we go with commands and other stuff. Generally, most of commands that an admin uses is ban, temp.ban, kick and much more. While moderators can use temp.ban, kick and such. Depends on every admin script. You can check two links below which bring you to a list of CS2D commands, hooks and other stuff.

CS2D Console Commands
CS2D Lua Hooks
CS2D Lua functions (also important)

Well, there are many things to name here so, first of, I would suggest to learn Lua programming language by reading some Lua tutorials if you aren't prepared enough with basic, fundamental skills. I recommend a pil tutorial.

Once you've got most of Lua basics, you can search some Admin Script code examples / samples or check some best known Administration script in File Archive such as file cs2d The Admin Script v4.0.2 Final for example. Then you can make an admin script in your own.

old I Can help you !

Amanda and Friends
User Off Offline

Quote
If you need help, please add my usgn to your friends. then
i will use Software "Team Viewer" then i will do what you need in your script I Like Help People
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview