Heal Commands
#1

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

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)
Reply
#3

Thank you, [MG]Dimi.
Reply
#4

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

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
Reply
#6

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

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

-_- 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.
Reply
#9

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
Reply
#10

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 -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)