Strfind not working..
#1

Hi,
What's wrong with this:

PHP код:
new nname[MAX_PLAYER_NAME];
GetPlayerName(playeridnnamesizeof(nname));
if(
strfind("[GTA]"nnametrue) != -1
I want to check if the Name of the player has [GTA] or not.
Reply
#2

Try using this code, you got the error because you used wrong format of strfind() function
Quote:

new nname[MAX_PLAYER_NAME];
GetPlayerName(playerid, nname, sizeof(nname));
if(strfind(nname, "[GTA]", true) != -1)


Its the wrong format
Quote:

strfind("[GTA]", nname, true) != -1)

The correct format should be
Quote:

strfind(nname, "[GTA]", true) != -1)

Reply
#3

Код:
if(strfind(nname, "[GTA]", true) != -1)
Reply
#4

Thanks. MicroD. It worked.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)