OnPlayerShootDynamicObject not called
#1

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!
Reply
#2

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 :@
Reply
#3

Quote:
Originally Posted by PoniStar
View Post
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.
Reply
#4

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
Reply
#5

Guyz i realy need this hlp me plz
Reply
#6

Any idea!!!?
Reply
#7

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.
Reply
#8

Quote:
Originally Posted by NaS
View Post
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;
		}
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)