08.07.2014, 04:34
How can i make a unbreakable glass in samp
??

//On top of script
new objwindow; //Store the window object in this variable
//Somewhere in script - objwindow = CreateObject(); //Create your window object.
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
//If the player hit an object, and the object ID that was hit is our window 'objwindow'
if(hittype == BULLET_HIT_TYPE_OBJECT && hitid == objwindow) return 0; //Return 0 to avoid damage
else return 1;
}
I believe the only possible way is like this, I might be wrong. Try it:
pawn Код:
|
//On top of script
new objwindow; //Store the window object in this variable
objwindow = CreateObject(); //Create your window object.
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
//If the player hit an object, and the object ID that was hit is our window 'objwindow' it will create the window again.
if(hittype == BULLET_HIT_TYPE_OBJECT && hitid == objwindow) return objwindow = CreateObject; // Type the same function you used in creating the object the first time.
return 1;
} //Credit to ABKPot of course.