28.05.2011, 14:14
Quote:
//=========================[Anti-server advertisement]==========================
new dotcount =0; new coloncount =0; for(new a=1; a <strlen(cmdtext); a++) { if(cmdtext[a] == ':') { coloncount ++; } else if(cmdtext[a] == '.') { dotcount ++; } } if(dotcount == 3 && coloncount == 1 && PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to advertise other servers here."); return 1; } if(gPlayerLogged[playerid] == 1) { GetPlayerName(playerid, sendername, sizeof(sendername)); printf("[cmd] [%s] %s", sendername, cmdtext); ------------------------------------------------------------------------------------------------------------------ in OnPlayerCommandText() new ip[15]; if(ipmatch(result, ip)) { format(string, sizeof(string), "AdmCmd: %s was banned by ANTICHEAT, reason: Server Advertising.", RemoveUnderScore(playerid)); SendClientMessageToAll(COLOR_LIGHTRED, string); BanEx(playerid, "Banned By: Autoban Reason: Server Advertising"); return 0; |