SA-MP Forums Archive
Saving a 3D Text Label - 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: Saving a 3D Text Label (/showthread.php?tid=385077)



Saving a 3D Text Label - RLGaming - 14.10.2012

Hello, I currently have this:
pawn Код:
new Filename[64], line[256];
    format(Filename, sizeof(Filename), "Labels.ini");
    new File:handle = fopen(Filename, io_write);
    format(line, 256, "X=%f\n", fTextPos[0]);fwrite(handle, line);
    format(line, 256, "Y=%f\n", fTextPos[1]);fwrite(handle, line);
    format(line, 256, "Z=%f\n", fTextPos[2]);fwrite(handle, line);
    format(line, 256, "Text=%s", text);fwrite(handle, line);
    fclose(handle);
    }
When I create a label it saves etc, but whenever I create another it over-writes it, so how can I add in like multiple saving? Like a new label on a new line?

Also, how would I would this?

Thanks+rep


Re: Saving a 3D Text Label - mineralo - 14.10.2012

just creat and afte destroy if you want make other one or update text
https://sampwiki.blast.hk/wiki/Delete3DTextLabel
https://sampwiki.blast.hk/wiki/Update3DTextLabelText


Re: Saving a 3D Text Label - RLGaming - 14.10.2012

But when I create another one, i want to keep the existing one, if that makes sense

I.E.
/createtlabel ergweghgw
- text is now created for eg-

then I do the cmd again
but the text I created at the start still exists and is saved as well as the second one i made


Re: Saving a 3D Text Label - mineralo - 14.10.2012

not much understood what you said, what you want?
you want to make multiple 3d texts? and every still in game?
or you want to replace old one with other one?
or what?


Re: Saving a 3D Text Label - RLGaming - 14.10.2012

'you want to make multiple 3d texts? and every still in game?'
Yes, that


Re: Saving a 3D Text Label - mineralo - 14.10.2012

PHP код:
public OnGameModeInit()

    new 
Text3D:label[100];
    new 
cont;
    return 
1;
}
public 
OnPlayerCommand(cmdtext[])
{
new 
cmd,tmp[256],idx;
cmdstrtok(cmdtext,idx);
if(!
strcmp(cmd,"/createtext",true))
{
tmp strtok(cmdtext,idx);
if(!
strlen(tmp)) return SendClientMessage(playerid,-1,"/createtext <text>");
new 
Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
label[cont] = Create3DTextLabel(tmp,0x008080FF,x,y,z,40.0,0);
cont++;
return 
1;
}
return 
0;




Re: Saving a 3D Text Label - RLGaming - 14.10.2012

That doesnt save the text though


Re: Saving a 3D Text Label - mineralo - 14.10.2012

PHP код:
public OnGameModeInit()

    new 
Text3D:label[100];
    new 
cont;
    return 
1;
}
public 
OnPlayerCommand(cmdtext[])
{
new 
cmd,tmp[256],idx;
cmdstrtok(cmdtext,idx);
if(!
strcmp(cmd,"/createtext",true))
{
tmp strtok(cmdtext,idx);
if(!
strlen(tmp)) return SendClientMessage(playerid,-1,"/createtext <text>");
new 
Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
label[cont] = Create3DTextLabel(tmp,0x008080FF,x,y,z,40.0,0);
new 
Filename[64], line[256];
format(Filenamesizeof(Filename), "Labels.ini");
new 
File:handle fopen(Filenameio_write);
format(line256"X=%f\n",x);fwrite(handleline);
format(line256"Y=%f\n"y);fwrite(handleline);
format(line256"Z=%f\n"z);fwrite(handleline);
format(line256"Text=%s"tmp);fwrite(handleline);
fclose(handle);
cont++;
return 
1;
}
return 
0;




Re: Saving a 3D Text Label - RLGaming - 14.10.2012

Thats the same system i already have


Re: Saving a 3D Text Label - mineralo - 14.10.2012

you want when server started up to load all them labels?