26.11.2009, 19:06
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
anybody knows?thanks
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;
}