Need small help if is not a problem :3
#1

so if the player have no money send him message (You don't have enough money)
i cant figure it out HaHa ;(
pawn Код:
else if(clickedid == TDEditor_TD[9])
    {
    //Buy m4
    GivePlayerWeapon(playerid,WEAPON_M4,1500);
    GivePlayerMoney(playerid,-1800);
    SendClientMessage(playerid,0x00FF00,"You Bought M4-A1 with 1500 ammo");
    }
Reply
#2

pawn Код:
if(GetPlayerMoney(playerid) >= 1800)
{
      // code
}
else return SendClientMessage(playerid, -1, "You don't have enough money.");
or
pawn Код:
if(GetPlayerMoney(playerid) < 1800) return SendClientMessage(playerid, -1, "You don't have enough money.");
Reply
#3

pawn Код:
else if(clickedid == TDEditor_TD[9])
    {
    //Buy m4
        if(GetPlayerMoney(playerid) < 0)
        {
           SendClientMessage(playerid, -1, "You don't have enough money to purchase this item.");
           return 1;
        }
    GivePlayerWeapon(playerid,WEAPON_M4,1500);
    GivePlayerMoney(playerid,-1800);
    SendClientMessage(playerid,0x00FF00,"You Bought M4-A1 with 1500 ammo");
    }
Reply
#4

thanks
now i can finally release my work <3
Reply
#5

pawn Код:
else if(clickedid == TDEditor_TD[9])
{
        if(GetPlayerMoney(playerid) < 1800) return SendClientMessage(playerid, -1, "You dont have enough money to buy this gun.");
    //Buy m4
    GivePlayerWeapon(playerid,WEAPON_M4,1500);
    GivePlayerMoney(playerid,-1800);
    SendClientMessage(playerid,0x00FF00,"You Bought M4-A1 with 1500 ammo");
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)