Skip to content

Instantly share code, notes, and snippets.

@CaptainPRICE
Created June 3, 2016 11:57
Show Gist options
  • Save CaptainPRICE/5d161db6a6e010e68360ff7e409bb07a to your computer and use it in GitHub Desktop.
Save CaptainPRICE/5d161db6a6e010e68360ff7e409bb07a to your computer and use it in GitHub Desktop.
A small helper function (E2) to get an array of all players names with an argument of max. length (player with name greater than Length, will have the name "cuted-down"). Very simple.
function array getPlayersNameSubstr(Length)
{
local Result = array()
local Players = players()
for (Index = 1, Players:count())
{
local Player = Players[Index, entity]
Result:pushString(Player:name():sub(1, Length))
}
return Result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment