You are on page 1of 12

C.A.

S
Chris’s Administration System
-
Part of the C-SCRIPTS

ABOUT______________________________
C.A.S is mean to be an advanced administration system, which
is compatible with most server gamemodes. It comes with useful
features that will expand a server management. Any data is
stored in SQLite databases. This filterscript was created by
ChrisAgoR.

USAGE______________________________
You are free to use and edit this script, as you like. You are not
allowed to re-post this script (whether edited or not) and/or
claim it as your own work. Please do not remove any credits
listed inside any of the files in the folder. The credits are listed
in the CREDITS section.

INSTALLATION______________________
The installation process is simple. Extract the zipped files into
your server’s folder. This package includes everything the
system needs to function so you will not have to search for
additional files. Also make sure to change your server.cfg in
order for your server to initialize C.A.S. If you are new or do not
know how to do this, follow the below instructions. Open the
server.cfg file, which is located inside your server folder, with a
text editor software (preferably notepad). Edit the following
lines and make sure it looks like this:
filterscripts cas
plugins sscanf Whirlpool
Save it and run your server. The database files will be created
automatically on your server’s folder inside scriptfiles.

FEATURES___________________________
 ACCOUNT SYSTEM:
Users are being stored in a database named by default
CASUsers. The data that is stored in that database are:
- ID – This is a unique number that auto-increases as new
records are added to the database
- NAME
- PASSWORD – The password is hashed by using
Whirlpool hash for the player’s security
- REGISTRATION DATE – The format of the registration
date is DAY/ MONTH/YEAR
- LAST ONLINE – This stores the last timestamp of the
player before disconnecting from the server. The format is
DAY/MONTH/YEAR HOUR:MINUTE:SECOND
- IP – The player’s IP is updated as soon as the player logs
into their account.
- KILLS
- DEATHS
- SCORE
- MONEY
- ADMIN
- VIP
- SPYCMD – This is only available for admins
- SPYPM – This is only available for admins

 BAN SYSTEM:
Player bans are also stored in an individual database named
by default CASBan. The data that is stored in that database,
when a player is banned, are:
- ID – This is a unique number that auto-increases as new
records are added to the database
- NAME
- IP – Upon player connection the IP is checked and the
player is kicked if the IP appears in the bans database
- DATE – The format of the ban date is
DAY/MONTH/YEAR
- REASON – The reason why the player was banned
- ADMIN – The name of the admin who banned the player

 VIP SYSTEM:
A basic VIP system is included. The VIP status can be given
to players who are important to the server and/or contribute
and or donate. As of now, there are not any commands for the
VIP members. To make your own commands or functions
look at the section DO IT MY SELF.

 ANTI-* SYSTEMS:
For a better server management there are many anti- systems,
which will prevent specific player actions to the server. Those
systems are:
- ANTI-HIGH PING: While this is enabled, players with
ping higher than the recommended for smooth gameplay
(500) will receive a high ping warning. If the warnings
reach three (3), the player will be kicked.
- ANTI-SWEAR: This system will detect and block any
‘bad’ words in the chat. You can add your own words to
expand this feature. See the DO MY SELF section.
- ANTI-SPAM: This useful system only allows a player to
send a chat message every 2 seconds from the last one.
- ANTI-CHEAT: A simple Anti-Cheat is present amongst
all other systems. This is a basic Anti-Cheat and you must
not rely directly to it. For more information about this see
below in ANTI-CHEAT SYSTEM.
- AUTO-LOGIN: The auto-login feature will automatically
login registered players that their IP match the last IP they
had.
- ANTI-CHEAT SYSTEM:
As mentioned before this is a basic Anti-Cheat system that
checks for illegal actions from any of the players. As for now,
the Anti-Cheat checks for:
- Weapon Cheat: Overpowered weapons that give players
advantage over others
- Health Cheat: Any player that use cheats to refill/heal their
health
- Armor Cheat: Same as health cheat
- Jetpack cheat
- Vehicle health cheat: Any player that use cheats to repair
their vehicle
Again this system may cause problems with your current
server (ex. It may detect players that use your server’s
features) and though if you are to use it, you must configure it
to your server likes.

- PERSONAL MESSAGES SYSTEM:


Players can exchange personal messages with other players.
You can also turn them on and off. Note that by having
personal messages off, you can no longer receive or send any
messages.

- ADMIN SYSTEM:
There are up to five (5) admin levels available. Each level has
its own commands and features. The messages of the names
of admins performing actions to other players are only visible
to the admins. The players only see the name of the player
and the action. In the future, people who do not find this
useful will have a way to disable it and show the message and
the admin names to everyone.

- SPECTATED PLAYER INFORMATION:


The box provides useful real-time information of the
spectated player, such as health, armor, vehicle, vehicle
health, current weapon, ammunition of this weapon and speed
(vehicle & on foot).

- EXCLUSIVE CHATS:
Admins and VIPs have the ability to send messages to players
who are admins or VIPs. Admins can use the ‘!’ symbol to
send an admin only chat while VIPs can use the ‘#’ symbol to
send a VIP only chat.
- ASK QUESTIONS:
Players can send questions to any admins online for just
anything. This is a very useful feature for new players in your
server who seek for help. Admins level one (1) or higher can
respond to a question and deal with any problems the player
may have. To prevent spam, a player can only send a
question at a time and though to send another one, the other
question must be answered first. Admins can also view recent
questions by using /questions.

- ADVANCED ACCOUNT EDITOR:


There are many ways to edit an account. A better way is by
using the command /editacc (admins level four (4) or higher
by default). With this way any player who is that level, can edit
anyone’s account by using dialogs for easier use. See more on
account edit in the EDITING ACCOUNTS/DATABASES.

- PLETHORA OF COMMANDS:
A plethora of commands for every admin level and non-
admin players are available and can be seen in a list by using
/acmds or /cmds. See all the available commands and their
descriptions in the COMMANDS section.

COMMANDS_________________________
As of now, there are 62 commands:
LEVEL 0:
/cmds Show all available player commands
/report Report a player to any online admins
/ask Ask a question to any online admins
/stats [id(optional)] Show stats of a player or yourself
/pm [id] [message] Send a personal message to a player
/togglepm Toggle personal messages on and off
/saveacc Save your stats
/changepass Change your account password

LEVEL 1:
/acmds Show all available admin commands
/reports Show all recent player reports
/questions Show all recent player questions
/gtext [message] Send a screen text to everyone
/ann [message] Announce an admin message to everyone
/adcar Spawn an admin car
/adbike Spawn an admin bike
/admins Show a list of every online admin

LEVEL 2:
/kick [id] [reason] Kick a player with a reason
/drop [id] Drop a player from a height. Used to check
for health cheats.
/mute [id] [reason] Disallow a player from using the chat for
specific time
/unmute [id] Unmute a player, allowing them to use the
chat again
/sethour [0-23] Change the server time
/setweather Change the server weather
/spec [id] Spectate a player
/specoff Stop spectate
/warn [id] [reason] Warn a player. Maximum warning before
kick: three (3) by default
/cc Clear chat
/arepair [id] Repair a player’s vehicle
/eject [id] Eject a player from their vehicle
/apm [id] [message] Send an admin personal message to a
player

LEVEL 3:
/freeze [id] Freeze a player
/unfreeze [id] Unfreeze a player
/akill [id] [reason] Admin kill a player for a reason
/weaps [id] Show all the weapons a player currently has
/ban [id] [reason] Ban a player
/unban [name/IP] Unban a player by name or IP
/searchban [name/IP] Search if a player name or IP is banned. If
it is banned, a dialog with all the ban
information will display.
/get [id] Teleport a player to your location
/goto [id] Teleport to a player’s location
/giveweap [id] [weapon name] Give a player a specific weapon
/aheal [id] Heal a player
/tp [id1] [id2] Teleport player ID 1 to player ID 2 location
/explode [id] Explode a player. Used for checking for
health cheats.
/respawn [id] Respawn a player
/ip [id] See a player’s IP
/disarm [id] Remove a player’s weapons
/amode Enable admin-mode. This will give you
infinite health and a minigun. To disable it
use /amode again
/givearmour [id] Give a player full armour
LEVEL 4:
/editacc [id] Enter the Account Editor process of an
online player
/editoffline [name] Enter the Account Editor process of an
offline player
/akillall Admin kill everyone
/freezeall Freeze everyone
/unfreezeall Unfreeze everyone
/giveallweap [weapon name] Give everyone a specific weapon
/saveallstats Save everyone’s accounts
/spy Toggle on and off spy features
/jetpack Gives you a jetpack

LEVEL 5:
/setadmin [id] [0-5] Set a player to an admin level
/setvip [id] Give a player VIP status
/remvip [id] Remove a player VIP status
/casconfig Enter the CAS configuration process
/agmx [seconds] Postpone a server restart. All online
player’s accounts will be saved

RCON:
/setowner Gives you level 5 admin

DO IT MYSELF_______________________
In this section, several tutorials will guide you how to configure
and make your own commands and functions through CAS.

 HOW TO MAKE MYSELF AN ADMIN:


It’s simple to receive owner status (level five (5) admin). To do
this all you have to do is login as RCON admin using /rcon
login [password] where password is the rcon_password line in
your server.cfg file. After logging in, type /setowner. This will
give you level five (5) admin level allowing you full access to
every C.A.S feature.

 HOW TO EDIT AN ACCOUNT:


You can edit an account by editing the database itself or for more
ease by using the command /editacc or /editoffline.
-Database: The database used to store player and server data is
SQLite. To edit a SQLite database you will need to download a
SQLite browser. I personally use DB Browser for SQLite. While
you have a software to open a SQLite database file, load the
database you want to edit (located inside the scriptfiles folder).
Then there will be an option to view the database’s data. From
there you can either edit a value, insert a new record or delete a
record. After making changes, you must always make sure to
click “write data” button in order for the database to apply the
changes.
A more simplified way to edit a player’s account is by using the
commands /editacc and /editoffline. This makes editing a value
or even removing the account easier and can be also used by all
admins level four (4) and higher by default.

 HOW TO MAKE MY OWN COMMANDS:


You can easily create your own commands if you study some of
the already implemented ones. Writing a command inside the
cas.pwn file. Any command must be written at the bottom of the
script. Below is a command with checks:
C.A.S also makes it possible that you can also create your own
commands or features in your own gamemode or filterscripts by
using the functions C.A.S includes. To do this you must load the
include file cas_function.inc in your gamemode or filterscript.
Then you will be able to use the following functions:
-IsPlayerAdminLevel(playerid, level): This function checks if
the level passed in the function is equal or greater to the player’s
current admin level.
-IsPlayerVIP(playerid): This function checks if the player has
VIP status.
- GetPlayerKills(playerid): This function returns the number of
the current player’s kills.
- GetPlayerDeaths(playerid): This function returns the number
of the current player’s deaths.
The following functions checks if these specific systems are
enabled:
- IsAntiSpamEnabled()
- IsAntiSwearEnabled()
- IsAntiPingEnabled()
- IsAntiCheatEnabled()
NOTE: If you do not already know, when these functions return
1 it means true while 0 means false.
The following command is the same as above but is scripted
inside another gamemode or filterscript.
First of all include the cas_functions.inc file:
CREDITS____________________________
ChrisAgoR – Creating C.A.S
SA-MP Community
Abagail – Whirlpool plugin
Y_Less – sscanf
Misco – GetPlayerSpeed function

You might also like