read file problem
#1

Hi all, i created a clan system for my server.

This is my script:

pawn Код:
// This is a comment
#include <a_samp>
#include <zcmd>
#include <sscanf2>

new stringa[500], nome[MAX_PLAYER_NAME];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Tagga");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    new File:sfile;
    sfile = fopen("TagUff.txt", io_read);
    GetPlayerName(playerid, nome, sizeof(nome));
    format(stringa, sizeof(stringa), "[IPS]%s", nome);
    new banstr[512];
    while(fread(sfile,banstr))
    {
        if (strfind(banstr, stringa, true) != -1)
        {
            SendClientMessage(playerid, -1, "Benvenuto!");
        }
        else
        {
            SendClientMessage(playerid, -1, "Tag non ufficializzata");
          Kick(playerid);
        }
    }
    fclose(sfile);
    return 1;
}

CMD:tagga(playerid, params[])
{
    new ricevente;
    if(sscanf(params, "u", ricevente))
    {
        SendClientMessage(playerid, -1, "Usa: /tagga [id]");
        return 1;
    }
    new File:Open;
    Open=fopen("TagUff.txt", io_append);
    GetPlayerName(ricevente, nome, sizeof(nome));
    format(stringa, sizeof(stringa), "[IPS]%s", nome);
    fwrite(Open, stringa);
    fclose(Open);
    return 1;
}
But when i enter server without tag, it kick me, and if i write my nickname if TagUff.txt file, it kick me.

Sorry for my bad english з_з
Reply
#2

Bump!
Reply
#3

Bump!
Reply
#4

HELP.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)