20.08.2014, 12:28
Hello , I want to check if the player's name contains one "_" atleast or not, but it isn't working!
results of printf tests :
it didn't print this
pawn Код:
new playernametest[MAX_PLAYER_NAME], numberof=0;
GetPlayerName(playerid, playernametest, MAX_PLAYER_NAME);
for (new j=0; j<= strlen(playernametest)-1;j++)
{
printf("%c", playernametest[j]);
if(!strcmp("_", playernametest[j]))
{
numberof++;
printf(" _ found at, %i", j);
}
}
printf("numberof = %i", numberof);
Код:
[14:31:14] S [14:31:14] a [14:31:14] r [14:31:14] r [14:31:14] a [14:31:14] _ [14:31:14] T [14:31:14] e [14:31:14] s [14:31:14] t [14:31:14] i [14:31:14] n [14:31:14] g [14:31:14] _ [14:31:14] N [14:31:14] a [14:31:14] m [14:31:14] e [14:31:14] numberof = 0
pawn Код:
if(!strcmp("_", playernametest[j]))
{
numberof++;
printf(" _ found at, %i", j); //this
}