OnPlayerWeaponShot object - 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: OnPlayerWeaponShot object (
/showthread.php?tid=624868)
OnPlayerWeaponShot object -
Amads - 24.12.2016
So, I don't get why this doesn't work.
I create a dynamic object, and it is supposed to be destroyed when you shoot it, but I can shoot it how much I want and nothing happens.
PHP Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_OBJECT)
{
for(new i; i < 50; i++)
{
if(hitid == objTest[i])
{
DestroyDynamicObject(objTest[i]);
objTest[i] = -1;
break;
}
}
}
return 1;
}
Re: OnPlayerWeaponShot object -
JaKe Elite - 24.12.2016
Use the callback OnPlayerShootDynamicObject
PHP Code:
public OnPlayerShootDynamicObject(playerid, weaponid, STREAMER_TAG_OBJECT objectid, Float:x, Float:y, Float:z)
Re: OnPlayerWeaponShot object -
Amads - 24.12.2016
Quote:
Originally Posted by JaKe Elite
Use the callback OnPlayerShootDynamicObject
PHP Code:
public OnPlayerShootDynamicObject(playerid, weaponid, STREAMER_TAG_OBJECT objectid, Float:x, Float:y, Float:z)
|
Thanks!