///****************************************************************************// /* Fire-Script by Sniperwolfes */ //****************************************************************************// #include //====================================== #define Labels // 3D Labels above the Fires showing the Health? #define LoseHealth // Should Players and Vehicles lose Health if they stand in the fire? //====================================== #define Holding(%0) \ ((newkeys & (%0)) == (%0)) #define MaxFire 80 // How many fires max.? forward OnFireKill(ID, killerid); forward f_OnPlayerUpdate(playerid); //forward VehicleToPoint(Float:radi, vehicleid, Float:x, Float:y, Float:z); forward HealthDown(); forward f_init(); public f_init() { #if defined LoseHealth SetTimer("HealthDown", 600, 1); #endif } new FireObj[MaxFire], Float:FirePos[MaxFire][3], TotalFires = 0, FireHealth[MaxFire], FireHealthMax[MaxFire]; #if defined Labels new Text3D:FireText[MaxFire]; #endif stock AddFire(Float:x, Float:y, Float:z, Health) { TotalFires++; new ID = TotalFires; FireObj[ID] = CreateObject(3461, x, y, z-2.61, 0, 0, 0.0); FirePos[ID][0] = x, FirePos[ID][1] = y, FirePos[ID][2] = z; FireHealth[ID] = Health; FireHealthMax[ID] = Health; #if defined Labels new string[128]; format(string, sizeof(string), "%d/%d", FireHealth[ID], FireHealthMax[ID]); FireText[ID] = Create3DTextLabel(string, 0xFFFFFFFFF, x, y, z, 20, 0); #endif } stock DeleteFire(ID) { DestroyObject(FireObj[ID]); TotalFires--; FirePos[ID][0] = 0, FirePos[ID][1] = 0, FirePos[ID][2] = 0; #if defined Labels Delete3DTextLabel(FireText[ID]); #endif } stock DeleteAllFire() { new ID; for(ID = 0; ID= DistanceCameraTargetToLocation(cx, cy, cz, x, y, z, fx, fy, fz)); } /*public VehicleToPoint(Float:radi, vehicleid, Float:x, Float:y, Float:z) { new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetVehiclePos(vehicleid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; }*/ public HealthDown() { new i,v,p; for(i = 0; i