public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid){new Float:health; GetPlayerHealth(playerid,health); if (health < 50.0) { Elettimer[playerid] = SetTimerEx(\"Elet\",60000,true,\"d\",playerid); } if(health >=100.0) { KillTimer(Elettimer[playerid]); }}funkcio Elet(playerid){new Float:health; GetPlayerHealth(playerid,health);SetPlayerHealth(playerid,health +1.0);GameTextForPlayer(playerid,\"+1 HP\",1000,1);}
#include <a_samp> new Elettimer[MAX_PLAYERS];new ElettimerIsRun[MAX_PLAYERS];forward Elet(playerid); public OnPlayerConnect(playerid){ElettimerIsRun[playerid] = 0;}public OnPlayerDisconnect(playerid,reason){if(ElettimerIsRun[playerid] == 1) {KillTimer(Elettimer[playerid]);}}public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid){new Float:health; GetPlayerHealth(playerid,health); if (health < 50.0 && ElettimerIsRun[playerid] == 0) { Elettimer[playerid] = SetTimerEx(\"Elet\",60000,true,\"d\",playerid); ElettimerIsRun[playerid] = 1; }}public Elet(playerid){ new Float:health; GetPlayerHealth(playerid,health); if(health >=100.0 && ElettimerIsRun[playerid] == 1) { KillTimer(Elettimer[playerid]); return ElettimerIsRun[playerid] = 0; } SetPlayerHealth(playerid,health +1.0); GameTextForPlayer(playerid,\"+1 HP\",1000,1); return 1;}
#include <a_samp>new Timer[MAX_PLAYERS];new bool:TimerOn[MAX_PLAYERS] = false;public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart){new Float:elet;GetPlayerHealth(damagedid, elet);if(elet < 50 && TimerOn[damagedid] == false){ TimerOn[damagedid] = true; Timer[damagedid] = SetTimerEx(\"EletNoveles\", 60000, true, \"d\",damagedid);}return true;}forward EletNoveles(playerid);public EletNoveles(playerid){new Float:elet;GetPlayerHealth(playerid, elet); SetPlayerHealth(playerid,elet +1);GameTextForPlayer(playerid,\"+1 HP\",1000,1);if(elet >= 100) KillTimer(Timer[playerid]), TimerOn[playerid] = false;}
#include <a_samp>new Timer[MAX_PLAYERS];new bool:TimerOn[MAX_PLAYERS] = false;public OnPlayerUpdate(playerid){new Float:elet;GetPlayerHealth(playerid, elet);if(elet < 50 && TimerOn[playerid] == false){ TimerOn[playerid] = true; Timer[playerid] = SetTimerEx(\"EletNoveles\", 60000, true, \"d\",playerid);}return true;}forward EletNoveles(playerid);public EletNoveles(playerid){new Float:elet;GetPlayerHealth(playerid, elet); SetPlayerHealth(playerid,elet +1);GameTextForPlayer(playerid,\"+1 HP\",1000,1);if(elet >= 100) KillTimer(Timer[playerid]), TimerOn[playerid] = false;}