wanted to make buybomb! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: wanted to make buybomb! (
/showthread.php?tid=110473)
wanted to make buybomb! -
WardenCS - 26.11.2009
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
Re: wanted to make buybomb! -
miokie - 26.11.2009
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;
}
Re: wanted to make buybomb! -
dice7 - 26.11.2009
And how do you get 'tmp' ?
Re: wanted to make buybomb! -
WardenCS - 27.11.2009
works!thanks