Issue With SSCANF K Specifier
#1

Hello,

I am using the sscanf k specifier to teleport to people using just a part of their name. I have a system that detects if theres multiple people with for example "mat" in their name, however, even if there is it says "mat" is not a valid selection. I'll paste the code below:

Код:
		if(sscanf(params, "k<player_name>", ID)) return SendClientMessage( playerid, white, "USAGE: /goto [playerid/partofname]");
		{
			if(!IsPlayerConnected(ID) || ID == -1)
			{
	            new replacetext[35];
	            format(replacetext, sizeof(replacetext), "%s", params);

	            new position = strfind(replacetext, " ", true);

	            new total = strlen(replacetext);

	            new total2 = total - position;

	            strdel(replacetext, position, position+total2);

				if(ID == -1)
				{
					SCMF(playerid,red, "Sorry, there are multiple results for {FFFFFF}%s{FF0000}, please narrow your selection.",replacetext);
				}
				else
				{
				    SCMF(playerid,red, "Sorry, {FFFFFF}%s{FF0000} is not a valid selection.",replacetext);
				}
	            return 1;
	        }
     }
I would like it to say "Sorry, there are multiple results for "mat", please narrow your search" like it should.

Thanks for taking a look.
Reply
#2

Because with "u", if someones name is [TAG]Mathew, you can't just do /goto Mat, but with "k" you can.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=120356, its yet another update on the top
search for "MATCH_NAME_PARTIAL", it works with more players. yay!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)