Problem with sscanf
#1

I took an example code from sscanf thread:
Code:
#include <a_samp>
#include <Pawn.CMD>
#include <sscanf2>

main()
{

}

cmd:test(playerid, params[])
{
	new ids[3], i;
	if (sscanf(params, "?<MATCH_NAME_PARTIAL=1>u[3]", ids)) printf("Error in input");
	for (i = 0; ids[i] != INVALID_PLAYER_ID; ++i)
	{
	    if (ids[i] == cellmin)
	    {
	        printf("Too many matches");
	        break;
	    }
	    printf("id = %d", ids[i]);
	}
	if (i == 0) printf("No matching players found.");
	return 1;
}
There are 2 players:
Code:
0) [CLAN]Y_Less
1) Y_Less
When I write /test [CLAN] I get this:
Code:
id = 0
id = 1
But it should be:
Code:
id = 0
However, if players switch their IDs everything is fine.
Code:
0) Y_Less
1) [CLAN]Y_Less
/test [CLAN]
Code:
id = 1
Any ideas?

EDIT:

v2.8.3 fixed this issue, but I have another issue.

There is 1 player:
Code:
0) [CLAN]Y_Less
and if I enter this:
Code:
/test [CLAN]Y_LessSomething
I get this:
Code:
id = 0
Reply
#2

Use "r". I had this bug too and i fixed with that.
Reply
#3

Quote:
Originally Posted by KinderClans
View Post
Use "r". I had this bug too and i fixed with that.
Nope, didn't work for me.
Reply
#4

v2.8.3 fixed this issue, but I have another issue.

There is 1 player:
Code:
0) [CLAN]Y_Less
and if I enter this:
Code:
/test [CLAN]Y_LessSomething
I get this:
Code:
id = 0
Reply
#5

Bump.
Reply
#6

Quote:
Originally Posted by 2Col
View Post
v2.8.3 fixed this issue, but I have another issue.

There is 1 player:
Code:
0) [CLAN]Y_Less
and if I enter this:
Code:
/test [CLAN]Y_LessSomething
I get this:
Code:
id = 0
i think cus you are just checking first 3x characters so that should return true
Reply
#7

Quote:
Originally Posted by khRamin78
View Post
i think cus you are just checking first 3x characters so that should return true
I don't think so.

If I enter this:
Code:
[CLAN]Something
Everything is fine, I get this:
Code:
No matching players found.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)