Garry's Mod

Garry's Mod

106 ratings
Hint Messages
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Roleplay
File Size
Posted
498.000 B
5 Oct, 2023 @ 4:25am
1 Change Note ( view )

Subscribe to download
Hint Messages

Description
This Lua-script allows you to display messages to all players on the server in the form of standard game tips.

Usage: gm_hint_all "message" — Access for all players.

Idea for mappers: If you are creating a map with a walkthrough, you can use this script as hints for players when completing puzzles through triggers on the map.

Note: To use indentation in messages, specify a slash with an English letter N like this: \n — At the point in the message where you want to indent. Example: Hello \n World !

Tip: You can use special characters or unique characters from other languages, for example: German, Chinese, Japanese and so on

To do this you will need to open the CFG folder in the game directory, create a file with any name, for example: msg.cfg — Be sure to save this file with encoding: UTF-8 with specification (without BOM).

Open the msg.cfg file with any text editor and write the command inside the file: gm_hint_all "message"

Using the file with encoding: UTF-8 with specification (without BOM) — You will be able to display prompts for all players with unique and special characters from any language in the world.
22 Comments
Смайл  [author] 4 Jan @ 10:36am 
I tweaked the code a bit and now you can use it on maps:
—————————————————————————
concommand.Add("info_hint", function(ply, cmd, args)
if #args < 1 then
ply:PrintMessage(HUD_PRINTCONSOLE, "Usage: info_hint <msg>")
else
local message = table.concat(args, " ")
ply:SendLua([[notification.AddLegacy("]] .. message .. [[", NOTIFY_HINT, 5)]])
end
end)
—————————————————————————
Create triggers on the map and use point_clientcommand to make the player enter console commands when the player touches a trigger. The console command is: info_hint "hint text" — Access for all players.

Example: info_hint "Press F to turn on the flashlight"

To indent, use: \n — Example: info_hint "New mission:\n\nKill all enemies."

You can use this code on a map through Hammer Editor or use it on your server. Save the file as 'info_hint.lua' and put it in the folder 'garrysmod\lua\autorun\server'.
Смайл  [author] 27 Sep, 2024 @ 12:42am 
To do this, you need to create a separate mod or modify the map.

Add triggers all over the map and slightly modify the lua script to display messages only for a special player.
THE BEST MICHAEL GAMING TBMG 26 Sep, 2024 @ 3:31pm 
I wish the hints were automatic set like an AI bought it just knows when you're going to go to the dark room remind you to turn on your flashlight

you should have a mod where it does this automatically so I don't have to set it manually
Смайл  [author] 15 Oct, 2023 @ 8:03am 
Peut-être :)
YohSambre 15 Oct, 2023 @ 8:00am 
bah justement tu mérite plus d'abonnés :3
Смайл  [author] 15 Oct, 2023 @ 7:59am 
Je ne pense pas que ce soit nécessaire, car je ne suis pas très populaire.

Alors merci quand même ^_^
YohSambre 15 Oct, 2023 @ 7:19am 
je pense que ce serais une bonne chose d'ajouter une concommand coté client genre gm_hint_credits qui print dans la console coté client ton pseudo et un lien vers l'addon :lunar2019piginablanket:
Смайл  [author] 11 Oct, 2023 @ 8:59am 
yeap thanks u for comment, bro :>
N 11 Oct, 2023 @ 8:05am 
this is a very good addon, thanks for making this
Róman B. 10 Oct, 2023 @ 2:33am 
Can you also make it to playsound serverside ? :missing: sound/ambient/levels/canals/drip3.wav :missing: