IP Ban
#1

So i don't really know what is the problem, i think that everything works, but again it's not.

So this is the command for banning IP:

Код:
CMD:banip(playerid, params[])
{
	if(Ulogovan[playerid] == 0) return SCM(playerid, GREY, "Morate se prvo prijaviti !");
	
	new ip[24], query[128], str[128];
	if(PI[playerid][Admin] == 0) return SCM(playerid, RED, " (greska) {FFFFFF}Nemate ovlastenje za koristenje ove komande !");
	if(sscanf(params, "s[24]", ip)) return SCM(playerid, GREY, "Koristite: /banip [IP Adresa]");
	if(strlen(ip) < 7) return SCM(playerid, TOMATO, " (greska) {FFFFFF}IP Adresa je previse kratka !");
	if(strlen(ip) > 20) return SCM(playerid, TOMATO, " (greska) {FFFFFF}IP Adresa je previse duga !");
	
	format(query, sizeof(query), "INSERT INTO `IP Banovi` (`IP`) VALUES ('%s')", ip);
	mysql_function_query(konekt, query, true, "OnQueryFinish", "i", THREAD_OSTALO);
	
	format(str, sizeof(str), "AdmCmd: %s je banovao ip adresu %s.", ImeIgraca(playerid), ip);
	SAM(TOMATO, str);
	return 1;
}
This is under onplayerconnect

Код:
	new query[128];
	format(query, sizeof(query), "SELECT * FROM `IP Banovi` WHERE `IP` = '%s'", GetPlayerIpAddress(playerid));
	mysql_function_query(konekt, query, true, "OnQueryFinish", "ii", THREAD_PROVERIIP, playerid);
and this is thread

Код:
	    case THREAD_PROVERIIP:
	    {
	        if(szRows > 0)
	        {
	            OcistiChat(extraid, 10);
	            
	            SCMF(extraid, WHITE, "{FFAF00}IP Adresa {00FFEE}%s {FFAF00}je banovana sa ovog servera !", GetPlayerIpAddress(extraid));
	            SCM(extraid, WHITE, "{FFAF00}Postavite zahtev za unban u odredjenoj sekciji na forumu !");
	            SCM(extraid, WHITE, "{FFAF00}Ukoliko smatrate da je doslo do greske slikajte ovo{00FFEE}(F8) {FFAF00}i postavite na forum !");
	            OcistiChat(extraid, 2);
	            
	            KikujIgraca(extraid);
			}
			else
			{
			    format(gQuery, sizeof(gQuery), "SELECT * FROM `Igraci` WHERE `Ime` = '%s'", ImeIgraca(extraid));
			    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "ii", THREAD_NALOGPROVERA, extraid);
			}
		}
Reply


Forum Jump:


Users browsing this thread: