24.09.2009, 19:17
Ok, I have this airstrike script.
The code:
But now it 'drops' the airstrike on the position where the player is AFTER the 7 seconds, but i want the airstrike to be dropped on the position where the player is BEFORE the 7 seconds. Any1 knows how i can do this?
Thanks in advantage.
The code:
pawn Код:
//On top of my GM
forward strike(playerid);
pawn Код:
//The command
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/airstrike", true)==0)
{
SetTimerEx("strike", 7000, false, "i", playerid);
SendClientMessage(playerid, 0xFFFFFFAA, "Airstrike on your position in 7 seconds!");
return 1;
}
return 0;
}
pawn Код:
// And this
public strike(playerid)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateExplosion(X, Y, Z, 7, 100);
CreateExplosion(X+5, Y, Z, 7, 100);
CreateExplosion(X, Y+5, Z, 7, 100);
CreateExplosion(X-5, Y, Z, 7, 100);
CreateExplosion(X, Y-5, Z, 7, 100);
CreateExplosion(X+10, Y, Z, 7, 100);
CreateExplosion(X, Y+10, Z, 7, 100);
}
Thanks in advantage.