26.06.2013, 03:43
(
Last edited by DJTunes; 03/07/2013 at 03:31 PM.
)
Tutorial:
How to make commands using Zcmd.
What is ZCMD?: Zcmd is a easy command processor which allows you to create commands easier.
Requirements:
- PAWN compiler.
- Basic PAWN knowledge.
- ZCMD include downloaded.
Requirement Downloads
PAWN Download (Windows) = http://files.sa-mp.com/samp03x_svr_R1-2_win32.zip
PAWN Download (Linux) = http://files.sa-mp.com/samp03xsvr_R1-2.tar.gz (doesn't include PAWNO)
ZCMD Download = http://www.solidfiles.com/d/879d1213...6d464e90c8cf9/
Tutorial Start!
Step 1.You must open a new fresh script with PAWNO. To start a new script, go to "File", and then click "New".
Step 2.
Now, you must copy & paste the following under the default include which is #include <a_samp>...
Now, paste the following bellow the default include:
pawn Code:
#include <zcmd>
Step 3.
You can press Ctrl + A at the same time, and then press delete to clear the whole script, but I recommend not doing that until you become advanced. So, for now, scroll down to where it says the following:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
ZCMD Command:
pawn Code:
CMD:Greet(playerid, params[])
{
SendClientMessage(playerid, COLOR_GREEN,"Hello world!");
return 1;
}
Step 4.
Let's make a simple "/kill" command!
First of all, load a new script as you did in the first step... After that type the following somewhere random at the bottom of your script:
pawn Code:
CMD:kill(playerid, params[])
{
Now, right after the "{" add the following:
pawn Code:
SetPlayerHealth(playerid,0);
Now after that, enter it.
Copy & Paste the following, and add it onto the line after SetPlayerHealth:
pawn Code:
return 1;
}
pawn Code:
CMD:kill(playerid, params[])
{
SetPlayerHealth(playerid,0);
return 1;
}