05.03.2016, 22:20
Hey guys, So I tried to edit a Fire script (RP)
And only when I click the fire key it reduces the Fire HP, it's supposed to keep reducing it as long as I hold the key
Code:
HOLDING Define:
And only when I click the fire key it reduces the Fire HP, it's supposed to keep reducing it as long as I hold the key
Code:
Код:
if (HOLDING( KEY_FIRE )) { new Float:fx, Float:fy, Float:fz; GetDynamicObjectPos(FireObject, fx, fy, fz); new string[256]; if(GetPlayerWeapon(playerid) == 42 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 407) { if(IsPlayerInRangeOfPoint(playerid, 40.0, fx, fy, fz)) { FireHealth -= 1; format(string, sizeof(string), "%d/100%", FireHealth); Update3DTextLabelText(FireText, GREEN, string); if(FireHealth <= 0) { DestroyDynamicObject(FireObject); DestroyDynamicObject(SmokeObject);ww Delete3DTextLabel(FireText); FireHealth = 0; FireTimer = SetTimer("StartRandomFire", 900000, false); format(string, sizeof(string), "Auto-Dispatcher: The fire that was started has been successfully put out. Continue with normal duties."); foreach(Player, i) { if(IsACop(i) || IsAGov(i) || IsMedic(i) || IsSASD(i)) { SendClientMessage(i, COLOR_DEPTRADIO, string); } } return 1; } } } }
Код:
#define HOLDING(%0) \ ((newkeys & (%0)) == (%0))