SA-MP Forums Archive
in_array() function - 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: in_array() function (/showthread.php?tid=89226)



in_array() function - PKRanger - 31.07.2009

Is there some function for in Pawno to check if a value is in the array ?


example:
Array for bad nicknames: Fuck, ass, pussy, boobies, admin, administrator

if (!in_array(mynick, array))
{
// Good nick
}


Re: in_array() function - James_Alex - 31.07.2009

try the bad_names filterscript
look in my signature


Re: in_array() function - Westie - 31.07.2009

Quote:
Originally Posted by ► James_Alex
try the bad_names filterscript
look in my signature
Yeah, check my signature too!
</deLUX>

I suppose the nearest to in_array would to actually loop through the array.