pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
if( hittype == BULLET_HIT_TYPE_OBJECT )
{
if( IsValidObject( hitid ) && hitid == OBJECT_ID )
{
SendClientMessage( playerid, -1, "You shot an object and it was destroyed !" );
DestroyObject( hitid );
}
}
return 1;
}
Anyway, you don't have to use IsValidObject if already checking for BULLET_HIT_TYPE_OBJECT, because it surely exists if it was reported as hitid.