Raised This Month: $ Target: $400
 0% 

[ZPA] Comma in the health something ???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Destructorbg
Junior Member
Join Date: Jul 2015
Old 07-22-2015 , 16:26   [ZPA] Comma in the health something ???
Reply With Quote #1

Hi, i use ZPA 1.6.1 and i don't know how to add comma, example if now the health is showing: 4000 i want to showing: 4,000 how to do it ?

Please only serious posts
Destructorbg is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-23-2015 , 07:27   Re: [ZPA] Comma in the health something ???
Reply With Quote #2

Search, I saw some weeks ago the same request.
__________________
HamletEagle is offline
Destructorbg
Junior Member
Join Date: Jul 2015
Old 07-23-2015 , 16:49   Re: [ZPA] Comma in the health something ???
Reply With Quote #3

yes, and i saw it but it work, can you give me working code ?
Destructorbg is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-24-2015 , 10:29   Re: [ZPA] Comma in the health something ???
Reply With Quote #4

https://forums.alliedmods.net/showpo...45&postcount=5
zmd94 is offline
Destructorbg
Junior Member
Join Date: Jul 2015
Old 07-25-2015 , 08:28   Re: [ZPA] Comma in the health something ???
Reply With Quote #5

The code gave this error - http://imageshack.com/a/img540/7183/jrxYWO.jpg
Destructorbg is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-25-2015 , 08:41   Re: [ZPA] Comma in the health something ???
Reply With Quote #6

Just show what have you done?

Last edited by zmd94; 07-25-2015 at 08:41.
zmd94 is offline
Destructorbg
Junior Member
Join Date: Jul 2015
Old 07-25-2015 , 09:59   Re: [ZPA] Comma in the health something ???
Reply With Quote #7

I copy this code:

PHP Code:
#include <amxmodx>

new iMin = -2147483648;
new 
iMax 2147483647;

public 
plugin_init() 
{
    new 
szNum15 ];
    
    
AddCommasiMin szNum charsmaxszNum ) );
    
server_print"%d = %s" iMin szNum );
    
    
AddCommasiMax szNum charsmaxszNum ) );
    
server_print"%d = %s" iMax szNum );
}

public 
AddCommasiNum szOutput[] , iLen )
{
    new 
szTmp15 ] , iOutputPos iNumPos iNumLen;
    
    if ( 
iNum )
    {
        
szOutputiOutputPos++ ] = '-';
        
iNum absiNum );
    }
    
    
iNumLen num_to_striNum szTmp charsmaxszTmp ) );

    if ( 
iNumLen <= )
    {
        
iOutputPos += copyszOutputiOutputPos ] , iLen szTmp );
    }
    else
    {
        while ( ( 
iNumPos iNumLen ) && ( iOutputPos iLen ) ) 
        {
            
szOutputiOutputPos++ ] = szTmpiNumPos++ ];
        
            if( ( 
iNumLen iNumPos ) && !( ( iNumLen iNumPos ) % ) ) 
                
szOutputiOutputPos++ ] = ',';
        }
        
        
szOutputiOutputPos ] = EOS;
    }
    
    return 
iOutputPos;

and i created .sma file (comma.sma) after this i put the code in comma.sma and when try to compile gave this errors
Destructorbg is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-25-2015 , 21:43   Re: [ZPA] Comma in the health something ???
Reply With Quote #8

I can compile the code without any problems.
zmd94 is offline
Destructorbg
Junior Member
Join Date: Jul 2015
Old 07-26-2015 , 09:58   Re: [ZPA] Comma in the health something ???
Reply With Quote #9

what is your amxmodx version ?
Destructorbg is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-26-2015 , 10:08   Re: [ZPA] Comma in the health something ???
Reply With Quote #10

AMX Mod X 1.8.2 version.
zmd94 is offline
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 21:10.


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