HELP automatic CRACK
#1



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

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;
}

Reply
#3

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.... >.<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)