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]);
printf("Set the position");
GivePlayerWeaponEx(playerid);
printf("Gave Weapons");
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 0, 0, 1);
printf("Animation");
TogglePlayerControllable(playerid, 0);
printf("Controllable");
PlayerDead[playerid] = 1;
DeathTimer[playerid] = 3;
SetPlayerHealth(playerid, 99999);
DeathLabel[playerid] = CreateDynamic3DTextLabel("D E A D B O D Y", COLOUR_REALRED, DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+0.5, 50.0, playerid, INVALID_VEHICLE_ID, 0, 0, -1, -1, 50.0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float: x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerDeath(playerid, x, y, z, reason);
//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;
}
By the way, doesn't it apply the animation, freeze the player or create the 3D label at all? |