get user name (HL log format)
I work heavily with HL log files, so I wanted a function to return a player's name in HL log format, rather than just their name in-game. For instead, instead, instead of "Warthog" I would want to return "Warthog<1><0:0:12345><CT>"
So below is the function for this - it is based off of get_user_name() in that you pass the ID, string to copy the data into, and the length. It also returns 0 or 1 based on if the user was found. Code:
|
Re: get user name (HL log format)
Definitely useful, I think it would be a good addition to amxmisc.
|
Re: get user name (HL log format)
thanks. actually i modified the first part so you don't have to declare an extra variable for the player...i just put the find_player() check right in the first if() statement
|
Re: get user name (HL log format)
You can also avoid a native call by doing:
Code:
Rather than: Code:
|
Re: get user name (HL log format)
That's kind of spiffy. I'm not used to being able to clear out strings that way. I modifed my original post to include your improvement. Thanks Hawk.
|
Re: get user name (HL log format)
oops, made one more change and hopefully it's the last edit. get_user_name() that i based this off of passes the player index into the function, but i was treating it like the player userid instead. so i changed find_player() to just check if the index is within the 1-32 range.
|
All times are GMT -4. The time now is 04:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.