29.08.2012, 00:24
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if (strcmp("/healhelp", cmdtext, true, 9) == 0)
{
SendClientMessage(playerid,COLOR_RED,"If you want to heal yourself use /healme, wich will cost 500 and for armour /armour wich will be 1000.");
return 1;
}
if (strcmp("/healme", cmdtext, true, 7) == 0)
{
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid,COLOR_GREEN,"You have reafilled your health.");
SendClientMessage(playerid,COLOR_BLUE,"Make sure to /healhelp for more information!");
return 1;
}
if (strcmp("/armour", cmdtext, true, 7) == 0)
{
SetPlayerArmor(playerid,100);
SendClientMessage(playerid,COLOR_RED,"You have refilled your armour.");
SendClientMessage(playerid,COLOR_BLUE,"Make sure to /healhelp for more information!");
return 1;
}
return 0;
}
Also , adding 10 as a constant was wrong..
Just count how many characters including the slash , and add the length there
![Cheesy](images/smilies/biggrin.png)