21.10.2011, 07:19
i have made this command and when i run this it makes explosion with the timer of 6 seconds but it explodes area where the player is after 6 seconds i don't know where is error !
and this
Код:
if ( !strcmp( "/cannonfire", cmdtext, true, 10 ) )
{
if( GetPlayerMoney(playerid) < 10000 ) return SendClientMessage( playerid, 0xFF0000FF, "You dont have Enough Money For a Cannon Strike" );
else
{
SendClientMessage( playerid, 0x00FF00FF, "Cannon fire on your position in 6 Seconds and counting!" );
GivePlayerMoney( playerid, -10000 );
SetTimerEx( "CannonExplosion", 6000, false, "i", playerid );
}
return true;
}
Код:
forward CannonExplosion(playerid);
public CannonExplosion(playerid)
{
new
Float: P[ 3 ];
GetPlayerPos( playerid, P[ 0 ], P[ 1 ], P[ 2 ] );
CreateExplosion( P[ 0 ] + random( 5 ), P[ 1 ] + random( 5 ), P[ 2 ] + random( 5 ), 6, 100.0 );
}

