Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- regex_IsValidIP(const pid, const string[])
- {
- //Caps converter!
- /*new len = strlen(string);
- new solid_str[512]; format(solid_str, sizeof(solid_str), "%s", string);
- new Regex:CapsC = Regex_New("[A-Z]*");
- if(Regex_Check(string, CapsC))
- {
- Regex_Delete(CapsC);
- for(new i; i < len; i++)
- {
- new ststst[8]; strmid(ststst, string, i, i+1);
- for(new k; k < 26; k++)
- {
- if(strcmp(ststst, AlpBig[k][0], true) == 0)
- {
- ReplaceString(solid_str, AlpBig[k][0], AlpSmall[k][0], solid_str);
- }
- }
- }
- }
- else
- {
- Regex_Delete(CapsC);
- }*/
- if(isnull(string)) return 0;
- //IP-Checker
- new Regex:ipRegex = Regex_New(".*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([A-Za-z\\s\\\\`´\\?\\*'#~\\+-_;\\.,:=}{\\[\\]\\(\\)/&%\\^\\$§³²°!\"])*(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([A-Za-z\\s\\\\`´\\?\\*'#~\\+-_;\\.,:=}{\\[\\]\\(\\)/&%\\^\\$§³²°!\"])*(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([A-Za-z\\s\\\\`´\\?\\*'#~\\+-_;\\.,:=}{\\[\\]\\(\\)/&%\\^\\$§³²°!\"])*(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)).*");
- if(Regex_Check(string, ipRegex))
- {
- Regex_Delete(ipRegex);
- foreach (new k : Player)
- {
- if(playerData[k][pd_AdminRank] > 2)
- {
- if(playerData[k][pd_AdminRank] >= playerData[pid][pd_AdminRank])
- {
- new zu[128];
- format(zu, sizeof(zu), "[SERVER] %s(%i) probably advertises: %s", ReturnPlayerName(pid), pid, string);
- SendClientMessage(k, COLOR_ALERT, zu);
- SendClientMessage(pid, COLOR_NOTIFY, "[SERVER] Found possible Advertisment. ");
- }
- }
- }
- strdel(ColADV[pid], 0, strlen(ColADV[pid]));
- return 1;
- }
- //Domain-Checker
- new Regex:domainRegex = Regex_New("(.*([\\\\`´\\?\\*'#~\\+-_;\\.,:=}{\\[\\]\\(\\)/&%\\^\\$§³²°!\"]{1,1}\\w{1,18})).*");
- if(Regex_Check(string, domainRegex))
- {
- Regex_Delete(domainRegex);
- foreach (new u : Player)
- {
- if(playerData[u][pd_AdminRank] > 2)
- {
- if(playerData[u][pd_AdminRank] >= playerData[pid][pd_AdminRank])
- {
- new du[128];
- format(du, sizeof(du), "[SERVER] %s(%i) is probably advertising: %s", ReturnPlayerName(pid), pid, string);
- SendClientMessage(pid, COLOR_NOTIFY, "[SERVER] Found possible Advertisment.");
- SendClientMessage(u, COLOR_ALERT, du);
- return 1;
- }
- }
- }
- for(new z = 0; z < sizeof(SearchDomain); z++)
- {
- if(strcmp(string, SearchDomain[z]) == 0)
- {
- foreach (new p : Player)
- {
- if(playerData[p][pd_AdminRank] > 2)
- {
- if(playerData[p][pd_AdminRank] >= playerData[pid][pd_AdminRank])
- {
- new mu[128];
- format(mu, sizeof(mu), "[SERVER] %s(%i) advertises: %s", ReturnPlayerName(pid), pid, string);
- SendClientMessage(pid, COLOR_NOTIFY, "[SERVER] Found possible Advertisment. ");
- SendClientMessage(p, COLOR_ALERT, mu);
- strdel(ColADV[pid], 0, strlen(ColADV[pid]));
- return 1;
- }
- }
- }
- }
- }
- strdel(ColADV[pid], 0, strlen(ColADV[pid]));
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement