03.07.2015, 22:46
hey, can you give my example how to createobject, and if i shoot on him his destroy ?
new CreatedObject; // Place this as a Global variable.
CreatedObject = CreateObject(MODELID, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.00); // Place this where you're creating the object.
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER_OBJECT && hitid == CreatedObject) // BULLET_HIT_TYPE_PLAYER_OBJECT = Hittype 4
{
DestroyObject(CreatedObject); // Destroys the object you created upon impact.
}
return true;
}