03.07.2013, 11:04
(
Последний раз редактировалось Mmartin; 03.07.2013 в 16:12.
)
Thought I'd share even though I wouldn't put my hand in fire that it couldn't be made simpler.
Код:
stock IsRPName(name[]) { new upos=strfind(name, "_"); if(isnull(name)) return false; if(strlen(name)-2<upos<2) return false; for(new i = 0; i < 24; i++) { if(!name[i]) break; if(!i && 65 > name[i] > 90) return false; if(name[i] == 95 && i!=upos) return false; if(upos && i-upos == 1) { if(65 > name[i] > 90) return false; } if(65 <= name[i] <= 90) { if(!(!i || i==upos+1 || (i==2 && upos>5) || (i==upos+3 && strlen(name)-upos>5))) return false; } if(97 > name[i] > 122) return false; } if(upos==-1) return false; if(strlen(name)-upos<3) return false; return true; }