Код:
new oid[ 10 ];
public OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid )
{
new Float:P[3];
GetPlayerPos(playerid, P[0], P[1], P[2]);
new Float: hp ;
GetPlayerHealth(playerid, hp), hp -= amount;
if( amount >= 3 )
{
oid [ 0 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ], P [ 2 ], 0 , 0, 0, 25.0 ) ;
oid [ 1 ] = CreateObject ( 18668 , P [ 0 ]+2 , P [ 1 ], P [ 2 ] , 0 , 0, 0, 25.0 ) ;
oid [ 2 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ]+2, P [ 2 ] , 0 , 0, 0, 25.0 ) ;
oid [ 3 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ], P [ 2 ]+2 , 0 , 0, 0, 25.0 ) ;
oid [ 4 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ], P [ 2 ]-2 , 0 , 0, 0, 25.0 ) ;
oid [ 5 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ]-2, P [ 2 ] , 0 , 0, 0, 25.0 ) ;
oid [ 6 ] = CreateObject ( 18668 , P [ 0 ]-2 , P [ 1 ], P [ 2 ] , 0 , 0, 0, 25.0 ) ;
SetTimerEx("DestroyObj",2000,false,"i",playerid);
}
return 1;
}
forward DestroyObj();
public DestroyObj()
{
for(new i; i < 7 ; i++)
{
DestroyObject(oid[i]);
}
return 1;
}