SA-MP Forums Archive
Getplayerhealth /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)
+--- Thread: Getplayerhealth /crack (/showthread.php?tid=248453)



Getplayerhealth /crack - Bam23 - 14.04.2011

I wish to have if your health is 25 you will do /crack and cant move. Thank you . I looked on the SA-MP and i didnt understand


Re: Getplayerhealth /crack - nemesis_567 - 14.04.2011

Use it on OnPlayerUpdate.
Something like:

pawn Код:
OnplayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) < 25.0 && GetPVarInt(playerid, "CrackAnimDone") == 0)
    {
         //ApplyCrackAnimHere
         //Set here a variable so that the crack animation doesn't keep applying. Something like
         SetPVarInt(playerid, "CrackAnimDone", 1);  
         TogglePlayerControllable(playerid, false);
    }
    else if(GetPVarInt(playerid, "CrackAnimDone") == 1 && GetPlayerHealth(playerid) > 25.0)
    {
         //remove the animation
         SetPVarInt(playerid, "CrackAnimDone", 0);  
         TogglePlayerControllable(playerid, true);
    }
    return 1;
}



Re: Getplayerhealth /crack - DiegoRider - 18.10.2012

D:\#CENSORED#\San Andreas\GTA San Andreas\Server Samp\filterscripts\systemsa.pwn(135) : warning 202: number of arguments does not match definition
D:\#CENSORED#\San Andreas\GTA San Andreas\Server Samp\filterscripts\systemsa.pwn(142) : warning 202: number of arguments does not match definition

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.


Soo...

Please send PM , and repair FS !!!



Re: Getplayerhealth /crack - Roel - 18.10.2012

pawn Код:
// put this at the top of onplayerupdate
new Float:Health;
GetPlayerHealth(playerid,Health);

// replace the other GetPlayerHealth(playerid) with
Health