new ObjectHP[MAX_OBJECTS];new Text3D:mylabel;new obi;obi = CreateDynamicObject(16776, -2084.76709, -2532.95361, 28.10344, 0.00000, 0.00000, 320.47034);ObjectHP[obi] = 500;mylabel = Create3DTextLabel(\"[500/500]\", 0xFFFF00FF, -2087.1465,-2530.3347,35.4219, 20.0, 0, 0);public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){if(hittype == BULLET_HIT_TYPE_OBJECT) { if(IsValidObject(obi)){ new string[128]; ObjectHP[obi] -= 1; format(string,128,\"[500/%i]\",ObjectHP[obi]); Update3DTextLabelText(mylabel, 0xFFFF00FFF,string); if(ObjectHP[obi] <= 0) { DestroyObject(hitid); }}}return 1;}
new ObjectHP[MAX_OBJECTS];new Text3D:mylabel;new obi;obi = CreateDynamicObject(16776, -2084.76709, -2532.95361, 28.10344, 0.00000, 0.00000, 320.47034);ObjectHP[obi] = 500;mylabel = Create3DTextLabel(\"[500/500]\", 0xFFFF00FF, -2087.1465,-2530.3347,35.4219, 20.0, 0, 0);public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){ if(hittype == BULLET_HIT_TYPE_OBJECT) { if(IsValidObject(hitid)) { new string[128]; ObjectHP[hitid] -= 1; format(string,128,\"[500/%i]\",ObjectHP[hitid]); Update3DTextLabelText(mylabel, 0xFFFF00FFF,string); if(ObjectHP[obi] <= 0) { DestroyObject(hitid); } } } return 1;}
if(IsValidObject(hitid)){SendClientMessage(playerid,0xFF6600FF,\"DEBUG!\"); // Ezt a sort írd be
new ObjectHP[MAX_OBJECTS];new Text3D:mylabel;new obi;obi = CreateDynamicObject(16776, -2084.76709, -2532.95361, 28.10344, 0.00000, 0.00000, 320.47034);ObjectHP[obi] = 500;mylabel = Create3DTextLabel(\"[500/500]\", 0xFFFF00FF, -2087.1465,-2530.3347,35.4219, 20.0, 0, 0);public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){ if(hittype == BULLET_HIT_TYPE_OBJECT && hitid == obi) //1. hiba { if(IsValidDynamicObject(obi))//2. hiba { new string[16];//Bőven elég ObjectHP[obi] -= 1; format(string,128,\"[500/%i]\",ObjectHP[obi]); Update3DTextLabelText(mylabel, 0xFFFF00FFF,string); if(ObjectHP[obi] <= 0) DestroyDynamicObject(hitid); //.. } } return 1;}