Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Animation help

$
0
0
Hello, i need some help with death animation.

I want to make it directly play when the player gets wounded, so i want to make it like this:

https://www.youtube.com/watch?v=G8qtXxOpA3I

Look from 0:22, when the player gets down the animation plays direct, but in my gamemode first it's another animation and after that it's this.. How can i make it directly play the animation..

Here's my code:

OnPlayerDeath

PHP Code:

public OnPlayerDeath(playeridkilleridreason)
{
        
ApplyAnimation(playerid"WUZI""CS_Dead_Guy"4.011110,1);
         
ApplyAnimation(playerid"WUZI""CS_Dead_Guy"4.011110,1);


(There's more but i just put the animation)


PHP Code:

if(GetPVarInt(playerid"Injured") == 1)
      {
                  
Streamer_UpdateEx(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                   
SetPlayerPos(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid,"MedicVW"));
                
SetPlayerInterior(playeridGetPVarInt(playerid,"MedicInt"));
                   
ClearAnimations(playerid);
                
ApplyAnimation(playerid"WUZI""CS_Dead_Guy"4.011110,1);
                
SetPlayerTeam(playeridPLAYER_STATE_DEAD);
            } 

And here's the code to OnPlayerStateChange

PHP Code:

            if(GetPVarInt(playerid"Injured") == 1)
              {
                  
Streamer_UpdateEx(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                   
SetPlayerPos(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
                
SetPlayerVirtualWorld(playeridGetPVarInt(playerid,"MedicVW"));
                
SetPlayerInterior(playeridGetPVarInt(playerid,"MedicInt"));
                   
ClearAnimations(playerid);
    
ApplyAnimation(playerid"WUZI""CS_Dead_Guy"4.011110,1); 


And here is the code when the player gets wounded, this is where the animation plays probably.

PHP Code:

forward SendEMSQueue(playerid,type);
public 
SendEMSQueue(playerid,type)
{
    switch (
type)
    {
        case 
1:
        {
            
Streamer_UpdateEx(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
            
SetPlayerPos(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
            
SetPlayerVirtualWorld(playeridGetPVarInt(playerid,"MedicVW"));
              
SetPlayerInterior(playeridGetPVarInt(playerid,"MedicInt"));

            
SetPVarInt(playerid"EMSAttempt", -1);

            if(
GetPlayerInterior(playerid) > 0)
            {
                  
LoadObjectsForPlayer(playerid);
            }

            
GameTextForPlayer(playerid"~b~BRUTALLY WOUNDED"50003);
            
ClearAnimations(playerid);
            
PreloadAnimLib(playerid,"KNIFE");
             
ApplyAnimation(playerid"WUZI""CS_Dead_Guy"4.011110,1);
             
SetPlayerTeam(playeridPLAYER_STATE_DEAD);
            if(
GetPlayerTeam(playerid) == PLAYER_STATE_DEAD)
            
SetPlayerChatBubble(playerid"(( THIS PLAYER IS DEAD ))"COLOR_LIGHTRED30.02500);
            
SetPlayerHealth(playerid100);
            
SetPlayerArmourEx(playerid,0);
            if(
GetPVarInt(playerid"usingfirstaid") == 1)
                
firstaidexpire(playerid);

            
SetPVarInt(playerid,"MedicCall",1);
        }
        case 
2:
        {
            
SetPVarInt(playerid,"EMSAttempt"2);
            
ClearAnimations(playerid);
             
ApplyAnimation(playerid"SWAT""gnstwall_injurd"4.0011101);
            
SetPlayerHealth(playerid100);
            
SetPlayerArmourEx(playerid,0);
        }
    }
    return 
1;



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>