01.12.2012, 12:17
(
Последний раз редактировалось bensmart469; 12.03.2014 в 17:10.
)
Hello guys! This is bensmart469 presenting you a simple tutorial on how to make simple commands
First of all, you will need to have zcmd, make sure to add this onto the top too
There are many other command processors but for now, we will use this.
First of all, we will make the simple /help command
Firstly, define color_yellow or any color which you want (replace the color_yellow with color_NAMEHERE and then the html color code)
WARNING, IF USING A FILTERSCRIPT USE #define filterscript
Here is the command, don't worry if you don't understand it! It will be described
Sends the player a message (playerid)
Now, we will make a /fullhealth command
This is to set the player's health to 100
This is to send the player a message
If you are looking for a few more, better commands, there is one below which takes money from you and gives you full health and armor in exchange
This checks if the player does not have enough money for the health, if they don't, it will send them a message
This takes 500 dollars from the player
These set the player's health and armor to 100
This is to send the player a message to say that they have been healed
These commands were only for those who are new to scripting, I may make another tutorial soon for those who are more experienced with scripting.
And any bugs or compiling errors, post below, i will help you as soon as possible
First of all, you will need to have zcmd, make sure to add this onto the top too
PHP код:
#include <zcmd>
First of all, we will make the simple /help command
Firstly, define color_yellow or any color which you want (replace the color_yellow with color_NAMEHERE and then the html color code)
WARNING, IF USING A FILTERSCRIPT USE #define filterscript
PHP код:
#define COLOR_YELLOW 0xFFFF00FF
PHP код:
CMD:help(playerid, params[])
{
SendClientMessage(playerid, COLOR_YELLOW, "welcome to the test server!");
return 1;
}
PHP код:
SendClientMessage(playerid, COLOR_YELLOW, "welcome to the test server!");
Now, we will make a /fullhealth command
PHP код:
CMD:fullhealth(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_YELLOW, "You have set your health to 100");
return 1;
}
PHP код:
SetPlayerHealth(playerid, 100);
PHP код:
SendClientMessage(playerid, COLOR_YELLOW, "You have set your health to 100");
If you are looking for a few more, better commands, there is one below which takes money from you and gives you full health and armor in exchange
PHP код:
CMD:refillhealth(playerid,params[])
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_YELLOW, "You need 500 dollars in order to use this command");
GivePlayerMoney(playerid,-500);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_YELLOW, "You have payed 500 dollars to be healed");
return 1;
}
PHP код:
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_YELLOW, "You need 500 dollars in order to use this command");
PHP код:
GivePlayerMoney(playerid,-500);
PHP код:
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
PHP код:
SendClientMessage(playerid, COLOR_YELLOW, "You have payed 500 dollars to be healed");
These commands were only for those who are new to scripting, I may make another tutorial soon for those who are more experienced with scripting.
And any bugs or compiling errors, post below, i will help you as soon as possible