Garry's Mod

Garry's Mod

107 个评价
Hint Messages
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 快乐, 角色扮演
文件大小
发表于
498.000 B
2023 年 10 月 5 日 上午 4:25
1 项改动说明 ( 查看 )

订阅以下载
Hint Messages

描述
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" — This command is accessible to 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 or unique characters from other languages, such as German, Chinese, Japanese, and so on.

To do this, you'll need to open the CFG folder in the game directory, create a file with any name, such as msg.cfg — and 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"

By using the file with encoding: UTF-8 with specification (without BOM), you'll be able to display prompts for all players with unique and special characters from any language in the world.
21 条留言
Смайл  [作者] 1 月 4 日 上午 10:36 
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'.
Смайл  [作者] 2024 年 9 月 27 日 上午 12:42 
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.
Angel 2024 年 9 月 26 日 下午 3:31 
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
Смайл  [作者] 2023 年 10 月 15 日 上午 8:03 
Peut-être :)
YohSambre 2023 年 10 月 15 日 上午 8:00 
bah justement tu mérite plus d'abonnés :3
Смайл  [作者] 2023 年 10 月 15 日 上午 7:59 
Je ne pense pas que ce soit nécessaire, car je ne suis pas très populaire.

Alors merci quand même ^_^
YohSambre 2023 年 10 月 15 日 上午 7:19 
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:
Смайл  [作者] 2023 年 10 月 11 日 上午 8:59 
yeap thanks u for comment, bro :>
N 2023 年 10 月 11 日 上午 8:05 
this is a very good addon, thanks for making this
Róman B. 2023 年 10 月 10 日 上午 2:33 
Can you also make it to playsound serverside ? :missing: sound/ambient/levels/canals/drip3.wav :missing: