Ban Bug - Help
#1

i tried to make second /ban command like this:

Код:
CMD:ban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2)return NisiAdmin(playerid);
  	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 Koristi(playerid, "/ban [player id] [razlog]" );
  	else if(ID == INVALID_PLAYER_ID)return PogresanID(playerid);
  	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);
      		return Kick( ID );
   		}

	}
  	return 1;
}
but its buggy... it wont to kick player and to SENDCLIENTMESSAGETOALL it just ban when you login
Reply
#2

pawn Код:
CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2)return NisiAdmin(playerid);
    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 Koristi(playerid, "/ban [player id] [razlog]" );
    else if(ID == INVALID_PLAYER_ID)return PogresanID(playerid);
    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
#3

same problem.. it doesnt helped me :/
Reply
#4

sorry on DP, but i really need help... can help me someone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)