SA-MP Forums Archive
Help out with 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: Help out with 3dtextlabel (/showthread.php?tid=284406)



Help out with 3dtextlabel - Oh - 19.09.2011

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?


Re: Help out with 3dtextlabel - =WoR=Varth - 19.09.2011

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


Re: Help out with 3dtextlabel - Oh - 19.09.2011

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.


Re: Help out with 3dtextlabel - Fat - 19.09.2011

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


Re : Help out with 3dtextlabel - Naruto_Emilio - 19.09.2011

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


Re: Help out with 3dtextlabel - =WoR=Varth - 19.09.2011

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


Re : Re: Help out with 3dtextlabel - Naruto_Emilio - 19.09.2011

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)


Re: Help out with 3dtextlabel - =WoR=G4M3Ov3r - 19.09.2011

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

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


Re: Help out with 3dtextlabel - Oh - 19.09.2011

Maybe you guys should read the thread before posting.

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


Re: Help out with 3dtextlabel - Oh - 20.09.2011

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