24.09.2016, 02:06
Alright, so, I've been having a bit of problem with this. When you spawn, you don't have the label, good. When you die, you get TP'd back to where you died and put in an animation with the death label above you, good, it's supposed to. Now, when you get /revive'd it's supposed to delete it. When you do /giveup, it's supposed to get rid of it. When you get finished off and sent to a hospital, it's supposed to get rid of it. It doesn't ever get rid of it.
PHP код:
new Text3D:deathlabel[MAX_PLAYERS]; // Top of Script
// Under OnPlayerStateChange
if (!PlayerData[playerid][pInjured])
{
PlayerData[playerid][pInjured] = 1;
PlayerData[playerid][pInterior] = GetPlayerInterior(playerid);
PlayerData[playerid][pWorld] = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, PlayerData[playerid][pPos][0], PlayerData[playerid][pPos][1], PlayerData[playerid][pPos][2]);
GetPlayerFacingAngle(playerid, PlayerData[playerid][pPos][3]);
new string[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof name);
format(string, sizeof(string), "(( This player is bruitally wounded..\n/damages %s to check damages ))", name);
deathlabel[playerid] = Create3DTextLabel(string, COLOR_RED, 0.0, 0.0, 0.0, 15.0, 0);
Attach3DTextLabelToPlayer(deathlabel[playerid], playerid, 0.0, 0.0, 0.7);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 0, 0, 1, 0, 1);
}
else
{
TextDrawHideForPlayer(playerid, gServerTextdraws[2]);
PlayerData[playerid][pInjured] = 0;
PlayerData[playerid][pHospital] = GetClosestHospital(playerid);
Delete3DTextLabel(deathlabel[playerid]);
deathlabel[playerid] = 0;
}
// Under OnPlayerConnect
deathlabel[playerid] = 0;
// Under /revive, /giveup, and when you get finished off.
Delete3DTextLabel(deathlabel[playerid]);
deathlabel[playerid] = 0;