Forum

> > CS2D > Scripts > Y.A.T.E.S.: How to setup [TUT]
Forums overviewCS2D overview Scripts overviewLog in to reply

English Y.A.T.E.S.: How to setup [TUT]

2 replies
To the start Previous 1 Next To the start

old Y.A.T.E.S.: How to setup [TUT]

GeoB99
Moderator Off Offline

Quote
I noticed the user Yates' documentation website of file cs2d Y.A.T.E.S (3.0.2) - Admin Script / Framework is shut-down which deprives people from knowing how to setup properly the framework, create plugins or edit customisable parts of the administration script. The tutorial is intended for those who seek this script but (for some odd reason?) aren't able to get it working.

flame NOTE flame - This tutorial only gives you the basic and fundamental information to make Y.A.T.E.S. work, the rest could be missing cause I can't remember all the parts of the official documentation.

∗ TOOLS NEEDED ∗

• 7-zip or WinRAR (for Windows platforms)
• unzip (for Linux platforms, normally your Linux distro should contain an archive manager to unzip .rar or .zip archives already)
• Git (for Windows, see Chapter 3!)

> Chapter 1 - Extract & Setup

Here's the initial part. You can get the framework from user Yates' github repository (these two words in bold are clickable, click me!). Always install the latest framework version to ensure all the previous bugs are fixed.

Once you did this step create a folder named
_yates
(or any name as you wish but preferable _yates) in
sys/lua
directory path. Afterwards, extract all the files to that folder and you're ready to go.

Oh and a side note! There's also the EXTRACTMEPLEASE.zip which contains all the emoticons needed. You must extract it in the
gfx
folder otherwise the Console would just go batshitmad and print various errors because the emoticons don't exist.

And to finish with, open server.lua file from
sys/lua
and add this line below:

dofile("sys/lua/_yates/yates_startup.lua")


This ensures CS2D will execute the startup module and every service of Y.A.T.E.S. The chapter finishes here.

> Chapter 2 - Authentication

Some guys reported that they don't know how to get the auth token. Auth token is just a sequence of alphanumeric characters to access the administration rights, pretty much like a password. You must follow this chapter in order to get admin privileges or the like.

If you correctly followed the first chapter Y.A.T.E.S. should execute just fine. It should print various messages and info in the Console (press ~ conkey to access the Console). Normally this is how it should look like as in the image below.



As you can see, the phrase highlighted in red colour says you must authenticate with the auth token specific the framework gave you. That's your token! As soon as you authenticate with your token, the framework prepares all the administration rights to you as shown in the image below.



> Chapter 3 - Framework Update

NOTE: For the moment, user Yates' website seems to be completely broken. The framework gets live and latest updates from that website though you might get a failed update check because of that problem. Sorry, blame user Yates.

• For Windows users: the update manager uses cURL to retrieve live update cache for the framework. If the update manager says the update check has failed you must implement Git-SCM in your computer in order to enable Unix tools in Windows Prompt Shell. You can get it from this website.

• For Linux users: Many Linux distributions already have cURL implemented so you're ready to go. Unless, for some rare or odd reason, you don't have that package installed then you must install it via Terminal with the following command line:

sudo apt-get install curl
// For Debian based systems
yum install curl
// For Red Hat based systems

> Chapter 4 - Customise

Certain parts of the framework are editable, such as prefix say for commands, time mute in seconds, etc. and it will not affect the inner core of the system. To get them, just browse
_yates
folder and open
yates_config.lua
. user Yates already explained what these settings do and what for but I can give an explanation of these settings for dummies if you guys are into that.

> Chapter 5 - Plugins

Here's the cool part! Plugins! Plugins are just scripts but the fancier fact is they don't affect Y.A.T.E.S. system and you can expand Y.A.T.E.S. functionality with these. Normally you find plugins in
sys/lua/_yates/plugins
path.

Each plugin has a folder on its own containing various files depending on script functionality. To name few of them are:

startup.lua - This one is the important file for Y.A.T.E.S. This file contains necessary data as Y.A.T.E.S. needs them to launch the plugin properly.

actions.lua - Also the most important one. It has the script engine and functions to work.

config.lua - Also the most important but it can be optional. This one has additional settings parameters in case if your plugin can be configured by specific settings.

To create your first plugin, you must create a new blank startup.lua. Here I give you an example of how startup.lua should look like:

1
2
3
4
5
6
7
yates.plugin['DIRECTORY_NAME']['title'] = 'A plugin which does nothing'
yates.plugin['DIRECTORY_NAME']['author'] = 'ZxC'
yates.plugin['DIRECTORY_NAME']['usgn'] = '99488'
yates.plugin['DIRECTORY_NAME']['version'] = '0.0.1'
yates.plugin['DIRECTORY_NAME']['description'] = 'A simple description, nothing else.'

dofileLua(yates.plugin['DIRECTORY_NAME']['dir'] .. 'FILENAME.lua')

To explain it briefly,
yates.plugin
parses all the data from [] brackets,
['DIRECTORY_NAME']
is where you type the folder name of your plugin (crucial part!), while
title
,
author
,
usgn
,
version
and
description
are info data of your plugin. You must fill these after equal with quotes (denote them as strings).

dofileLua
keyword is similar to
dofile()
although bound to Y.A.T.E.S.
['dir']
tells Y.A.T.E.S. to link up the following files necessary of the plugin and
'FILENAME.lua'
is where you link up a file of the plugin. To say it, if I made a plugin which contains three files (startup.lua, actions.lua and functions.lua) then I must link them by adding in new line
dofileLua()
with all the parameters just like in the example.

• Disable/Enable plugins - In Y.A.T.E.S. you can enable or disable plugins with the command
!plugin
. The command syntax should be like this:

!plugin <disable or enable> <plugin>
// Whose <plugin> is the name of your plugin and <> means important data to fill.

Note that it may require a hard-reload or soft-reload of your server in order to get desired effects. To execute such reloads use
!hardreload
or
!softreload
.

> Chapter 6 - Display messages

As you all know, CS2D uses
msg()
for global messages and
msg2()
for player specific message. In Y.A.T.E.S. there's
yatesMessage()
for these two functions. The synopsis of this function is:

1
yatesMessage(id, 'MESSAGE', 'colour') -- To display a message to a player only whose id is the player's ID

1
yatesMessage(false, 'MESSAGE', 'colour') -- To display a message globally

Here I can give you a small example of a plugin displaying a simple welcoming message to the player.

1
2
3
4
5
function WelcomeMessage(id)
   yatesMessage(id, 'Welcome to my server', 'default')
end

addhook('join', 'WelcomeMessage')

'colour' parameter is the colour message you want to be displayed. For example,
'success'
is green while
'default'
is white. The list of colours used in Y.A.T.E.S. are:

• 'default'
• 'chat'
• 'info'
• 'success'
• 'warning'
• 'alert'

This is it for the moment. Of course I'll edit this tutorial with more stuff as soon as I discover what should matter to be posted. If you guys feel there's something crucial missed here, just say it!

old Re: Y.A.T.E.S.: How to setup [TUT]

Yates
Reviewer Off Offline

Quote
Oh, my bad. I reinstalled my server twice and put everything back apart from my own website

I'll see to it asap. Just need to find that backup first

Thanks for this, by the way

Edit: It's back up. Thank you once again.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview