Issue With SSCANF K Specifier - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Issue With SSCANF K Specifier (
/showthread.php?tid=415726)
Issue With SSCANF K Specifier -
Camacorn - 14.02.2013
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.
Re: Issue With SSCANF K Specifier -
Camacorn - 14.02.2013
Because with "u", if someones name is [TAG]Mathew, you can't just do /goto Mat, but with "k" you can.
Re: Issue With SSCANF K Specifier -
Babul - 14.02.2013
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!