Raised This Month: $12 Target: $400
 3% 

Solved String formatting


Post New Thread Reply   
 
Thread Tools Display Modes
thEsp
BANNED
Join Date: Aug 2017
Old 04-12-2019 , 12:38   Re: String formatting
Reply With Quote #11

lol, you said that it is being displayed simply as it is "^n", and I told you that there's no way to remove or replace it.
thEsp is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-12-2019 , 12:54   Re: String formatting
Reply With Quote #12

Quote:
Originally Posted by thEsp View Post
lol, you said that it is being displayed simply as it is "^n", and I told you that there's no way to remove or replace it.
Have you heard of replace()? You can use it to replace ^n with blank, so it's possible to remove/replace it from a text.

My point was not in replacing ^n with something, it was that ^n was un-functional (wasn't breaking lines).
__________________
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-12-2019 , 14:58   Re: String formatting
Reply With Quote #13

can you post the solution ??


here is my solution, depends on a special syntax...
and using replace function..

Code:
"Player Name: #%PlayerName | Player Cash: #%PlayerCash"
PHP Code:

    
new szString[128];
    
copy(szStringcharsmax(szString), g_eHudsMAIN_HUD ]);
    
replace_all(szStringcharsmax(szString), "#%PlayerName"szName);
    
replace_all(szStringcharsmax(szString), "#%PlayerCash"szUserCash);
    
ShowSyncHudMsgidg_iSyncHudszString ); 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-12-2019 at 16:33.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-12-2019 , 16:36   Re: String formatting
Reply With Quote #14

Quote:
Originally Posted by Natsheh View Post
can you post the solution ??


here is my solution, depends on a special syntax...
and using replace function..

Code:
"Player Name: #%PlayerName | Player Cash: #%PlayerCash"
PHP Code:

    
new szString[128];
    
copy(szStringcharsmax(szString), g_eHudsMAIN_HUD ]);
    
replace_all(szStringcharsmax(szString), "#%PlayerName"szName);
    
replace_all(szStringcharsmax(szString), "#%PlayerCash"szUserCash);
    
ShowSyncHudMsgidg_iSyncHudszString ); 
I did what Exolent and fysiks said
PHP Code:
            new szInfo256 ];
            
formatexszInfocharsmaxszInfo ), g_eHudsZOMBIE_MAIN_HUD ], szNameiHealthszZombieClassszLevelg_iPlayerXPid ], iLevel == g_iMaxLevels ArrayGetCellg_aRankXPg_iPlayerLevelid ] ) : ArrayGetCellg_aRankXP, ( g_iPlayerLevelid ] + ) ), szRankg_iPlayerPointsid ] );
            
            
replace_allszInfocharsmaxszInfo ), "^^n""^n" ); 
__________________

Last edited by edon1337; 04-12-2019 at 16:36.
edon1337 is offline
Reply


Thread Tools
Display Modes

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 13:58.


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