AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Formatting Rules? (https://forums.alliedmods.net/showthread.php?t=334621)

AnimalMonster 10-08-2021 22:31

Formatting Rules?
 
I was always wondering where i can find these String Formatting rules of AMXX but i didn't find any info about it, just that they exist.

Could anyone help me here ?:D

Edit: I am talking about the ones with '\' which you put in the menu for color('\w' '\d' '\y' '\r'), new line '\n' and this '\R' which i never knew until i ve seen some buymenu plugin for zp by a guy Sony

fysiks 10-08-2021 23:35

Re: Formatting Rules?
 
For actual string formatting, I use the C++ reference for printf().

For colors (styling, not format), that's more specific to the game. Generally, backslash codes like this don't actually mean anything with respect to the code syntax because the default control character (aka escape character) is the "^". That generally means that if a backslash thing has any meaning, it's probably provided by the function to which you are passing it as opposed to a low-level function like format(). You can look at the documentation for client_print_color() for how colors are actually done using the control character.

"\n" and "\r" are the new line and carriage return non-printable characters, respectively (that is assuming that the control character is the backslash which is default in languages like C and C++). In AMX Mod X plugins, you would need to use "^n" and "^r" to have them actually act like the new line and carriage return characters. There is a whole bunch of info about what these mean on the internet.


All times are GMT -4. The time now is 11:35.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.