15.07.2013, 11:21
Hey, how's everybody doing? In this BEGINNER FRIENDLY tutorial, I will teach you how to make a suicide command using ZCMD. For this tutorial, you pretty much need to know the basics of Pawno and you're ready to go.
We'll need to change it to something like this:
Step 2. Now that we have the basic command, we'll need to set the player's health to 0, in order for him to die. For that, we'll use the SetPlayerHealth function. This function has 2 parameters.
And there you have your /kill command.
________________________
Step 1. To make a suicide command, we're going to use ZCMD. You can use another command processor but I prefer using ZCMD. This is the format of ZCMD:pawn Code:
COMMAND:mycommand(playerid, params[])
{
// Do something
return 1;
}
pawn Code:
COMMAND:kill(playerid, params[])
{
// Do something
return 1;
}
- playerid The ID of the player to set the health of.
- health The value to set the player's health to.
pawn Code:
COMMAND:kill(playerid, params[])
{
SetPlayerHealth(playerid, 0);
return 1;
}
________________________
Now, for our healing command, we'll use the same structure but instead of setting the player's health to 0, we'll set it to 100.pawn Code:
COMMAND:heal(playerid, params[])
{
SetPlayerHealth(playerid, 100);
return 1;
}