[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
#2

I like the tutorial design, and sometimes PLUGINS doesn't even need to be an include.
They were added with
pawn Код:
native WP_Hash( ... );
That's one of an important thing.

You need to explain more in the plugin part.

Adding it to the " sampservdirectory/plugins/ "
adding it to the .cfg " plugins whirlpool sscanf2.so "

explaining .so and others.

Thus you can include things like
pawn Код:
#include " a_samp.inc "
#include a_samp
AFAIK.

Quote:
Originally Posted by Kingunit
NOTE: You need to place this outside a callback or whatever! Just at the bottom, alot of people are making this mistake!
WTF? IN THE BOTTOM OMFG

You meant top right. ( If ZCMD, bottom, or if you meant include it's top )

Add : NOT IN A COMMENT.
Reply
#3

Quote:
Originally Posted by Basicz
Посмотреть сообщение
WTF? IN THE BOTTOM OMFG

You meant top right. ( If ZCMD, bottom, or if you meant include it's top )
That NOTE: was for the ZCMD code. Not for the including part.
About the config, I will add it. Anyway thank you about the design. I love working on that.

// Added the config file part.
Reply
#4

Well Done, Kingunit.
Reply
#5

Thank you, G4M3Ov3r.

And sorry that I've forget a part. I've wanted to make a tutorial about includes. But when I was busy I was like: 'How about plugins'. That's why I've forget the installation about a plugin.
Reply
#6

Awesome one. Thank you :').

- JUSTINALLICAAAAAAAAAAAAAAAAAa.
Reply
#7

Quote:
Originally Posted by Ehab1911
Посмотреть сообщение
Awesome one. Thank you :').

- JUSTINALLICAAAAAAAAAAAAAAAAAa.
Thank you bro
Reply
#8

@******

Looks good! But I doubt. I wanna keep this 'noob friendly'. I don't think new people will understand that.
Anyway - Thank you for atleast adding it into a comment!
Reply
#9

Nice work Kingunit. At some parts of the tutorial spellings are wrong like: importand.
Reply
#10

Quote:
Originally Posted by Davz*|*Criss
View Post
Nice work Kingunit. At some parts of the tutorial spellings are wrong like: importand.
Thank you! Noticed and fixed them
Reply
#11

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
@******

Looks good! But I doubt. I wanna keep this 'noob friendly'. I don't think new people will understand that.
Anyway - Thank you for atleast adding it into a comment!
It is noob friendly. He's actually given you (in definition!) how includes work with PAWN.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)