SA-MP Forums Archive
Heal Commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Heal Commands (/showthread.php?tid=345569)



Heal Commands - HighPitchedVoice - 25.05.2012

How can I do so if the player is in dept of money so he can't use /heal anymore?

pawn Код:
if (strcmp("/heal", cmdtext, true, 10) == 0)
        {
            if(IsPlayerCloseToEnemy(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to refill your health.");
            GivePlayerMoney(playerid, -1000);
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
            return true;
    }



Re: Heal Commands - [MG]Dimi - 25.05.2012

pawn Код:
if (strcmp("/heal", cmdtext, true, 10) == 0)
    {
        if(IsPlayerCloseToEnemy(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to refill your health.");
        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to heal yourserlf.");
        GivePlayerMoney(playerid, -1000);
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
        return true;
    }
GetPlayerMoney(playerid)


Re: Heal Commands - HighPitchedVoice - 25.05.2012

Thank you, [MG]Dimi.


Re: Heal Commands - HighPitchedVoice - 25.05.2012

How does it work with;
pawn Код:
if (strcmp("/shop", cmdtext, true, 10) == 0)
    {
        if(IsPlayerCloseToEnemy(playerid)) return   SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to buy anything in the shop.");
        ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Shop", "9mm - $200\nSilenced Pistol - $1000\nDesert Eagle - $1500\nMP5 - $1500\nShotgun - 1500\nCombat Shotgun - $3500\nAK-47 - $4500\nM4 - $5000\nSniper Rifle - 4500","Buy","Cancel");
        return true;
    }



Re: Heal Commands - thefatshizms - 25.05.2012

Quote:
Originally Posted by HighPitchedVoice
Посмотреть сообщение
How does it work with;
pawn Код:
if (strcmp("/shop", cmdtext, true, 10) == 0)
    {
        if(IsPlayerCloseToEnemy(playerid)) return   SendClientMessage(playerid, COLOR_ORANGE, "You are to close to your enemies to buy anything in the shop.");
        ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Shop", "9mm - $200\nSilenced Pistol - $1000\nDesert Eagle - $1500\nMP5 - $1500\nShotgun - 1500\nCombat Shotgun - $3500\nAK-47 - $4500\nM4 - $5000\nSniper Rifle - 4500","Buy","Cancel");
        return true;
    }
on your OnDialogResponse in each case do the same


Re: Heal Commands - HighPitchedVoice - 25.05.2012

The prices is different there.. How can I do that then?


Re: Heal Commands - thefatshizms - 25.05.2012

pawn Код:
if(GetPlayerMoney(playerid) < PUTAMMOUNTHERE) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to heal yourserlf.");
        GivePlayerMoney(playerid, PUTAMMOUNTHERE);



Re: Heal Commands - HighPitchedVoice - 25.05.2012

-_- There is alot of weapons that can be purchased through /shop and I need to do "You do not have enough money to purchase this item." but it only work to make it for all to 1000 :S - The prices is different.


Re: Heal Commands - $$inSane - 25.05.2012

u should download a weapon shop > Then open it > Add the codes to your script.

a weapon shop tutorial(Not that good):
https://sampforum.blast.hk/showthread.php?tid=334868


Re: Heal Commands - thefatshizms - 25.05.2012

Quote:
Originally Posted by HighPitchedVoice
Посмотреть сообщение
-_- There is alot of weapons that can be purchased through /shop and I need to do "You do not have enough money to purchase this item." but it only work to make it for all to 1000 :S - The prices is different.
lol it doesnt work only for 1000 u can make for how much u like -_-