SA-MP Forums Archive
[FilterScript] 3d Labels Creator In Game! (Save & Load .txt) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] 3d Labels Creator In Game! (Save & Load .txt) (/showthread.php?tid=316450)



3d Labels Creator In Game! (Save & Load .txt) - [Nikk] - 06.02.2012

Labels Creator In-Game!


Hey, i have making this script for a long time, sometime was stopped, and sometimes no. Today i finish this, with a little of help, but i can finish this, i hope you like it !

What is it ?

WIth this script you can create 3d labels in game. The labels save and load automatically in a .txt

Requirements:
ZCMD by Zeex.
Sscanf by ******.
Streamer by Incognito.



Commands:


/add3d [Info]


pawn Код:
#include <a_samp>
#include <sscanf2>
#include <streamer>
#include <zcmd>
#define Nombre_De_TXT_Label         "Labels.txt"
new Msg[128], Labels;
public OnFilterScriptInit()
{
    Labels = AgregarLabels(Nombre_De_TXT_Label);
    new Linea[128];
    format(Linea, sizeof(Linea), "** %i Labels loaded **",Labels);
    printf(Linea);
    return 1;
}

public OnFilterScriptExit()
{
    DestroyAllDynamic3DTextLabels();
    return 1;
}


CMD:add3d(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new Float:X, Float:Y, Float:Z;
    if(unformat(params, "s[128]",params)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}Use : /Add3d [Info]");
    GetPlayerPos(playerid, X, Y, Z);
    AgregarLabelsAtxt(Nombre_De_TXT_Label, params, X, Y, Z);
    CreateDynamic3DTextLabel(params, 0xFFFFFFFF, X, Y, Z, 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
    format(Msg, sizeof(Msg), " You have created a 3d label here!\"%s\".",params);
    return SendClientMessage(playerid, 0xFFFF00FF, Msg);
}

stock AgregarLabels(ArchivoLabels[])
{
    if(!fexist(ArchivoLabels)) return 0;

    new File:ArchivoLab = fopen(ArchivoLabels, io_read),
    Linea[128],
    InformacionL[128],
    Float:LX,
    Float:LY,
    Float:LZ,
    CantidadLabels = 0;
    while(fread(ArchivoLab, Linea))
    {
        if(!unformat(Linea, "p<,>s[128]fff", InformacionL,LX,LY,LZ))
        {
            CreateDynamic3DTextLabel(InformacionL, 0xFFFFFFFF, LX, LY, LZ, 100.0);
            CantidadLabels++;
        }
    }

    fclose(ArchivoLab);
    return CantidadLabels;
}

stock AgregarLabelsAtxt(ArchivoLabels[], InformacionL[], Float:LX, Float:LY, Float:LZ)
{
    new File:ArchivoLab, Linea[128];
    format(Linea, sizeof(Linea), "%s,%.2f,%.2f,%.2f\r\n",InformacionL, LX, LY, LZ);
    ArchivoLab = fopen(ArchivoLabels, io_append);
    fwrite(ArchivoLab, Linea);
    fclose(ArchivoLab);
    return 1;
}
Dont release this without my credits/permission
Report bugs here !


Respuesta: 3d Labels Creator In Game! (Save & Load .txt) - davidxxx - 06.02.2012

Awesome. very useful


Respuesta: 3d Labels Creator In Game! (Save & Load .txt) - [Nikk] - 07.02.2012

Thanks,


Re: 3d Labels Creator In Game! (Save & Load .txt) - Tanush123 - 07.02.2012

Nice job, could be useful to people who cannot make dynamic stuff


Re: 3d Labels Creator In Game! (Save & Load .txt) - ShOoBy - 07.02.2012

Awww I made one by myself , along time ago Check out my signiture. But anyway this one is nice! I like that it's using ZCMD and Sscanf , because mine was made when I was just starting to learn pawn . Good job!


Re: 3d Labels Creator In Game! (Save & Load .txt) - SampLoverNo123 - 07.02.2012

Where all info store?


Re: 3d Labels Creator In Game! (Save & Load .txt) - HolZer - 07.02.2012

Good job

Quote:
Originally Posted by SampLoverNo123
Посмотреть сообщение
Where all info store?
#define Nombre_De_TXT_Label "Labels.txt"
scriptfiles/Labels.txt :O


Respuesta: 3d Labels Creator In Game! (Save & Load .txt) - [Nikk] - 07.02.2012

Thanks guys.


Re: 3d Labels Creator In Game! (Save & Load .txt) - tyler12 - 07.02.2012

nice


Re: 3d Labels Creator In Game! (Save & Load .txt) - SpiderWalk - 07.02.2012

Good job but with which include you saving it


Respuesta: Re: 3d Labels Creator In Game! (Save & Load .txt) - [Nikk] - 07.02.2012

Quote:
Originally Posted by SpiderWalk
Посмотреть сообщение
Good job but with which include you saving it
I dont save it with any include, only in the .txt


Re: 3d Labels Creator In Game! (Save & Load .txt) - Dubbystep - 08.02.2012

Please help me, it says "unknown command" or something i am logged into RCON ADMIN! please help me!!


Respuesta: Re: 3d Labels Creator In Game! (Save & Load .txt) - [Nikk] - 08.02.2012

Quote:
Originally Posted by Dubbystep
Посмотреть сообщение
Please help me, it says "unknown command" or something i am logged into RCON ADMIN! please help me!!
You have sscanf in your plugins folder ?


Re: 3d Labels Creator In Game! (Save & Load .txt) - Dubbystep - 08.02.2012

Yes i do! but still not working!!


Re: 3d Labels Creator In Game! (Save & Load .txt) - sleepysnowflake - 08.02.2012

Well Nikk, I would suggest you also make a /delete3dtxt [ID]. That would really be cool. ~Cheers.


Re: 3d Labels Creator In Game! (Save & Load .txt) - Smacky - 08.02.2012

useful script 10/10


Respuesta: Re: 3d Labels Creator In Game! (Save & Load .txt) - [Nikk] - 08.02.2012

Quote:
Originally Posted by Dubbystep
Посмотреть сообщение
Yes i do! but still not working!!
Im, really, really sorry, i forgot to change the command from spanish to english, now yes, check the code in the top of the topic, the command has rebuilded.