[FilterScript] Zone saver
#1

This is a somewhat useful zone saver. I made it because i'm lazy, and i hate copying and pasting up to 4 times for one line. So i've made this. Now all i have to do, is copy and paste the line, add a " , " and it can be added to my enum. It'll save the location plus X Y Z to file. If you have any use for it, Good if you dont, then ok :P.

Here's how it'll save in scriptfiles:
Code:
[23/06/2013 | 01:42:01] The High Roller 1958.378295 1343.157226 15.374607
What you need:

A folder in "scriptfiles" called "SavedLocs" its case sensetive. So you can change the name or just copy and paste the folder name needed (minus quotations)

Includes needed:

zones: https://sampforum.blast.hk/showthread.php?tid=166545 (i named it as "zones")
a_samp; in the server package you have
zcmd: A majority of people have this these days. otherwise: https://sampforum.blast.hk/showthread.php?tid=91354

All credits are included in the file, otherwise:

pawn Code:
Credits to Luxorian //SaveIn stock used
a_samp //credits to SA-MP Team
zcmd //credits to Zeex
zones //credits to Cueball

Here's the script:
pawn Code:
#include    a_samp //credits to SA-MP Team
#include    zcmd //credits to Zeex
#include    zones //credits to Cueball

//Scripter: DobbysGamertag.

main(){}

public OnFilterScriptInit()
{
    print("Zone Saver Loaded");
    return 1;
}
public OnFilterScriptExit()
{
    print("Zone Saver Unloaded");
    return 1;
}
COMMAND:sp(playerid,params[])
{
    if(!IsPlayerAdmin(playerid))return 0;
    {
        new Float:X,Float:Y,Float:Z;
        new Zzone[124];
        new string[124];
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayer2DZone(playerid,Zzone,sizeof(Zzone));
        format(string,sizeof(string),"%s %f %f %f",Zzone,X,Y,Z);
        SaveIn("Missions",string);
        SendClientMessage(playerid,-1,"Zone saved");
    }
    return 1;
}

//stocks needed
/*
Taken from LuxAdmin

Credits to Luxorian

*/

forward SaveIn(filename[],text[]);
public SaveIn(filename[],text[])
{
    new File:Lfile;
    new filepath[256];
    new string[256];
    new year,month,day;
    new hour,minute,second;

    getdate(year,month,day);
    gettime(hour,minute,second);
    format(filepath,sizeof(filepath),"SavedLocs/%s.txt",filename);
    Lfile = fopen(filepath,io_append);
    format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text);
    fwrite(Lfile,string);
    fclose(Lfile);
    return 1;
}
It compiles, and it works perfectly fine hopefully somebody will have use for it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)