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
(There's more but i just put the animation)
And here's the code to OnPlayerStateChange
And here is the code when the player gets wounded, this is where the animation plays probably.
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(playerid, killerid, reason)
{
ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 1, 1, 1, 1, 0,1);
ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 1, 1, 1, 1, 0,1);
}
PHP Code:
if(GetPVarInt(playerid, "Injured") == 1)
{
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
ClearAnimations(playerid);
ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 1, 1, 1, 1, 0,1);
SetPlayerTeam(playerid, PLAYER_STATE_DEAD);
}
PHP Code:
if(GetPVarInt(playerid, "Injured") == 1)
{
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
ClearAnimations(playerid);
ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 1, 1, 1, 1, 0,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(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
SetPVarInt(playerid, "EMSAttempt", -1);
if(GetPlayerInterior(playerid) > 0)
{
LoadObjectsForPlayer(playerid);
}
GameTextForPlayer(playerid, "~b~BRUTALLY WOUNDED", 5000, 3);
ClearAnimations(playerid);
PreloadAnimLib(playerid,"KNIFE");
ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 1, 1, 1, 1, 0,1);
SetPlayerTeam(playerid, PLAYER_STATE_DEAD);
if(GetPlayerTeam(playerid) == PLAYER_STATE_DEAD)
SetPlayerChatBubble(playerid, "(( THIS PLAYER IS DEAD ))", COLOR_LIGHTRED, 30.0, 2500);
SetPlayerHealth(playerid, 100);
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.0, 0, 1, 1, 1, 0, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmourEx(playerid,0);
}
}
return 1;
}