Help out with 3dtextlabel
#1

PHP код:
    if(strcmp(cmd"/yo"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[126];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridGRIS"Uso: /yo [Location]");
                return 
1;
            }
            else
            {
                
format(stringsizeof(string), "|- [%d] %s -|",playeridresult);
            }
            new 
string2[128];
            if(
YoActivado[playerid] == 0)
            {
                
YO[playerid] = Create3DTextLabel(string,CELESTE,30.0,40.0,50.0,20.0,0);
                
Attach3DTextLabelToPlayer(YO[playerid], playerid0.00.00.40);
                
format(string2sizeof(string2), "New State: | %s | Use /yob to clear your current /yo.",result);
                
SendClientMessage(playeridCELESTEstring2);
                
printf("%s to update its state to %s",NombreJugador(playerid),result);
                
YoActivado[playerid] = 1;
                new 
y1,m1,d1;
                new 
h1,mi1,s1;
                
getdate(y1,m1,d1);
                
gettime(h1,mi1,s1);
                
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (state change): %s",d1,m1,y1,h1,mi1,s1,NombreJugador(playerid), result);
                
PublicLog(string);
            }
            else if(
YoActivado[playerid] == 1)
            {
                
SendClientMessage(playeridROJO_OSCURO"Use /yob to clear your current /yo.");
            }
        }
        return 
1;
    } 
PHP код:
    if(strcmp(cmd"/amb"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[126];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridGRIS"Uso: /envi [text]");
                return 
1;
            }
            else
            {
                
format(stringsizeof(string), "{33CCFF}|- {FF0000}Enviroment: {33CCFF}%s -|",result);
            }
            if(
AMBActivado[playerid] == 0)
            {
                new 
Float:RXFloat:RYFloat:RZ;
                
GetPlayerPos(playerid,RX,RY,RZ);
                
Delete3DTextLabel(AMB[playerid]);
                
AMB[playerid] = Create3DTextLabel(string,VERDE,RX,RY,RZ,30.0,0);
                
AMBActivado[playerid] = 1;
                
printf("%s updates his state to %s",NombreJugador(playerid),result);
                new 
y1,m1,d1;
                new 
h1,mi1,s1;
                
getdate(y1,m1,d1);
                
gettime(h1,mi1,s1);
                
format(stringsizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Enviroment): %s",d1,m1,y1,h1,mi1,s1,NombreJugador(playerid), result);
                
PublicLog(string);
            }
            else if(
AMBActivado[playerid] == 1)
            {
                
SendClientMessage(playeridROJO_OSCURO"Use /envia to erase your currently Enviroment.");
            }
        }
        return 
1;
    } 
These two commands randomly disappear after awhile I've tried many of things to fix it, any suggestions?
Reply
#2

What do you mean by "dissapear"? Doesn't works?
Reply
#3

It works but like it disappears after time.

/amb sets down a 3dtextlabel on your position, but people who are far away can't see it if they drive up. It also disappears after a short period of time, sometimes in a matter of seconds.

/yo puts a small nametag above your name that allows you to write things in it, but the same thing happens disappears after time and no one can see it if they were near you moments before.
Reply
#4

What do you mean by disappear ?
// I saw you just posted.
Reply
#5

Try to see OnPlayerUpdate and find if there is a code like
Destroy3dLabel or Delet3dLabel
Reply
#6

https://sampwiki.blast.hk/wiki/Create3DTextLabel
Increase the drawdistance.
Reply
#7

Quote:
Originally Posted by =WoR=Varth
Посмотреть сообщение
Yes he must but he said the 3dlabel dissapear after some time , so i think it's on public OnPlayerUpdate(playerid)
Reply
#8

https://sampwiki.blast.hk/wiki/Create3DTextLabel

https://sampwiki.blast.hk/wiki/Delete3DTextLabel
Reply
#9

Maybe you guys should read the thread before posting.

Naruto there's actually nothing in onplayerupdate, should there be?
Reply
#10

Bump still having problems, anyone have a idea why they disappear?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)