strcmp not working 100% safe
#1

Hi there.

Iґm using one of those at OnPlayerConnect:

Код:
	if(!strcmp(PlayerName, "[Boobs]Andre", true))
	{
	boobsleader[playerid] = 1;
	boobsmember[playerid] = 1;
	}
But It doesnt seem to work solid. Even users without the correct name (but a pretty similar one) get the value assigned. But I only want the EXACT nameґs value setted. Whats the problem?
Reply
#2

Quote:
Originally Posted by Mo3
Even users without the correct name (but a pretty similar one) get the value assigned.
Like ?
Reply
#3

try
pawn Код:
if(!strcmp(PlayerName, "[Boobs]Andre", false))
instead of
pawn Код:
if(!strcmp(PlayerName, "[Boobs]Andre", true))
Will make the server to check the exactly right capitals of the name too.
Reply
#4

change if(!strcmp(PlayerName, "[Boobs]Andre", true)) to if(!strcmp(PlayerName, "[Boobs]Andre", false)) changing it to false forces it to check on the letters case so it has to be spelled EXACTLY like that.

Whoops IntrozeN beat me
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)