14.02.2013, 14:14
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:
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.
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; } }
Thanks for taking a look.