Author Topic: Name detection when using default server commands?  (Read 934 times)

0 Members and 1 Guest are viewing this topic.

Offline iSnipe

  • Major(1)
  • Posts: 15
  • 2pro4skool
Name detection when using default server commands?
« on: July 17, 2014, 04:32:54 am »
Whenever I use a command that requires a name, I have to type the player's full name (including capitalization) after the command or it just doesn't work. If I want to kick, say, John, I have to write /kick John in order to kick him. I would like to be able to just write /kick jo, or write their number/ID (I don't know how to find those) instead of the name.

Can someone suggest any shortcuts or point to scripts that make this possible?
Thanks in advance.

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Name detection when using default server commands?
« Reply #1 on: July 17, 2014, 05:26:48 am »
You can find id number by pressing "/" and F1 button (it's a number before nicknames).

/kick jo can be scriptable using this kind of function
Code: [Select]
function GetTarget(Name: string): string;
begin
Result:=Name;
for i:=1 to 32 do begin
if GetPlayerStat(i, 'Active')=TRUE then begin
if ContainsString(lowercase(GetPlayerStat(i, 'Name')), lowercase(name)) then begin
Result:=IDToName(i);
Exit;
end;
end;
end;
end;
But using it u wont be never sure if this will choose desired player, imo it's much better to use /kick <id>
Classic banana

Offline iSnipe

  • Major(1)
  • Posts: 15
  • 2pro4skool
Re: Name detection when using default server commands?
« Reply #2 on: July 17, 2014, 07:43:54 am »
You can find id number by pressing "/" and F1 button (it's a number before nicknames).

Ah, I see. Thank you very much!