Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock randtext(letters,option = OPTION_CAPSMALL,bool:withnum)
- {
- assert(letters < 128 && option <= OPTION_CAP && option >= OPTION_CAPSMALL);
- new text[128], rand, rand2;
- text[0] = EOS;
- for(new i=0; i < letters; i++)
- {
- rand = withnum? random(2) : 1;
- if(rand && option == OPTION_CAPSMALL) rand2 = random(2);
- if(option == OPTION_CAPSMALL) format(text,sizeof(text),"%s%s",text,!rand? randomex('9','0') : (!rand2? randomex('z','a') : randomex('Z','A')));
- else if(option == OPTION_SMALL) format(text,sizeof(text),"%s%s",text,!rand? randomex('9','0') : randomex('z','a'));
- else if(option == OPTION_CAP) format(text,sizeof(text),"%s%s",text,!rand? randomex('9','0') : randomex('Z','A'));
- }
- return text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement