Ban BIG Problem - help
#1

why my ban command won't to show client messages which need to show player, and won't kick player... this BAN command ban players on reconnect

ban command:

Код:
CMD:ban(playerid, params[])
{
 	if(PlayerInfo[playerid][pAdmin] < 1)return 1;
    new stringe[128], ID, razlog[128];
    new Godina, Mjesec, Dan;
    getdate(Godina, Mjesec, Dan);
    new pIP[16];
    GetPlayerIp(playerid, pIP, sizeof(pIP));
  	if(sscanf(params, "us[128]", ID, razlog))return SendClientMessage(playerid, COLOR_WHITE, "/ban [player id] [razlog]" );
  	else if(ID == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_BLACK"| "COL_RED"Odbijeno "#COL_BLACK"| "#COL_WHITE"Pogresan ID");
    else
    {
        new fak[30];
        format(fak,sizeof(fak),BAN_FILE,PlayerName(ID));
        new INI:iniFile = INI_Open(fak);
        if( !fexist(fak) )
        {
            INI_SetTag(iniFile, "BANNED");
            INI_WriteString(iniFile, "Razlog", razlog);
            INI_WriteString(iniFile, "Admin", PlayerName(playerid));
            INI_Close(iniFile);

            SendClientMessage(playerid, COLOR_TOMATO, "____________________________________________________________");
            SendClientMessage(playerid, COLOR_RED, "____________________________________________________________");
            SendClientMessage(playerid, COLOR_ORANGERED, "ISKLJUCENI STE SA SERVERA(Banani)! Pozorno procitaj tekst!");
            format(stringe, sizeof(stringe), "%s(ID:%d) iskljucen(Banan) si sa servera od %s", PlayerName(ID), ID, PlayerName(playerid));
            SendClientMessage(playerid, COLOR_WHITE, stringe);
            format(stringe, sizeof(stringe), "Razlog iskljucenja: %s",razlog);
            SendClientMessage(playerid, COLOR_WHITE, stringe);
            format(stringe, sizeof(stringe), "Datum: %d-%d-%d | Vasa IP adresa je: %s", Dan, Mjesec, Godina, pIP);
            SendClientMessage(playerid, COLOR_WHITE, stringe);
            SendClientMessage(playerid, COLOR_WHITE, "Sa ovim banomn, vas korisnicki racun je suspendiran na neodredjeno!");
            SendClientMessage(playerid, COLOR_YELLOW, "Ukoliko mislis da je doslo do greske slikaj ovo(F8) i zatrazi unban na forumu!");
            format(stringe, sizeof(stringe), "BAN | %s, Admin: %s",PlayerName(ID),PlayerName(playerid));
            SendClientMessageToAll(COLOR_ORANGERED,stringe);
            new File:lFile = fopen("Logovi/Banani.txt", io_append),
            logData[512],
            fyear, fmonth, fday,
            fhour, fminute, fsecond;
            getdate(fyear, fmonth, fday);
            gettime(fhour, fminute, fsecond);
            format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s je banao igraca %s, Razlog: %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, PlayerName(playerid), PlayerName(ID), razlog);
            fwrite(lFile, logData);
            fclose(lFile);
            Kick(ID);
            return 1;
        }

    }
    return 1;
}
Reply
#2

Код:
CMD:ban(playerid, params[])
{
         new id;
 	if(PlayerInfo[playerid][pAdmin] < 1)return 1;
    new stringe[128], ID, razlog[128];
    new Godina, Mjesec, Dan;
    getdate(Godina, Mjesec, Dan);
    new pIP[16];
    GetPlayerIp(playerid, pIP, sizeof(pIP));
  	if(sscanf(params, "us[128]", ID, razlog))return SendClientMessage(playerid, COLOR_WHITE, "/ban [player id] [razlog]" );
  	else if(ID == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_BLACK"| "COL_RED"Odbijeno "#COL_BLACK"| "#COL_WHITE"Pogresan ID");
    else
    {
        new fak[30];
        format(fak,sizeof(fak),BAN_FILE,PlayerName(ID));
        new INI:iniFile = INI_Open(fak);
        if( !fexist(fak) )
        {
            INI_SetTag(iniFile, "BANNED");
            INI_WriteString(iniFile, "Razlog", razlog);
            INI_WriteString(iniFile, "Admin", PlayerName(playerid));
            INI_Close(iniFile);

            SendClientMessage(playerid, COLOR_TOMATO, "____________________________________________________________");
            SendClientMessage(playerid, COLOR_RED, "____________________________________________________________");
            SendClientMessage(playerid, COLOR_ORANGERED, "ISKLJUCENI STE SA SERVERA(Banani)! Pozorno procitaj tekst!");
            format(stringe, sizeof(stringe), "%s(ID:%d) iskljucen(Banan) si sa servera od %s", PlayerName(ID), ID, PlayerName(playerid));
            SendClientMessage(playerid, COLOR_WHITE, stringe);
            format(stringe, sizeof(stringe), "Razlog iskljucenja: %s",razlog);
            SendClientMessage(playerid, COLOR_WHITE, stringe);
            format(stringe, sizeof(stringe), "Datum: %d-%d-%d | Vasa IP adresa je: %s", Dan, Mjesec, Godina, pIP);
            SendClientMessage(playerid, COLOR_WHITE, stringe);
            SendClientMessage(playerid, COLOR_WHITE, "Sa ovim banomn, vas korisnicki racun je suspendiran na neodredjeno!");
            SendClientMessage(playerid, COLOR_YELLOW, "Ukoliko mislis da je doslo do greske slikaj ovo(F8) i zatrazi unban na forumu!");
            format(stringe, sizeof(stringe), "BAN | %s, Admin: %s",PlayerName(ID),PlayerName(playerid));
            SendClientMessageToAll(COLOR_ORANGERED,stringe);
            new File:lFile = fopen("Logovi/Banani.txt", io_append),
            logData[512],
            fyear, fmonth, fday,
            fhour, fminute, fsecond;
            getdate(fyear, fmonth, fday);
            gettime(fhour, fminute, fsecond);
            format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s je banao igraca %s, Razlog: %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, PlayerName(playerid), PlayerName(ID), razlog);
            fwrite(lFile, logData);
            fclose(lFile);
            Kick(id);
            return 1;
        }

    }
    return 1;
}
I saw those clientmessages,whoever you need to send them to,make "playerid" "id" so it will send it to the target id.
Reply
#3

still same problem here. ...

+ my command delete stats of account ... why !?!??
Reply
#4

sorry for DP, but any help ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)