Simple Help [+rep for helpers]
#1

When a person have 30 hp I want it to do / stopani (the system stop the anim)

the code:
PHP Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define col_grey 0xADADADFF
#define COLOR_RED 0xAA3333AA
public OnPlayerUpdate(playerid)
{
    new 
Float:health;
    
GetPlayerHealth(playeridhealth);
    if(
health <= 20)
    {
    
ApplyAnimation(playerid"CRACK""crckdeth2"4.010000);
    }
    return 
1;

Reply
#2

pawn Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define col_grey 0xADADADFF
#define COLOR_RED 0xAA3333AA



public OnPlayerUpdate(playerid)
{
          new Float:health;
          GetPlayerHealth(playerid,*health);*
          if(health*>=*30)*
          {
                     ClearAnimations(playerid);
          }
          return 1;
}
Reply
#3

pawn Code:
public OnPlayerUpdate(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(health <= 20)
    {
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    }
    else if(health >= 30)
   {
    ClearAnimations(playerid);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
   {
    return 1;
}
Reply
#4

problem with the player update

code:

PHP Code:
public OnPlayerUpdate(playerid)
{
    new 
Float:health;
    
GetPlayerHealth(playeridhealth);
    if(
health <= 20)
    {
    
ApplyAnimation(playerid"CRACK""crckdeth2"4.010000);
    }
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
new 
Float:health;
GetPlayerHealth(playeridhealth);
if(
health >= 30)
{
                     
ClearAnimations(playerid);
}
return 
1;

Reply
#5

OnPlayerUpdate is not recommended. You may use a timer like this
PHP Code:
forward _UpdatePlayersStatus();


public 
OnGameModeInit()
{
    
SetTimer("_UpdatePlayersStatus"1000true);
    return 
1;
}

public 
_UpdatePlayersStatus()
{
    new 
Float:plHealth;
    for(new 
0,GetMaxPlayers(); j++)
    {
        if(!
IsPlayerConnected(i)) continue;
        
GetPlayerHealth(iplHealth);
        if(
plHealth <= 20)
        {
            
ApplyAnimation(i"CRACK""crckdeth2"4.010000);
        }
        else if(
plHealth >= 30)
        {
            
SetPlayerSpecialAction(iSPECIAL_ACTION_NONE);
            
ClearAnimations(i);
        }
    }

Reply
#6

all fine but my player move with bugs now LOL but thank you for the help...

I think it cleans every second the anim
Reply
#7

pawn Code:
public OnPlayerUpdate(playerid)
{
          new Float:health;
          GetPlayerHealth(playerid, health);
          if(health <= 20)
          {
                                    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
          }
          if(health >= 30)
          {
                                   ClearAnimations(playerid);
                                   SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
          }
          return 1;
}
Reply
#8

ERRORS

C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\filterscripts\Death_System.pwn(9) : error 001: expected token: "-identifier-", but found "*"
C:\Users\tal\Desktop\лммй\им\щшъй ощзч\IRP (0.3z)\filterscripts\Death_System.pwn(17) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

Quote:
Originally Posted by howtodo
View Post
all fine but my player move with bugs now LOL but thank you for the help...

I think it cleans every second the anim
You can always add a simple boolean variable to check if the player is already on the ground so it won't play the anim over and over.
Reply
#10

THE COMMAND FOR STOP ANIM ITS /STOPANI you can to use with this CMD? PLEASE HELP ME !!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)