Moving Gate[+rep]
#5

pawn Код:
new playername[24];
    if( strfind( playername, "TAG", true) == -1 )
    {
        SendClientMessage( playerid, 0xFFFFFFFF, "...................");
        return 1;
    }
- You defined an array called "playername". However, you are not giving the array content. You're not getting someone's username right now.

- Why are you using "== -1"? It returns -1 if the text "TAG" has not been found. It returns a different value if it is found. Which means, you should definitely replace "== -1" with "!= -1". Unless you want to close the callback for users who do not have "TAG" in their name. If this is the case, then ignore this point.

Quote:
Originally Posted by KickInTheMick
Посмотреть сообщение
Without strfind it works perfect
Of course, it returns "-1" which means, "TAG" has not been found in the array with no content.

At this moment strfind is looking for the text "TAG" in the array playername. But playername does not have content, which means the array is defined like this: "".
Reply


Messages In This Thread
Moving Gate[+rep] - by KickInTheMick - 19.11.2013, 06:54
Re: Moving Gate[+rep] - by Jankingston - 19.11.2013, 06:58
Re: Moving Gate[+rep] - by Biesmen - 19.11.2013, 06:59
Re: Moving Gate[+rep] - by KickInTheMick - 19.11.2013, 07:19
Re: Moving Gate[+rep] - by Biesmen - 19.11.2013, 07:26
Re: Moving Gate[+rep] - by KickInTheMick - 19.11.2013, 07:48

Forum Jump:


Users browsing this thread: 3 Guest(s)