SA-MP Forums Archive
HELP automatic CRACK - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP automatic CRACK (/showthread.php?tid=106668)



HELP automatic CRACK - Jo_123 - 04.11.2009



I want if someone has minus 20 hp he will be automatic cracking for 8 seconds.
I DONT KNOW


Re: HELP automatic CRACK - Benne - 04.11.2009

I made this once I was bored. You can't get -20 health I think...

On the top:
pawn Код:
forward IsDead(playerid);
At OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        new Float: sfx;
        new Float: sfy;
        new Float: sfz;
        GetPlayerPos(playerid, sfx, sfy, sfz);
        SetPlayerPos(playerid, sfx, sfy, sfz);
        TogglePlayerControllable(playerid, 0);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
        SetTimer("IsDead",60000, true);
        return 1;
}
public IsDead(playerid)
{
       TogglePlayerControllable(playerid, 1);
       SetPlayerHealth(playerid, 100);
       SpawnPlayer(playerid);
   SendClientMessage(playerid, COLOR_PURPLE, "** You wake up slowly");
       return 1;
}




Re: HELP automatic CRACK - mirkoiz - 04.11.2009

Quote:
Originally Posted by Jo_123
I want if someone has minus 20 hp
Tip:
pawn Код:
GetPlayerName(playerid, currenthealth));
if(currenthealth < 20)
{
}
Quote:
Originally Posted by Jo_123
he will be automatic cracking
Tip:
pawn Код:
new Float:currenthealth;
GetPlayerName(playerid, currenthealth));
if(currenthealth < 20)
{
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
}
Quote:
Originally Posted by Jo_123
for 8 seconds.
Tip:
pawn Код:
forward StopCracking(playerid);
new Float:currenthealth;
GetPlayerName(playerid, currenthealth));
if(currenthealth < 20)
{
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SetTimerEx("StopCracking", 8000, 1, "i", playerid);
}

public StopCracking(playerid)
{
  ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  return 1;
}
These are only Tips... not a working code.. UNTESTED!


Quote:
Originally Posted by Benne
I made this once I was bored. You can't get -20 health I think...

On the top:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        new Float: sfx;
        new Float: sfy;
        new Float: sfz;
        GetPlayerPos(playerid, sfx, sfy, sfz);
        SetPlayerPos(playerid, sfx, sfy, sfz);
        TogglePlayerControllable(playerid, 0);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
        SetTimer("IsDead",60000, true);
        return 1;
}

this would happen if he is dead already.... >.<