[FilterScript] Read Fakes of IP Andress
#1


Por Bruno da Silva


Introduction:
This save in file the nicks used by players in one your IP (internet protocol)

Command:
• /fake [playerid] > reading Fakes of Players

CODE:

pawn Код:
#include <a_samp>
#define CMD:(%1) if(!strcmp(cmd,%1, true))
#define UsingProcessing new cmd[128],idx;cmd = Process(cmdtext, idx);
#define UsingParams new tmp[128],idxp;tmp = Process(cmdtext, idxp);
Process(const s[], &i)
{
    new l = strlen(s);while ((i < l) && (s[i] <= ' ')) {
        i++;
    }
    new o = i;new r[20];while ((i < l) && (s[i] > ' ') && ((i - o) < (sizeof(r) - 1))) {
        r[i - o] = s[i];i++;
    }r[i - o] = EOS; return r;
}


public OnPlayerConnect(playerid)
{
    InserirFake(playerid);
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    UsingProcessing
    CMD:("/fake") {
        UsingParams
            if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,0x08005,"O Player Esta OFF-LINE");
        if(!strlen(tmp)) return SendClientMessage(playerid,0x08005,"Digite /fakes [id]");
        if(strval(tmp) == playerid) return SendClientMessage(playerid,0x08005,"Your Self NO");
        ReadingFakes(strval(tmp),playerid);
        return 1;
    }
    return 0;
}


stock ReadingFakes(playerid,other)
{
    new plrIP[16];
    GetPlayerIp(playerid, plrIP, sizeof(plrIP));
    new string[255];
    new ip[25];
    format(ip, sizeof(ip), "Fakes/%s.ini",plrIP);
    new File:arquivo=fopen(ip,io_read);
    SendClientMessage(other,0xFFFFFFFF,"> List of Fakes of Player <");
    while(fread(arquivo,string)) {
        SendClientMessage(other,0xFFFFFFFF,string);
    }
    fclose(arquivo);

}


stock InserirFake(playerid)
{
    new plrIP[16];
    GetPlayerIp(playerid, plrIP, sizeof(plrIP));
    new ip[25];
    format(ip, sizeof(ip), "Fakes/%s.ini",plrIP);
    if(!fexist(ip)) {
        new File:Temp;
        Temp = fopen(ip,io_write);
        fclose(Temp);
    }
    if(fexist(ip)) {
        new
            File:file,
            bool:Existe = false,
            string[128],
            NCK[MAX_PLAYER_NAME],
            str[32];
        GetPlayerName(playerid, NCK, sizeof(NCK));
        format(str, sizeof(str), "%s,", NCK);
        file = fopen(ip, io_read);
        while(fread(file, string)) {
            if(strfind(string, str, true) == 0) {
                Existe = true;
            }
        }
        fclose(file);
        if(Existe == false) {
            file = fopen(ip, io_append);
            format(string, sizeof(string), "%s,", NCK);
            fwrite(file, string);
            fclose(file);
            Existe = false;
        }
    }
}

Obs: Create the folder Fakes in Scriptfiles


CREDITS FOR TORIBIO AND DRAKON
Reply
#2

Nice Work!
Reply
#3

Nice, lol @ posting code in thread put in pastebin next time gj anyways
Reply
#4

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
Nice, lol @ posting code in thread put in pastebin next time gj anyways
pastebin Expire of Code ¬¬
I use [*pawn] of Forum,LoL
Reply
#5

Quote:
Originally Posted by Micheliano
Посмотреть сообщение
pastebin dont rlly expire if u set it to never expire..
Yes Expire Yes...
Reply
#6

Good man !!
Reply
#7

Here link Is Pastebin

http://pastebin.com/Qre8dhrV

I Accept new Mirros
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)