strcmp not working 100% safe - 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: strcmp not working 100% safe (
/showthread.php?tid=106097)
strcmp not working 100% safe -
Striker_Moe - 01.11.2009
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?
Re: strcmp not working 100% safe -
dice7 - 01.11.2009
Quote:
Originally Posted by Mo3
Even users without the correct name (but a pretty similar one) get the value assigned.
|
Like ?
Re: strcmp not working 100% safe -
introzen - 01.11.2009
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.
Re: strcmp not working 100% safe -
cyber_punk - 01.11.2009
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