Please help me
#1

I need the code to remove the - sign of the money under your health bar.. by this i mean that when anybody buys something it will make his money by -(money), i just want to set the money to 0 and never get under the - sign, beacause everybody though will buy anything and won't have for it but will get it and thanks
Reply
#2

Well, insted of making a new timer and all, for this simple thing. I would just show you how to do it.
pawn Код:
// on OnPlayerUpdate(playerid)
public OnPlayerUpdate(playerid)
{
    if(GetPlayerMoney(playerid) < 0)
    {
         SetPlayerMoney(playerid, 0);
    }
    return 1;
}
If you want to make it more complex, you can make it with a timer and delay it for a bit.
Reply
#3

BullseyeHawk, you didn't understand him.
The script should be like that.

pawn Код:
if (Getplayermoney(playerid) < "Price of thing he would buy") return SendClientMessage(playerid, 0xCC0000FF, "You don't have enough money to buy that thing..");
else
{
       Giveplayermoney(playerid, -"Price of thing he would buy" )
       SendClientMessage(playerid, 0xCC0000FF, "you bought that thing.");
}
Something like that, just edit the value and those messages and try it
Reply
#4

Quote:
Originally Posted by Golimad
Посмотреть сообщение
BullseyeHawk, you didn't understand him.
The script should be like that.

pawn Код:
if (Getplayermoney(playerid) < "Price of thing he would buy") return SendClientMessage(playerid, 0xCC0000FF, "You don't have enough money to buy that thing..");
else
{
       Giveplayermoney(playerid, -"Price of thing he would buy" )
       SendClientMessage(playerid, 0xCC0000FF, "you bought that thing.");
}
Something like that, just edit the value and those messages and try it
Thanks alot thats what i meant
Reply
#5

Quote:
Originally Posted by BullseyeHawk
Посмотреть сообщение
Well, insted of making a new timer and all, for this simple thing. I would just show you how to do it.
pawn Код:
// on OnPlayerUpdate(playerid)
public OnPlayerUpdate(playerid)
{
    if(GetPlayerMoney(playerid) < 0)
    {
         SetPlayerMoney(playerid, 0);
    }
    return 1;
}
If you want to make it more complex, you can make it with a timer and delay it for a bit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)