Raised This Month: $32 Target: $400
 8% 

Solved Formatting Rules?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 10-08-2021 , 22:31   Formatting Rules?
Reply With Quote #1

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 ?

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

Last edited by AnimalMonster; 10-11-2021 at 10:58.
AnimalMonster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-08-2021 , 23:35   Re: Formatting Rules?
Reply With Quote #2

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.
__________________
fysiks is offline
Old 10-09-2021, 15:41
AnimalMonster
This message has been deleted by AnimalMonster. Reason: I already got the answer lol
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:39.


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