How to add a comma to a HUD message?
Hello. Can someone explain to me how to add a comma to the HUD Info message for health?
Here is an example of a HUD message: Health: 5000 | Class: Zombie | Ammo: 30 | Armor: 0 Here is how the HUD message should look like: Health: 5,000 | Class: Zombie | Ammo: 30 | Armor: 0 As you can see, the second HUD message has a comma where the stats of Health is – it’s “5,000”, instead of “5000”. So, can someone explain to me how to add a comma? I added the following code at the end of the source code of ZP: PHP Code:
Then, I added this to the code responsible for showing the HUD Info message: PHP Code:
PHP Code:
Maybe, I’m doing it the wrong way, or the codes are wrong? The second code is about adding a point, not a comma. I prefer my HUD to have a comma, instead of a point, but if no one knows how to add exactly a comma, I will be ok with adding a point. Thanks. |
Re: How to add a comma to a HUD message?
|
Re: How to add a comma to a HUD message?
The AddCommas() function by Bugsy which you have in your post works exactly as expected so you are using it wrong. Also, there is no reason to change anything in the function.
So, go back to using the AddCommas() function (I recommend taking it directly from the thread mentioned by Supremache). Then, create a temporary string to hold the resulting string and replace the %d in the format string in show_hudmessage() with %s and replace the value being used in that position to this new temporary string. Like this: Code:
show_hudmessage(id, "Health: %d | Class: %s | Ammo: %d | Armor: %d", iHealth, szClassName, iAmmo, iArmor);Code:
new szHealth[15]; |
| All times are GMT -4. The time now is 11:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.