Help with OnPlayerText
#1

Hello all, i have a little question..

Код:
public OnPlayerText(playerid, text[])
{
	  if(!strcmp(text,"1",false,1))
	  {
	  	return false;
		}
	return 1;
}
This code allow me to 'return 0;' if one player write in the chat only number '1'..but this code don't work perfectly..because if i write 11, it return 0; .. if i write 11162..return 0; too. So, how can i fix it? Sry for my bad english
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
      if (!strcmp( text, "1", true))
      {
        return false;
        }
    return 1;
}
Reply
#3

This work perfectly, but can you explain me why i have to delete ",1" after true ?
Reply
#4

Quote:
Originally Posted by Leoxide
This work perfectly, but can you explain me why i have to delete ",1" after true ?
See Here
Reply
#5

Quote:
Originally Posted by Leoxide
This work perfectly, but can you explain me why i have to delete ",1" after true ?
let me explain it shortly, "true" means it's not case sensitive.
the "1" after is useless.
that's it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)