11.04.2014, 14:26
pawn Код:
stock PlayerDeath(playerid, Float: x, Float: y, Float: z, reason)
{
DeathPosX[playerid] = x;
DeathPosY[playerid] = y;
DeathPosZ[playerid] = z;
SetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 1, 0, 1);
PlayerDead[playerid] = 1;
DeathTimer[playerid] = 3;
CreateDynamic3DTextLabel("DEAD BODY", COLOUR_RED,x,y,z,50.0, playerid, INVALID_VEHICLE_ID, 1, 0, 0, -1, 100.0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetTimerEx("DebugDeath", 800, false, "i", playerid);
new Float: x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerDeath(playerid, x, y, z, reason);
CreateDynamic3DTextLabel("DEAD BODY", COLOUR_RED,x,y,z,50.0, playerid, INVALID_VEHICLE_ID, 1, 0, 0, playerid, 100.0);
//DropGun(playerid, GetWepIndexFromSQL(GetPlayerWeaponEx(playerid)),GetPlayerAmmo(playerid),x,y,z,GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TextDrawHideForPlayer(playerid,speed[playerid]);
TextDrawHideForPlayer(playerid,fuel[playerid]);
KillTimer(FuelSysTimer[playerid]);
KillTimer(SpeedoSysTimer[playerid]);
}
//Hospitalized[playerid] = 1;
//HospitalTime[playerid] = 30;
//dohospital(playerid);
return 1;
}
forward DebugDeath(playerid);
public DebugDeath(playerid)
{
SetPlayerHealth(playerid, 99999);
//GivePlayerWeaponEx(playerid);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 1, 0, 1);
return 1;
}
You can see from the code how it works, DEBUGDEATH just adds a timer to do all the stuff that apparently OnPlayerDeath wont. I did it twice to try and force it, nothing. I've done it with just once on All three areas.
It doesn't do the following:
APPLY ANIMATION - Yes I add AnimLibrary on player connecting.
CREATE THE DEATH LABEL - I've tried changing colours etc, I've tried it under all three - No Warnings.
If anyone could let me know why they think, that would be great.