Search for capital letters
#1

Hi,

I have a question..
when a player connects i want to check his name, is it RP Name_Surname, i made checker but only with '_' and now i want to check for Capital letters
Reply
#2

Refresh! Bump!
Anyone help?
Reply
#3

download some RP gm and see how its there
Reply
#4

It's better to automaticly change it if there are no capital letters.

Example:
pawn Код:
new
    pName[20] = "name_surename", // you need to do GetPlayerName I just assigned something, don't forget.
    name[2][20]
;
strmid(name[0], pName, 0, strfind(pName, "_"));
strmid(name[1], pName, strfind(pName, "_") + 1, strlen(pName));
for(new x; x != sizeof(name); x++) name[x][0] = toupper(name[x][0]);
// printf("%s_%s", name[0], name[1]);
Alright, let's say name_surename is our input. This code above will automaticly change the first letter before '_' and after to a capital letter.
I didn't do something if the strfind function return -1 because I read you did a RP name check so, that's all OK.
Reply
#5

thanks RyDeR!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)