3DTextLabel
#1

Hi Guys
I Have Problem in My 3Dtext Label WHen i /offduty the 3DTextLabel Don't Remove
pawn Код:
new Text3D:MyLabel;
pawn Код:
YCMD:duty(playerid, params[], help)
{
        #pragma unused help
        #pragma unused params
        if(P_Data[playerid][pAdmin] == 2) return SCM(playerid, COLOR_RED, "Info: You Must be lvl 2");
        new
            string[128];
        if(P_Data[playerid][pDuty] == 3) {
        SetPlayerHealth(playerid,100);
        SetPlayerColor(playerid, -1);
        format(string,sizeof(string)," {FF0000} %s is not longer onduty!",GetName(playerid));
        new Float:x,Float:y,Float:z;
        MyLabel = Create3DTextLabel("Admin On Duty!", 0x22B998AA,x,y,z, 40.0, 0, 0);
        Delete3DTextLabel(MyLabel);
        RemovePlayerAttachedObject(playerid, object);
        SCMToAll(-1,string); P_Data[playerid][pDuty] = 2;} // this line is your problem just change the "P_Data[playerid][pDuty]=2" << to your off duty number
        else {
        new Float:x,Float:y,Float:z;
        MyLabel = Create3DTextLabel("Admin On Duty!", 0x22B998AA,x,y,z, 40.0, 0, 0);
        GetPlayerPos(playerid,x,y,z);
        SendClientMessage(playerid, -1,"You are now on duty!");
        Attach3DTextLabelToPlayer(MyLabel,playerid,0.0, 0.0, 0.1);
        SetPlayerAttachedObject(playerid, 0, 18646, 2, 0.207000, 0.004000, 0.007000, 64.800010, 86.200035, 0.000000, 1.000000, 1.000000, 1.000000);
        format(string,sizeof(string)," {FF0000} %s is now on Duty!",GetName(playerid));
        SetPlayerHealth(playerid,99999);
        SetPlayerColor(playerid,0x000000FF);
        SCMToAll(-1,string); P_Data[playerid][pDuty] = 3;}
        return 1;
}
Hope Help me
Reply
#2

use player variables… this variable is global
Try to make it like this: new MyLabel[MAX_PLAYERS];
And in command MyLabel[playerid] =….
And why you create 3DTextLabel AGAIN before destroy it in off duty ?
Reply
#3

So your 3d textdraw doesn't remove when you go off duty? Or something else?
Reply
#4

Quote:
Originally Posted by Cookland
Посмотреть сообщение
So your 3d textdraw doesn't remove when you go off duty? Or something else?
Yeah!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)