Help in CMD's
#2

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;
}
Reply


Messages In This Thread
Help in CMD's - by Mr.Black - 29.06.2011, 07:13
Re: Help in CMD's - by PrawkC - 29.06.2011, 07:22
Re: Help in CMD's - by Mr.Black - 29.06.2011, 07:29
Re: Help in CMD's - by HyperZ - 29.06.2011, 07:39
Re: Help in CMD's - by Mr.Black - 29.06.2011, 07:41
Re: Help in CMD's - by HyperZ - 29.06.2011, 08:15

Forum Jump:


Users browsing this thread: 2 Guest(s)