OnPlayerShootDynamicObject not called -
PoniStar - 14.04.2019
hi guyz , i have this callback :
Code:
public OnPlayerShootDynamicObject(playerid, weaponid, objectid, Float:x,Float:y,Float:z)
{
for(new i = 0; i < 20 ; i++)
{
if(IsValidDynamicObject(RobberyCamera[i]) && objectid == RobberyCamera[i])
{
SendClientMessage(playerid,COLOR_GREY,"Object Removed");
DestroyDynamicObject(RobberyCamera[i]);
}
}
return 1;
}
and this is my object OnGameModeInit :
Code:
new RobberyCamera[20];
RobberyCamera[0] = CreateDynamicObject(2921, 1028.75061, -945.85205, 47.29134, 0.00000, 0.00000, 140.93999);
but the OnPlayerShootDynamicObject will not called when i shoot the object ! whats the problem!
Re: OnPlayerShootDynamicObject not called -
PoniStar - 14.04.2019
i found the problem , the security are buggy objects , when you shoot them the bullets go through them and not damage them , but i should use camera objects ._. what can i do :@
Re: OnPlayerShootDynamicObject not called -
NaS - 14.04.2019
Quote:
Originally Posted by PoniStar
i found the problem , the security are buggy objects , when you shoot them the bullets go through them and not damage them , but i should use camera objects ._. what can i do :@
|
It's not a bug if the object just doesn't have any collision.
You could try to find another camera model with collision (if there is any), or place a small object that does have collision at the same place and make it invisible. Then check if that object was hit.
Re: OnPlayerShootDynamicObject not called -
PoniStar - 16.04.2019
dude i just do what you said , i put another object behind that , everything ok on offline (i mean local host , on my pc) but when i run the server on vps , and try to shoot the dynamic objct it will not destroy and the text will not show to player (i mean the funcation will not call or response) whats the problem !!!? srry for my bad english
Re: OnPlayerShootDynamicObject not called -
PoniStar - 16.04.2019
Guyz i realy need this hlp me plz
Re: OnPlayerShootDynamicObject not called -
PoniStar - 17.04.2019
Any idea!!!?
Re: OnPlayerShootDynamicObject not called -
FireBoy89 - 17.04.2019
Show us your new code?
Also what do you mean by "put another object behind that"? You have to replace the original object id with the new obj id and not to create another object behind that.
Re: OnPlayerShootDynamicObject not called -
PoniStar - 17.04.2019
Quote:
Originally Posted by NaS
It's not a bug if the object just doesn't have any collision.
You could try to find another camera model with collision (if there is any), or place a small object that does have collision at the same place and make it invisible. Then check if that object was hit.
|
i mean this one , i placed a small object behind that , because i want camera object and all of them did't have any collision , so i placed a small object and when player shoot the small object the camera will destroy too :
Code:
for(new i = 0; i < 20 ; i++)
{
if(IsValidDynamicObject(UnderCamera[i]) && objectid == UnderCamera[i])
{
SendClientMessage(playerid,COLOR_GREY,"Object Removed");
DestroyDynamicObject(UnderCamera[i]);
DestroyDynamicObject(RobberyCamera[i]);
break;
}
}