05.08.2013, 09:16
Basic Player Commands
Hey Guys, in this tutorial Im going to show you how to make some Basic Player Commands like /health, /killme, /teleport, etc. Okay in this tutorial, i will use zcmd as my include in making commands. It is simple and easy include, but very helped. Lets Getting Started.
ZCMD <--- Made by Zeex
First of all, you need to download zcmd.inc. You can download the file in above link. After you download it, copy paste zcmd.inc to pawno/include folder.
Okay, if you have done with it, lets start
We need to define the zcmd file first:
Write it exactly under include <a_samp>
Okay, i wanna introduce you, the simple/basic parameters of using zcmd as your commands.
Example like this:
Okay, mycommand is the name of your commands. thats very basic parameters of zcmd using.
Okay Now lets move. We gotta make, example, Health Commands!
Okay type this:
Okay let me explain what i did here.
Once player, type /health, then we set the playerhealth be 100 (100 is full health)
SetPlayerHealth is that function to set the player health. This is one of All function that you need when you are scripting. You can check all full list of function here
And SendClientMessage is the function to send message when Player do something.
. -1 is color white.
Okay following is some important function that may needed and its parameters:
SetPlayerPos is the function to setplayerposition to whatever we want. We gotta need this one when we are making teleport commands. To get your X, Y, Z coordinates, you need to enter samp debug, and then find your location where you want set your player position, then type /save yourname here if you have found the right position.
This command if need if we gotta give player a weapons. ID of weapon can be checked in wiki samp.
This command is needed when we gotta repair our vehicle.
This command is for give player money. we can set the ammounts. example:1000.
Okay, thoose are some basic commands that may you guys need. We've make simple heal commands. Now we gonna make Teleport Commands!!
So when we typed /lasventuras, the player will get teleport to las venturas in front of Four Dragon Casino.
is a coordinates. You can get your coordinates like ive explained above:
Okay, Now we have make 2 commands!
Heal, and teleport Commands!
Now lets move on to make simple /kill commands!
Write this:
Now lets move on to make givemoney commands!
Okay that is my tutorial
Wish it helped for newbie or beginners
Hey Guys, in this tutorial Im going to show you how to make some Basic Player Commands like /health, /killme, /teleport, etc. Okay in this tutorial, i will use zcmd as my include in making commands. It is simple and easy include, but very helped. Lets Getting Started.
ZCMD <--- Made by Zeex
First of all, you need to download zcmd.inc. You can download the file in above link. After you download it, copy paste zcmd.inc to pawno/include folder.
Okay, if you have done with it, lets start
We need to define the zcmd file first:
pawn Code:
#include <zcmd>
Okay, i wanna introduce you, the simple/basic parameters of using zcmd as your commands.
Example like this:
pawn Code:
CMD:mycommand(playerid, params[])
{
//do something here
return 1;
}
Okay Now lets move. We gotta make, example, Health Commands!
Okay type this:
pawn Code:
CMD:health(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "You Have been healed");
return 1;
}
Once player, type /health, then we set the playerhealth be 100 (100 is full health)
SetPlayerHealth is that function to set the player health. This is one of All function that you need when you are scripting. You can check all full list of function here
And SendClientMessage is the function to send message when Player do something.
pawn Code:
SendClientMessage(playerid, -1, "your message here")
Okay following is some important function that may needed and its parameters:
pawn Code:
SetPlayerHealth(playerid, 100); // 100 means the health become full. if you set 0 the player will be dead
pawn Code:
SetPlayerPos(playerid, X, Y, Z coordinates);
pawn Code:
GivePlayerWeapon(playerid, idofweapon, ammoofweapon);
pawn Code:
RepairVehicle(playerid, 100);
pawn Code:
GivePlayerMoney(playerid, ammountofmoney);
Okay, thoose are some basic commands that may you guys need. We've make simple heal commands. Now we gonna make Teleport Commands!!
pawn Code:
CMD:lasventuras(playerid, params[])
{
SetPlayerPos(playerid, 2029.1147,1016.0054,10.8203); //like ive explained above, SetPlayerPos is need when we want make teleport commands. Thoose coordinates will teleport you to las venturas, in front of Four Dragon Casino
return 1;
}
pawn Code:
2029.1147,1016.0054,10.8203
Quote:
To get your X, Y, Z coordinates, you need to enter samp debug, and then find your location where you want set your player position, then type /save yourname here if you have found the right position. |
Heal, and teleport Commands!
Now lets move on to make simple /kill commands!
Write this:
pawn Code:
CMD:kill(playerid, params[])
{
SetPlayerHealth(playerid, 0); // 0 is to make player's health be 0 and then death
return 1;
}
pawn Code:
CMD:givemoney(playerid, params[])
{
GivePlayerMoney(playerid, 3000); //3000 is ammount, you can change it.
return 1;
}
Wish it helped for newbie or beginners