SA-MP Forums Archive
3DTextLabel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 3DTextLabel (/showthread.php?tid=553311)



3DTextLabel - AYOUYOU - 29.12.2014

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


Re: 3DTextLabel - M4D - 29.12.2014

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 ?


Re: 3DTextLabel - Cookland - 29.12.2014

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


Re : Re: 3DTextLabel - AYOUYOU - 29.12.2014

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