Wolvin-NET / prophuntx

Prop Hunt X2Z: 2024 version of Modernized, Enhanced and Customisable Version of Classic Prop Hunt for Garry's Mod.
https://gmodgameservers.com/prophuntx
22 stars 15 forks source link

Enhancement: teams name #16

Closed haeiven closed 2 years ago

haeiven commented 2 years ago

Hi,

It could be great to be able to rename Teams (display name), so it could be translated.

Vinzuerio commented 2 years ago

Should be added shortly, but this uses new function name if you don't mind with it.

Vinzuerio commented 2 years ago

Added PHX:TranslateName( number idTeam, player Ply ) exclusively for Team name translation. The idTeam must contain number, and player entity. A player entity is only used on server side where you want to send the translation text through serverside to a client. This only works if you use something like PHX:ChatInfo or something. This isn't ideal if you use a hook like on Think or Tick on server side. You've been warned.

This feature will be added soon on master branch release of PH:X June update.

Extra:

  1. I've also replaced some team text in fretta as well that uses to this function so you don't have to replace the whole codes from it. If you're using a custom addon that uses PHX's code, and by trying to use team translation, use this function instead.
  2. You can leave Ply argument as empty or nil if you use it on client side.