[FilterScript] 3d Labels Creator In Game! (Save & Load .txt)
#1

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 !
Reply
#2

Awesome. very useful
Reply
#3

Thanks,
Reply
#4

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

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!
Reply
#6

Where all info store?
Reply
#7

Good job

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

Thanks guys.
Reply
#9

nice
Reply
#10

Good job but with which include you saving it
Reply
#11

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
Reply
#12

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

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 ?
Reply
#14

Yes i do! but still not working!!
Reply
#15

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

useful script 10/10
Reply
#17

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)