Animation Errors
#1

So, firstly. It doesn't put the player into the position as requested nor does it apply the animation - but it doesn't show the Injured Mode text and set his health to 25. A fix would be great.

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
Float:xFloat:yFloat:z;
    new 
str[128];
    new 
PlayerName[MAX_PLAYERS];
    
GetPlayerName(playeridPlayerName24);
    if(
PlayerD[playerid][BrutallyW1] == 0)
    {
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos(playeridxyz);
        
SetPlayerHealth(playerid25.0);
        
GameTextForPlayer(playerid"~b~Injured~r~ Mode"100003);
        
ClearAnimations(playerid);
        
ApplyAnimation(playerid"PED""FLOOR_hit_f"4.110000);
        if(
Character[playerid][Level] <= 10)
        
THIS DOES RETURN DON'T WORRY - I JUST SHOWED HALF OF IT.
        { 

Also, when a player takes damage from getting shot in the leg, it doesn't do the animation when he gets hit. Here is the full code:
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
vid GetPlayerVehicleID(playerid);
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
GetPlayerState(playerid == PLAYER_STATE_DRIVER))
        {
            if(
PRESSED(KEY_HANDBRAKE))
            {
                if(
Engine[vid] == 0)
                {
                    if(
CanDriveVehicle(playeridvid))
                    {
                        
Engine_TOGGLE(playeridvid);
                    }
                }
            }
            else if(
PRESSED(KEY_LOOK_BEHIND))
            {
                
Lights_TOGGLE(playeridvid);
            }
        }
    }
    if(
LoopAnim[playerid])
    {
        if(
PRESSED(KEY_HANDBRAKE))
        {
            
StopLoopingAnim(playerid);
            
TextDrawHideForPlayer(playerid,AnimText[playerid]);
        }
    }
    if(
LegHit[playerid] == 1// Will happen only if the player is shot in his left/right leg.
    
{
        if((
newkeys KEY_JUMP) && !(oldkeys KEY_JUMP)) // When the users presses his Jump key -
        
{
            
ClearAnimations(playerid);
            
ApplyAnimation(playerid"PED""FALL_collapse"4.100000); // Animation would be applied.
            
SendClientMessage(playerid, -1"You can not jump! You've been hit on your leg!"); // Send client message about his injury in his leg.
        
}
        if((
newkeys KEY_SPRINT) && (oldkeys KEY_SPRINT)) // When the user presses the Sprint key -
        
{
            
ClearAnimations(playerid);
            
ApplyAnimation(playerid"PED""FALL_fall"4.100000); // Different Animation would be applied.
            
SendClientMessage(playerid, -1"You're having trouble running because of the Gun Shot Wound"); // Sending client message about his injury(ies) again.
        
}
    }
    return 
1;
 } 
Reply


Messages In This Thread
Animation Errors - by aoky - 03.05.2017, 19:21
Re: Animation Errors - by GoldenLion - 03.05.2017, 19:26
Re: Animation Errors - by aoky - 03.05.2017, 19:34
Re: Animation Errors - by GoldenLion - 03.05.2017, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)