11.11.2017, 01:33
(
Последний раз редактировалось Dayrion; 11.11.2017 в 02:06.
)
Hello.
I'm probably stupid but I've a simple question about sscanf. Let's take the specifer "u". sscanf should return the first player with the name/part of name or return INVALID_PLAYER_ID if nobody is connected/+2 players with the same name. I'm right?
If yes, it doesn't work. It take only the first person with the name and doesn't consider others people.
For testing purposes, I connected two accounts : Player_First (ID 6) & Player_Two (ID 5).
My code:
Output:
I'm probably stupid but I've a simple question about sscanf. Let's take the specifer "u". sscanf should return the first player with the name/part of name or return INVALID_PLAYER_ID if nobody is connected/+2 players with the same name. I'm right?
If yes, it doesn't work. It take only the first person with the name and doesn't consider others people.
For testing purposes, I connected two accounts : Player_First (ID 6) & Player_Two (ID 5).
My code:
PHP код:
CMD:test_id(playerid, params[])
{
new targetid[4]; // An array for 'debugging' purpose
sscanf(params, "u[4]", targetid);
for(new i; i < sizeof(targetid); i++)
printf("Player's ID %i - Name: %s", targetid[i], GetName(targetid[i]));
return 1;
}
Код:
[03:01:52] Player's ID 5 - Name: Player_Second [03:01:52] Player's ID 65535 - Name: [03:01:52] Player's ID 0 - Name: Bot_1 [03:01:52] Player's ID 0 - Name: Bot_1