[Tutorial] How to work with includes and plugins.
#1

How to work with 'includes'


Probably there are already tutorials about includes - but I've decide to creat a own one since alot of the new people don't know how to work with a include.
In this tutorial I will explain how to install them and I will give some examples of how to use them. Okay - let's start!

List of populair includes: There are alot of other important plugins/includes but I won't list them all

Anyway let's start. The first thing you need to do is downloading the plugin/include. You can also use the search function if you need another plugin or include. When the download process is finished you need to paste is in the correct folder. Open your server folder and then open the pawno folder. There is a folder called 'include' - open it and past your include / plugin file. (\pawno\include)

When you are using a plugin you need to drop the plugin in the correct folder! (Paste them both into the folder .dll and .so) Open your server file and there is a folder called 'plugins'. Copy and past your plugins into that folder. (yourserver\plugins)

Now - to get it working we need to include the plugin / include. It's not that hard it's really easy! At every scrip you see at the top:
pawn Код:
#include <a_samp>
That's required to use the SA:MP callback. The only thing you need to do if adding your new include under the SA:MP one. Example:
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
// Go on
Congratulations you've included your new plugin / include! Now the real scripting can start. I will start with a small zcmd example. Now you've added the include and you are ready to use the zcmd Command Processor!
Example:
pawn Код:
CMD:rules(playerid, params[])
{
    SendClientMessage(playerid, 0xFFFFFFFF, "Rules: Do not cheat on my server!");
    return 1;
}
NOTE: You need to place the commands outside a callback or whatever! Just at the bottom, alot of people are making this mistake!

Extra:
If you are using a 'plugin' you need to config it correct. Let's start! Open your config.cfg file from your server. Search the line:
Код:
plugins
If you can't find it - you can add it under something f ex:
Код:
filterscripts
plugins
Well done! You've added the plugins line! Very easy was that. To get it working you need to add your plugin name to the line. I will give you a example:
Код:
filterscripts
plugins streamer
WARNING: The example above is for the Windows users!

Let's goto the Linux part. When you download the plugin you will recieve two files. f ex. "Streamer.dll" and "Streamer.so". The windows users need to use the .dll version and Linux the .so version! If you don't know what your host is using - you can simply create a ticket to your hoster and use their support!
Example for the Linux users:
Код:
filterscipts
plugins streamer.so
NOTE: You don't need to place the includes into a config file!

Thank you for reading my tutorial. I hope I've helped some new people out!
~ Kingunit
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)