wanted to make buybomb!
#1

Hello,i got prob with command what i wanted to make i want to make you can buy only 1 bomb,but you can buy how many u want:S how can i change it?i wanted to do like that

pawn Код:
if(strcmp(cmd, "/buybomb", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(3.0,playerid,2049.5945,-2022.9886,13.5469))
        {
        if(PlayerInfo[playerid][pBomb] >= 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You already have an bomb!");
                    return 1;
                    }
                  if(GetPlayerMoney(playerid) < 100.000)
                  {
                SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a bomb");
                return 1;
                    }
                    else
                    {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a bomb for 100.000$");
                        new amount = strval(tmp);
                    if (!strlen(tmp)) amount = 1;
                    Bombs[playerid] += amount;
                    SafeGivePlayerMoney(playerid, - 100000);
                OnPlayerUpdate(playerid);
                }
            }
        }
        return 1;
    }
anybody knows?thanks
Reply
#2

pawn Код:
if(strcmp(cmd, "/buybomb", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(3.0,playerid,2049.5945,-2022.9886,13.5469))
        {
        if(PlayerInfo[playerid][pBomb] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You already have an bomb!");
                    return 1;
                    }
                    if(GetPlayerMoney(playerid) < 100000)
                    {
                    SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a bomb");
                    return 1;
                    }
                    else
                    {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a bomb for 100.000$");
                    new amount = strval(tmp);
                    if (!strlen(tmp)) amount = 1;
                    Bombs[playerid] += amount;
                    PlayerInfo[playerid][pBomb] = 1;
                    SafeGivePlayerMoney(playerid, - 100000);
                    OnPlayerUpdate(playerid);
                }
            }
        }
        return 1;
    }
Reply
#3

And how do you get 'tmp' ?
Reply
#4

works!thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)