AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ZPA] Comma in the health something ??? (https://forums.alliedmods.net/showthread.php?t=267049)

Destructorbg 07-22-2015 16:26

[ZPA] Comma in the health something ???
 
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 :grrr:

HamletEagle 07-23-2015 07:27

Re: [ZPA] Comma in the health something ???
 
Search, I saw some weeks ago the same request.

Destructorbg 07-23-2015 16:49

Re: [ZPA] Comma in the health something ???
 
yes, and i saw it but it work, can you give me working code ?

zmd94 07-24-2015 10:29

Re: [ZPA] Comma in the health something ???
 
https://forums.alliedmods.net/showpo...45&postcount=5

Destructorbg 07-25-2015 08:28

Re: [ZPA] Comma in the health something ???
 
The code gave this error - http://imageshack.com/a/img540/7183/jrxYWO.jpg

zmd94 07-25-2015 08:41

Re: [ZPA] Comma in the health something ???
 
Just show what have you done?

Destructorbg 07-25-2015 09:59

Re: [ZPA] Comma in the health something ???
 
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

zmd94 07-25-2015 21:43

Re: [ZPA] Comma in the health something ???
 
I can compile the code without any problems.

Destructorbg 07-26-2015 09:58

Re: [ZPA] Comma in the health something ???
 
what is your amxmodx version ?

zmd94 07-26-2015 10:08

Re: [ZPA] Comma in the health something ???
 
AMX Mod X 1.8.2 version.


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

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