15.04.2012, 14:16
pawn Код:
new bomb;
new bombblast;
forward DropBomb(playerid);
COMMAND:airstrike(playerid, params[])
{
if(GetPlayerScore(playerid) >= 2000) return SendClientMessage(playerid, 0xFF0000FF, "You dont have enough score, you need 2000 score");
else
{
if(GetPlayerMoney(playerid)<10000) return SendClientMessage(playerid,COLOR_RED,"Not enough money!");
else
{
GivePlayerMoney(playerid,-10000);
bomb=5;
bombblast = SetTimerEx("DropBomb", 1000, true,"i",playerid);
}
}
return 1;
}
public DropBomb(playerid)
{
bomb--;
if(bomb<=-1)
{
KillTimer(bombblast);
new Float:tX, Float:tY, Float:tZ;
GetPlayerPos(playerid, tX, tY, tZ);
CreateExplosion(tX, tY, tZ, 7, 20.0);
SendClientMessage(playerid, 0xFF0000FF, "Air Strike Successfully Done!");
}
return 1;
}