01.02.2014, 13:15
Код:
public OnPlayerConnect(playerid) { new Query[250], DBResult:Result; format(Query, sizeof(Query), "SELECT `NAME` FROM `BANNED` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(PlayerName(playerid))); Result = db_query(BFU, Query); if(db_num_rows(Result)) { ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Ban has been detected", "Our system has detected that your name was banned.\nIf you think this is an error or mistake, visit our website.\n"WEBSITE"", "Okay", ""); printf("%s has been kicked from OnPlayerConnect - Username ban detection", PlayerName(playerid)); KickEx(playerid); } else { format(Query, sizeof(Query), "SELECT `IP` FROM `BANNED` WHERE `IP` = '%s' COLLATE NOCASE", DB_Escape(PlayerIP(playerid))); Result = db_query(BFU, Query); if(db_num_rows(Result)) { ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Ban has been detected", "Our system has detected that your IP was banned.\nIf you think this is an error or mistake, visit our website.\n"WEBSITE"", "Okay", ""); printf("%s has been kicked from OnPlayerConnect - IP ban detection", PlayerName(playerid)); KickEx(playerid); } else { format(Query, sizeof(Query), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(PlayerName(playerid))); Result = db_query(BFU, Query); if(db_num_rows(Result)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Log-in is required", "Hello user!\nYour name has been detected as registered.\nYou are now required to log-in.\n"GREEN"Enter your password below to continue", "Login", "Leave"); } else { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registration is required", "Hello user!\nYour name has been detected as not registered.\nYou are now required to register.\n"GREEN"Enter your password below to continue", "Register", "Leave"); } } } db_free_result(Result); return 1; }
The errors are wherever ShowPlayerDialog is.