Death System bug.
#1

well when a player dies it never does the animation it only makes them stand-up i have got the anim to work once before but it was only for the player, aswell when a player gets killed they tp to the airport then to the death spot, i want them to fall right away as they die.

here is my system,

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SetNormalColor(playerid);
	ResetVariables(playerid);
	FullResetPlayerWeapons(playerid);
	FullResetPlayerClothes(playerid);
	CheckPlayerCurrentCall(playerid);
	RemovePlayerMask(playerid);
	OnAnim{playerid} = true;
	ApplyAnimation(playerid,"WUZI","CS_Dead_Guy",4.1,0,1,1,1,1);
	ApplyAnimation(playerid,"WUZI","CS_Dead_Guy",4.1,0,1,1,1,1);
	if(!isAdminDuty(playerid))
	{
		MakePlayerWounded(playerid);
	}
	SetHunger(playerid, 100.0);
  	return 1;
}
Код:
stock MakePlayerWounded(playerid)
{
	if(PlayerInfo[playerid][pJailed] == 0)
	{
	    SetIntVar(playerid, "JustDied", 1);
	    SavePlayerPos(playerid);
	}
	return 1;
}
Код:
public CheckWounded(playerid)
{
	if(GetIntVar(playerid, "JustDied") == 1)
	{
		ApplyAnimation(playerid,"WUZI","CS_Dead_Guy",4.1,0,1,1,1,1);
		ApplyAnimation(playerid,"WUZI","CS_Dead_Guy",4.1,0,1,1,1,1);
		PutPlayer(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
		SetInterior(playerid, PlayerInfo[playerid][pInt]);
		SetWorld(playerid, PlayerInfo[playerid][pWorld]);
		SetPlayerCameraPos(playerid,PlayerInfo[playerid][pPosX]+3,PlayerInfo[playerid][pPosY]+3,PlayerInfo[playerid][pPosZ]+3);
		SetPlayerCameraLookAt(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
		SetPlayerHealth(playerid, 25.0);
		GiveCash(playerid, -500);
		GameTextForPlayer(playerid, "~b~Brutally Wounded", 5000, 3);
    	SCM(playerid, COLOR_PINK, "EMT: Your Medical Bills are $500");
    	SCM(playerid, COLOR_LIGHTRED, "You are Brutally Wounded. If a medic or anyone else doesn't save you, you will die.");
    	SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
		FreezePlayer(playerid);
	}
}
Reply
#2

Bump
Reply
#3

You have to preload the animation.

PHP код:
// Somewhere in your script
static const AnimLibs[][] =
{
    
"WUZI"
};
PreloadAnimLibFor(id)
{
    for(new 
0len sizeof(AnimLibs); leni++)
    {
        
ApplyAnimation(idAnimLibs[i], "null"0.0000000);
    }
}
// OnPlayerConnect
PreloadAnimLibFor(playerid); 
Might be a better way of preloading but I use this way.

Just put the lib in new lines.. "WUZI", "ect"
and remove the double ApplyAnimations in your script
Reply
#4

Alright thank you and how about the player tping away and then to the death spot? Any Idea?
Reply
#5

bump
Reply
#6

Freeze the player?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)