Terminal string styling done right
- Download from the
releases
page the desired version of the plugin for your platform. - Unpack the archive to the root directory of the server.
- Add to the server configuration file the line:
- samp server:
- "plugins pawnchalk" - for Windows platform
- "plugins pawnchalk.so" - for Linux platform
- open.mp server:
"pawn": { "legacy_plugins": [ "pawnchalk" ] }
- samp server:
-
chalk_bg
- Add a background color to a string
- See here to see the list.
- Example:
new output[256]; chalk_bg(RebeccaPurple, output, sizeof output, "Hello World"); print(output);
- Result:
-
chalk_fg
- Change the color of a string
- See here to see the list.
- Example:
new output[256]; chalk_fg(RebeccaPurple, output, sizeof output, "Hello World"); print(output);
- Result:
-
chalk_style
- Add styling to a string
- See here to see the list.
- Example:
new output[256]; chalk_style(Bold, output, sizeof output, "Hello World"); print(output);
- Result:
- return_chalk_bg
- return_chalk_bg_hex
- return_chalk_fg
- return_chalk_fg_hex
- return_chalk_style
- chalk_bg_hex
- chalk_fg_hex
Note
All of the natives now supports formatting.
Important
For those people who are running the server directly (clicking samp-server.exe or omp-server.exe), there might be an issue where the console wont properly show the colors. Here's the solution, thanks to Knife for providing the solution:
- Right click the top edge of console window.
- Click the Default.
- Navigate to Terminal tab.
- And choose command prompt option in default terminal application drop-down menu.
- Restart the server by closing the window.
Reference: here