29.06.2011, 07:22
pawn Код:
if (strcmp("/Buyhealth", cmdtext, true, 10) == 0) //The 10 here is the length of the command, not 100% sure if you need to include the /, so if 10 doesnt work make it 9, same for the armor cmd. (9 > 8)
{
new money;
GetPlayerMoney(playerid, money);
if(money < 10000) return SendClientMessage(playerid, -1, "You can't afford this!");
SetPlayerHealth(playerid, 100.0);
GivePlayerMoney(playerid, -10000);
return 1;
}
if (strcmp("/BuyArmor", cmdtext, true, 9) == 0)
{
new money;
GetPlayerMoney(playerid, money);
if(money < 10000) return SendClientMessage(playerid, -1, "You can't afford this!");
GetPlayerArmour(playerid, armor);
SetPlayerArmour(playerid, 100.0);
GivePlayerMoney(playerid, -10000);
return 1;
}