SA-MP Forums Archive
Labels - 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: Labels (/showthread.php?tid=615520)



Labels - RuNBoY - 23.08.2016

Hello i have a system that ingame creates 3d labels but when server restarts its not loading them all the labels are in the .txt file how can i load that txt file when server is loading..


Re: Labels - Shinja - 23.08.2016

Show the file and how you save them, and what files include you use?


Re: Labels - RuNBoY - 23.08.2016

This is the text that is in the Texts.txt : Create3DTextLabel("test!",0x3A47DEFF,2637.90, 1129.06, 11.17,30.0,1);

AND this is how i save them

new File:file,str[256];
file=fopen("Texts.txt",io_append);
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
Create3DTextLabel(inputtext,COLOR_RED,x,y,z,30.0,0 ,1);
format(str, 256, "\r\nCreate3DTextLabel(\"%s\",0xFF0000AA,%.2f, %.2f, %.2f,30.0,1);" ,inputtext, x, y, z);
fwrite(file,str);
fwrite(file,"\r\n");
fclose(file);


Re: Labels - Shinja - 23.08.2016

Quote:
Originally Posted by RuNBoY
Посмотреть сообщение
This is the text that is in the Texts.txt : Create3DTextLabel("test!",0x3A47DEFF,2637.90, 1129.06, 11.17,30.0,1);

AND this is how i save them

new File:file,str[256];
file=fopen("Texts.txt",io_append);
new Float,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
Create3DTextLabel(inputtext,COLOR_RED,x,y,z,30.0,0 ,1);
format(str, 256, "\r\nCreate3DTextLabel(\"%s\",0xFF0000AA,%.2f, %.2f, %.2f,30.0,1);" ,inputtext, x, y, z);
fwrite(file,str);
fwrite(file,"\r\n");
fclose(file);
First, i advise you to use a files include, like dini2 is best imo.
And, that's not how to save labels, it's should be using enums like
PHP код:
enum L_DATA
{
        
ID,
    
Text[256],
    
Color,
    
Float:POSX,
    
Float:POSY,
     
Float:POSZ,
     
Float:Distance,
     
World
}
new 
Text3D:Label[MAX_LABELS][L_DATA];