05.01.2013, 21:33
I have found the problem :
Onplayerconnect :
Bancheck & tempbancheck :
What is wrong?
Onplayerconnect :
Код:
if(!bancheck(playerid)) { KickTimer[playerid] = SetTimerEx("KickPlayer", 4500, false, "i", playerid); return 1; } if(!tempbancheck(playerid)) { KickTimer[playerid] = SetTimerEx("KickPlayer", 4500, false, "i", playerid); return 1; }
Код:
stock bancheck(playerid) { new PIP[18], Query[120], BName[MAX_PLAYER_NAME+1], string[50], estring[50], Pname[MAX_PLAYER_NAME+1], largestring[250]; GetPlayerIp(playerid, PIP, sizeof(PIP)); GetPlayerName(playerid, BName, sizeof(BName)); format(Query, sizeof(Query), "SELECT * FROM `banlog` WHERE (`name` = '%s' OR `ip` = '%s') AND `banned` = 1 LIMIT 1", BName, PIP); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() != 0) { new Name2[24]; while(mysql_fetch_row(Query)) { mysql_fetch_field_row(string, "reason"); mysql_fetch_field_row(Pname, "admin"); mysql_fetch_field_row(estring, "time"); mysql_fetch_field_row(PIP, "ip"); mysql_fetch_field_row(Name2, "name"); } format(largestring, sizeof(largestring), "{FFFFFF}Pseudo/IP banni(e) de GW-DM.\r\n{FFFFFF}Compte: {C0C0C0}%s\r\n{FFFFFF}IP: {C0C0C0}%s\r\n{FFFFFF}Date: {C0C0C0}%s\r\n{FFFFFF}Admin: {FF0000}%s{FFFFFF}\r\n\n{FFFFFF}Raison:\n{C0C0C0}%s", Name2, PIP, estring, Pname, string); ShowPlayerDialog(playerid, 8787, DIALOG_STYLE_MSGBOX, "Pseudo/IP bannie", largestring, "OK", ""); Kick(playerid); } mysql_free_result(); return 1; } stock tempbancheck(playerid) { new PIP[18], Query[120], BName[MAX_PLAYER_NAME+1], string[50], estring[50], Pname[MAX_PLAYER_NAME+1], largestring[250], TimeEnd[50], heures[3]; GetPlayerIp(playerid, PIP, sizeof(PIP)); GetPlayerName(playerid, BName, sizeof(BName)); format(Query, sizeof(Query), "SELECT * FROM `tempbanlog` WHERE (`name` = '%s' OR `ip` = '%s') AND `banned` = 1 LIMIT 1", BName, PIP); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() != 0) { new Name2[24]; while(mysql_fetch_row(Query)) { mysql_fetch_field_row(TimeEnd, "time_end"); mysql_fetch_field_row(string, "reason"); mysql_fetch_field_row(Pname, "admin"); mysql_fetch_field_row(estring, "time"); mysql_fetch_field_row(PIP, "ip"); mysql_fetch_field_row(Name2, "name"); mysql_fetch_field_row(heures, "hours"); } new TimeEnd2 = strval(TimeEnd); new Heures2 = strval(heures); if(gettime() > TimeEnd2) { return 1; } format(largestring, sizeof(largestring), "{FFFFFF}Pseudo/IP banni(e) de GW-DM.\r\n{FFFFFF}Compte: {C0C0C0}%s\r\n{FFFFFF}IP: {C0C0C0}%s\r\n{FFFFFF}Date: {C0C0C0}%s\r\n{FFFFFF}Heures: {C0C0C0}%d\r\n{FFFFFF}Admin: {FF0000}%s{FFFFFF}\r\n\n{FFFFFF}Raison:\n{C0C0C0}%s", Name2, PIP, estring, Heures2, Pname, string); ShowPlayerDialog(playerid, 8787, DIALOG_STYLE_MSGBOX, "Bannissement temporaire", largestring, "OK", ""); //KickTimer[playerid] = SetTimerEx("KickPlayer", 1000, false, "i", playerid); //return 0; } mysql_free_result(); return 1; }