3DTextLabel doesn't disappear when being deleted.
#1

Hey everybody, at first I would like to say thank you for actually reading this.

Alright, so I have the following code:
pawn Code:
CMD:hduty(playerid, params[])
{
    if(PlayerInfo[playerid][Helper] == false) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are not authorized to perform this command!");
    GetPlayerName(playerid, aname, sizeof(aname));
    kreplace(aname, '_', ' ');
    if(PlayerInfo[playerid][hduty] == 0)
    {
        format(str, sizeof(str), "Helper %s is now on duty, use /ask if you need any server related help.", aname);
        SendClientMessageToAll(COLOR_LIGHTGREEN, str);
        PlayerInfo[playerid][hduty] = 1;
        SetPlayerColor(playerid, COLOR_PLAYER_ADUTY);
        hdutytext[playerid] = Create3DTextLabel("[HELPER DUTY]", 0xD90707FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(hdutytext[playerid], playerid, 0.0, 0.0, 0.3);

    }
    else if(PlayerInfo[playerid][hduty] == 1)
    {
        format(str, sizeof(str), "** Helper %s has gone off helper duty.", aname);
        SendClientMessageToAll(0xDE2626FF, str);
        PlayerInfo[playerid][hduty] = 0;
        if(PlayerInfo[playerid][Tier] == 0) SetPlayerColor(playerid, COLOR_PLAYER_TIER_ZERO);
        if(PlayerInfo[playerid][Faction] == 1 && PlayerInfo[playerid][Tier] != 0) SetPlayerColor(playerid, COLOR_PLAYER_SINDACCO);
        if(PlayerInfo[playerid][Faction] == 0) SetPlayerColor(playerid, COLOR_WHITE);
        Delete3DTextLabel(hdutytext[playerid]);
    }
    return 1;
}
The 3DText ID is being created as a global one.
Well, as you can see I'm deleting this when the player is going off duty, and it worked perfectly on my localhost, but when I get it on my host.. I can't get it to work. ( Never tested it with more than 1 player on my localhost )
And well, I think it works when one player goes on duty and off duty, but when there are two.. it doesn't work.


Any ideas?
Reply


Messages In This Thread
3DTextLabel doesn't disappear when being deleted. - by Denying - 12.04.2013, 13:47
Re: 3DTextLabel doesn't disappear when being deleted. - by Pottus - 12.04.2013, 13:54
Re: 3DTextLabel doesn't disappear when being deleted. - by Denying - 12.04.2013, 13:58
Re: 3DTextLabel doesn't disappear when being deleted. - by Pottus - 12.04.2013, 14:01
Re: 3DTextLabel doesn't disappear when being deleted. - by Denying - 12.04.2013, 14:07

Forum Jump:


Users browsing this thread: 1 Guest(s)