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

Solved print_color problem Oo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-02-2020 , 18:11   print_color problem Oo
Reply With Quote #1

Hello guys,

I editing bb mod but i got something is stranger, i know some codes have transformed from zombie plague but i checked zp mod and i saw the same print color codes

My problem is: When i creat a new chat and add color, the colors didn't shows but it's only showing spaces betwen the words. But if i added modname of bb mod the colors be working can some one tell me what is the hell is this ?

Example:
Without MODNAME, Show Only Spaces:
PHP Code:
print_color(0"[ADMIN] ^x03%s ^1take ^x04%d ^1Ammo Packs from ^x03%s"szAdminNameiAmmoszPlayerName
With MODNAME, Working:
PHP Code:
print_color(0"%s [ADMIN] ^x03%s ^x01gave ^x04%d ^x01Ammo Packs to ^x03%s"MODNAMEszAdminNameiAmmoszPlayerName
//print color chat
PHP Code:
print_color(target, const message[], any:...)
{
    static 
buffer[512], iargscount
    argscount 
numargs()
    
    
// Send to everyone
    
if (!target)
    {
        static 
player
        
for (player 1player <= g_iMaxPlayersplayer++)
        {
            
// Not connected
            
if (!g_isConnected[player])
                continue;
            
            
// Remember changed arguments
            
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
            
changedcount 0
            
            
// Replace LANG_PLAYER with player id
            
for (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
            
// Format message for player
            
vformat(buffercharsmax(buffer), message3)
            
            
// Send it
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            
// Replace back player id's with LANG_PLAYER
            
for (0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    
// Send to specific target
    
else
    {
        
// Format message for player
        
vformat(buffercharsmax(buffer), message3)
        
        
// Send it
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }


Last edited by Supremache; 07-02-2020 at 19:37.
Supremache is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-02-2020 , 19:22   Re: print_color problem Oo
Reply With Quote #2

You need to begin your text with a color, idk why, but that's how it works.

PHP Code:
print_color(0"^x01%s [ADMIN] ^x03%s ^x01gave ^x04%d ^x01Ammo Packs to ^x03%s"MODNAMEszAdminNameiAmmoszPlayerName
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 07-02-2020 at 19:22.
Shadows Adi is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-02-2020 , 19:37   Re: print_color problem Oo
Reply With Quote #3

Quote:
Originally Posted by Shadows Adi View Post
You need to begin your text with a color, idk why, but that's how it works.

PHP Code:
print_color(0"^x01%s [ADMIN] ^x03%s ^x01gave ^x04%d ^x01Ammo Packs to ^x03%s"MODNAMEszAdminNameiAmmoszPlayerName
Oh, Okey thanks for help
Supremache 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 15:04.


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