unbreakable glass - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: unbreakable glass (
/showthread.php?tid=524713)
unbreakable glass -
9noober - 08.07.2014
How can i make a unbreakable glass in samp

??
Re: unbreakable glass -
BroZeus - 08.07.2014
175 id of unbreakable glass in MTA
Re: unbreakable glass -
9noober - 08.07.2014
but i want id 1649
Re: unbreakable glass -
9noober - 08.07.2014
how to use setobjectmaterial to make unbreakable glass
Re: unbreakable glass -
ABKPot - 08.07.2014
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
//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;
}
EDIT: You must have 'lagcompensation' enabled.. I believe it is enabled by default.
https://sampwiki.blast.hk/wiki/Lag_Compensation
Re: unbreakable glass -
Cena44 - 08.07.2014
Quote:
Originally Posted by ABKPot
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
//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; }
|
Won't work, just tested it. Your method is somehow good though, try this:
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.
Re: unbreakable glass -
9noober - 01.08.2014
not works
can use setobjectmaterial

??