Death Label Help
#1

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(playeridPlayerData[playerid][pPos][0], PlayerData[playerid][pPos][1], PlayerData[playerid][pPos][2]);
            
GetPlayerFacingAngle(playeridPlayerData[playerid][pPos][3]);
            new 
string[128],name[MAX_PLAYER_NAME];
            
GetPlayerName(playerid,name,sizeof name);
            
format(stringsizeof(string), "(( This player is bruitally wounded..\n/damages %s to check damages ))"name);
            
deathlabel[playerid] = Create3DTextLabel(stringCOLOR_RED0.00.00.015.00);
            
Attach3DTextLabelToPlayer(deathlabel[playerid], playerid0.00.00.7);
            
ApplyAnimation(playerid"KNIFE""KILL_Knife_Ped_Die"4.1000101);
        }
        else
        {
            
TextDrawHideForPlayer(playeridgServerTextdraws[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
Reply
#2

Try printing the value of deathlabel[playerid] under a debug command, or in the /revive and /giveup command. Then you can see if the value is actually valid. Perhaps somewhere the value is set to 0 without deleting the label, thus preventing it from proper deleting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)