31.08.2011, 21:07
(
Last edited by Swyft™; 03/10/2011 at 02:06 AM.
)
NOTE: I got a message from a moderator about I didn't follow something in the guidelines, so hopefully this will take care of it! This is another re-upload. If there is any problems please just reply, I might of made a mistake but who knows.
ZCMD Well ZCMD is a type of include file that calls a command function
COMMAND Defines that you are using a ZCMD Command (You can also use CMD instead of COMMAND)
YourCommandHere is where you would place the name of the command you wish to use. (ie. /yourcommandhere)
Playerid Return of the player who typed the command that is added in your FS or GM
params[] is the parameters of the command (You can also use params instead of params[] (tested it and it worked with me)
Step 1: We need to download the include file for zcmd to work!
Download Link: https://sampforum.blast.hk/showthread.php?tid=91354
Step 2: At the top of your FS and GM we need to make sure we included the ZCMD include file, so this has to be added at the top of your script for it to work.
Step 3: Now we have to search for "OnPlayerCommandText" once we found it we have to delete it (Do not delete your commands that are in it.)
Well remove it you don't need it just make sure you use // to seperate it so it makes more sence for you guys to understand, so you are not confused with "OnPlayerText"
I am going to transfer my strcmp command to ZCMD, which in this case is named "/YourCommandHere"
Now, this is a STRCMP command, so we have to make it a ZCMD command. All we are doing is converting =D
We are going to replace it with this
Changing the title is basically all you do like in here
This is very simple to do, at the end you do not need to add return 0;
Well hope this tutorial helped if you want to see the filterscript that compiled correctly then look below
ZCMD Well ZCMD is a type of include file that calls a command function
COMMAND Defines that you are using a ZCMD Command (You can also use CMD instead of COMMAND)
YourCommandHere is where you would place the name of the command you wish to use. (ie. /yourcommandhere)
Playerid Return of the player who typed the command that is added in your FS or GM
params[] is the parameters of the command (You can also use params instead of params[] (tested it and it worked with me)
Step 1: We need to download the include file for zcmd to work!
Download Link: https://sampforum.blast.hk/showthread.php?tid=91354
Step 2: At the top of your FS and GM we need to make sure we included the ZCMD include file, so this has to be added at the top of your script for it to work.
pawn Code:
#include <zcmd>
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
// Do something here
return 1;
}
return 0;
}
I am going to transfer my strcmp command to ZCMD, which in this case is named "/YourCommandHere"
pawn Code:
if (strcmp("/yourcommandhere", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_RED,"This is a test command");
return 1;
}
pawn Code:
if (strcmp("/yourcommandhere", cmdtext, true, 10) == 0)
pawn Code:
COMMAND:yourcommandhere(playerid, params[])
pawn Code:
COMMAND:yourcommandhere(playerid, params)
{
SendClientMessage(playerid, COLOR_RED,"This is a test command");
return 1;
}
Well hope this tutorial helped if you want to see the filterscript that compiled correctly then look below