SA-MP Forums Archive
Help with OnPlayerText - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with OnPlayerText (/showthread.php?tid=74513)



Help with OnPlayerText - Leoxide - 23.04.2009

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


Re: Help with OnPlayerText - kasco - 23.04.2009

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



Re: Help with OnPlayerText - Leoxide - 23.04.2009

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


Re: Help with OnPlayerText - ICECOLDKILLAK8 - 23.04.2009

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


Re: Help with OnPlayerText - OmeRinG - 23.04.2009

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.