object is not destroyed
#1

Variables
new vidao[MAX_PLAYERS] = 100;
new bool:PlayerObjectDamage[MAX_PLAYERS][MAX_MUEBLES];
System Craft
Код:
enum mdata
{
	idmuebless,
	idma,
	Float:posx,
	Float:posy,
	Float:posz,
	Float:rotx,
	Float:roty,
	Float:rotz,
	Nombrecreador[MAX_PLAYER_NAME]
};
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
	if(hittype == BULLET_HIT_TYPE_PLAYER_OBJECT) { 
		if(IsValidPlayerObject(playerid, hitid)) { 
		    if(PlayerObjectDamage[playerid][hitid] == true) { 
				vidao[hitid] -= random(90) + 1;
				if(vidao[hitid] >= 0) { 
	   			new str[128];
			    format(str, sizeof(str), "~G~Vida! Objecto ID ~W~: ~R~ %d~ HP  ~W~: ~R~ %d", hitid, vidao[hitid]);
			    GameTextForPlayer(playerid, str, 1800, 3);
				}
				if(vidao[hitid] <= 0) { 
				    DestroyPlayerObject(playerid, hitid); 
				   
				}
			}
		}
	}
	return 1;
}
The object is not destroyed when shooting
THEY ARE OBJECTS "CreatePlayerObject"
Help
Reply
#2

Make sure of the following;



Source: https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)