Getplayerhealth /crack
#1

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
Reply
#2

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;
}
Reply
#3

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 !!!
Reply
#4

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

// replace the other GetPlayerHealth(playerid) with
Health
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)