SA-MP Forums Archive
Kill system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kill system (/showthread.php?tid=405594)



Kill system - gurmani11 - 07.01.2013

.....................


Re: Kill system - DiGiTaL_AnGeL - 07.01.2013

This can't be done without 5 timers.


Re: Kill system - gurmani11 - 07.01.2013

will u plz explain :OOO


Re: Kill system - park4bmx - 07.01.2013

pawn Код:
new KillTimer[MAX_PLAYERS];
command:kill(playerid)
{
      KillTimer[playerid] = SetTimerEx("TakeAwayPlayersHealth", 1000, true, "i", playerid);
      return 1;
}

fowrward TakeAwayPlayersHealth(playerid);
public TakeAwayPlayersHealth(playerid)
{
      new Float:pHP;GetPlayerHealth(playerid,pHP);
      if(pHP >=80) SetPlayerHealth(playerid, 80);
      else if(pHP >=60&& pHP <80) SetPlayerHealth(playerid, 60);
      else if(pHP >=40&& pHP <60) SetPlayerHealth(playerid, 40);
      else if(pHP >=20&& pHP <40) SetPlayerHealth(playerid, 20);
      else if(pHP >=0&& pHP <20){SetPlayerHealth(playerid, 0);KillTimer(KillTimer[playerid]);}
      return 1;
}
done with 1 timer!


Re: Kill system - gurmani11 - 07.01.2013

not works


Re: Kill system - gurmani11 - 03.02.2013

can anyone help
with it ?


Re: Kill system - spedico - 03.02.2013

pawn Код:
forward TakeAwayPlayersHealth(playerid);
public TakeAwayPlayersHealth(playerid)
{
    new Float:pHP;GetPlayerHealth(playerid,pHP);
    if(pHP >=80) SetPlayerHealth(playerid, 80);
    else if(pHP >=60 && pHP <= 80) SetPlayerHealth(playerid, 60);
    else if(pHP >=40 && pHP <= 60) SetPlayerHealth(playerid, 40);
    else if(pHP >=20 && pHP <= 40) SetPlayerHealth(playerid, 20);
    else if(pHP >=0 && pHP <= 20)
    {
        SetPlayerHealth(playerid, 0);
        KillTimer(KillTimer[playerid]);
    }
    return 1;
}



Re: Kill system - gurmani11 - 03.02.2013

no effect

actually i want it like
if player type /kill
the health go down every second 20 percent
so in 5 seconds player dies


Re: Kill system - SilverKiller - 03.02.2013

Put this in your code:

pawn Код:
SetTimerEx("TakeAwayPlayersHealth", 1000, false, "i", playerid);
And you need the callback from spedico.

(This will make your health goes down with 20% after 1 second from the command and keep going down until 0.)


Re: Kill system - gurmani11 - 03.02.2013

.....................