Search the Community
Showing results for tags 'color'.
-
Version 1.0.0
496 downloads
Only tested on 1.1 When the player is ready it invokes the natives and sets the pause menu title text. To change the colour or text please read the comments in hud.js It replaces the weapon wheel colour and pause menu accent colour Example These examples used { r: 255, g: 0, b: 0 } Github repo: https://github.com/Dankyss/RageMP-Custom-Hud-Colour-and-Title- 2 reviews
-
- 6
-
- javascript
- JS
-
(and 4 more)
Tagged with:
-
-
Hello everyone! This will be a short guide on how to use colors when using custom chat, not the default one. I know I am not the only one frustrated about this so that's why I want to share this to everyone. Important credits: - Carlos (ex RageMP member) Helped me the most, basically solving everything and giving me a big smile. I still owe you a beer - @Chainksain This dude actually has the same way of doing things as me so big shoutout to him for examples Let's start! Requirements: - Visual Studio 17 or better - Net Core 2.2 - RageMP C# 0.3.7 1. First, create a class that will be used for your chat colorization stuff. Everything will be commented using System; namespace CustomChatColorsTutorial { public static class ChatColorization { // Few general colors public const string ColorRed = "#A80707"; public const string ColorDodgerBlue = "#1E90FF"; /// <summary> /// HEX colorization /// </summary> /// <param name="text">The text you want to colorize</param> /// <param name="color">Use colors from ChatColorization class</param> /// <returns></returns> public static string ColorizeText(string text, string color) { return "<strong style='color:" + color + "'>" + text + "</strong>"; } } } 2. To use colors, do something like this: using System; using GTANetworkAPI; using GTANetworkMethods; namespace CustomChatColorsTutorial { public static class Chat { public void SendExampleMessage(Client player) { NAPI.Chat.SendChatMessageToPlayer(player, ChatColorization.ColorizeText("This is an example", ChatColorization.ColorDodgerBlue)); } } } This will output: This is an example 3. This was simple so far, I agree. But what about mixing few colors in one sentence? Let's say we want to send an error message but nice and clean. This is how we do it: using System; namespace CustomChatColorsTutorial { public static class ChatColorization { // Few general colors public const string ColorRed = "#A80707"; public const string ColorDodgerBlue = "#1E90FF"; // Remember: If you don't explicitly colorize text, it will use your custom chat's default color (white) // In this case, brackets will be white public static string ErrorMessage(string message) { return "(" + ColorizeText("Error", ColorRed) + ") - " + message; } /// <summary> /// HEX colorization /// </summary> /// <param name="text">The text you want to colorize</param> /// <param name="color">Use colors from ChatColorization class</param> /// <returns></returns> public static string ColorizeText(string text, string color) { return "<strong style='color:" + color + "'>" + text + "</strong>"; } } } And then we use that in our Chat class using System; using GTANetworkAPI; using GTANetworkMethods; namespace CustomChatColorsTutorial { public static class Chat { public void SendExampleMessage(Client player) { NAPI.Chat.SendChatMessageToPlayer(player, ChatColorization.ErrorMessage("Something bad happened, please contact the adminstrator!")); } } } This will output: (Error) - Something bad happened, please contact the adminstrator! That's it! You can now use custom colors in your custom chat. If you need assistance, just ask. If something is wrong, please tell me to correct it. Leave feedback. Thank you for reading! xForcer Changelog: Cleaner formatting of ErrorMessage. Removed substring constants
-
- 1
-
- csharp
- netcore2.2
-
(and 3 more)
Tagged with:
-
Стандартный цвет: color: [[88, 88],[88, 88]] Есть ещё этот: color: [[126, 126],[128, 126]], Но цвет меняется только у капота. А хотель бы полностью поменять цвет на жёлтый. RGB - жёлтый не распознаёт. Кто может помогите пожалуйста.
-
Господа, не могу понять что не так. Есть функция, которая принимает строку "ИД цвета" и возвращает массив "RGB" с значением от 0 до 255 в каждом из элементов массива (через свитч реализовано). Что то я накосячил с спойлерами, прошу меня простить.