Hi!
In this post i'd like to help those who don't know about scripting or they are beginners and they do not know how to add commands and add any action in it, Well, It is very easy, Before that i'm going to introduce myself. I am a 15-16 years old programmer from Pakistan. I've studied PHP , Javascript from different sites, Because i really thought that coding language will also make scripting easy. Yes, that's true if you're alone and you have no teacher and i recommend you to learn Javascript , C or c++, Because you would have understood some commands and will get to know what coding is. So that'd make scripting easier, But if you don't know any coding language then don't worry because there's a teacher to help you out! . So Let's begin the tutorial.
Following is the example of adding command!
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
//Following command is used to show commands which you've added,
Code:
if (strcmp(cmdtext,"/cmds") == 0)
{
SendClientMessage(playerid, 0xAA3333AA, "/kill , /get ");
return 1;
}
If you'll write /cmds then this will appear as:
Code:
/kill , /get

That was easy, wasn't it?
So let's go forward to add any action in the command
Let's make a command to give person a gun.
Note: You should write "else if" because this will make a single action.
Like:
Code:
else if (strcmp("/molo", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, HexColorHere, "You have recieved some molotovs.");
GivePlayerWeapon (playerid,18,15);
return 1;
}
Well, Following command will just send a person message who writes that command
Code:
SendClientMessage(playerid, HexColorHere, "You have recieved some molotovs.");
And following command will give weapon only
Code:
GivePlayerWeapon (playerid,weaponid,ammount);
So, it is very easy to add command then other coding. isn't it?
Reply if you want more help then i'll help you out!