Raised This Month: $ Target: $400
 0% 

[Any] "[SM]" Prefix changer! UPDATE: March 22, 2013


Post New Thread Reply   
 
Thread Tools Display Modes
Mitchell
~lick~
Join Date: Mar 2010
Old 03-22-2013 , 22:43   Re: [Any] "[SM]" Prefix changer! UPDATE: June 16, 2012
Reply With Quote #31

Quote:
Originally Posted by abrandnewday View Post
Ok, so I looked into this. Here's the timer_strip function:

PHP Code:
public Action:timer_strip(Handle:timerHandle:pack)
{
    new 
playersNum ReadPackCell(pack);
    new 
players[playersNum];

    for(new 
0playersNumi++)
    {
        
players[i] = ReadPackCell(pack);
    }
    new 
String:buffer[255];
    
ReadPackString(packbuffersizeof(buffer));
    new 
String:QuickFormat[255];
    new 
ColorChoose 0;
    if(
UseRandomColors == 1ColorChoose GetRandomInt(0CountColors);
    
Format(QuickFormatsizeof(QuickFormat), "%s"TextColors[ColorChoose]);
    
ReplaceStringEx(buffersizeof(buffer), "[SM]"QuickFormat);
    
    new 
Handle:bf StartMessage("SayText2"playersplayersNumUSERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
    
//BfWriteString(bf, buffer);
    
BfWriteByte(bf, -1);
    
BfWriteByte(bftrue);
    
BfWriteString(bfbuffer);
    
EndMessage();

The line in question that is causing the error is this one:
PHP Code:
new Handle:bf StartMessage("SayText2"playersplayersNumUSERMSG_RELIABLE|USERMSG_BLOCKHOOKS); 
With that being said, I tried my hand at fixing this. Try the version I've attached, let me know if there's any more errors.

Here's how I attempted to fix this:

PHP Code:
public Action:timer_strip(Handle:timerHandle:pack)
{
    new 
playersNum ReadPackCell(pack);
    new 
players[playersNum];

    for(new 
0playersNumi++)
    {
        
players[i] = ReadPackCell(pack);
    }
    new 
String:buffer[255];
    
ReadPackString(packbuffersizeof(buffer));
    new 
String:QuickFormat[255];
    new 
ColorChoose 0;
    if(
UseRandomColors == 1ColorChoose GetRandomInt(0CountColors);
    
Format(QuickFormatsizeof(QuickFormat), "%s"TextColors[ColorChoose]);
    
ReplaceStringEx(buffersizeof(buffer), "[SM]"QuickFormat);
    
    
// Here's the new check
    
for(new 0playersNumi++)
    {
        if(
IsClientInGame(i))
        {
            new 
Handle:bf StartMessage("SayText2"playersplayersNumUSERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
            
//BfWriteString(bf, buffer);
            
BfWriteByte(bf, -1);
            
BfWriteByte(bftrue);
            
BfWriteString(bfbuffer);
            
EndMessage();
        }
    }

That wont fix anything, that will actually do it worse, like print the message as many as how many people are connected.
Mitchell is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-22-2013 , 22:59   Re: [Any] "[SM]" Prefix changer! UPDATE: June 16, 2012
Reply With Quote #32

Quote:
Originally Posted by Mitchell View Post
That wont fix anything, that will actually do it worse, like print the message as many as how many people are connected.
Lol, oh boy. Nobody use the version I posted!

EDIT: I see you added a "fixed" version. There's just one problem. It won't compile.

Here's what's tripping out:

PHP Code:
public Action:timer_strip(Handle:timerHandle:pack)
{
    new 
playersNum ReadPackCell(pack);
    new 
players[playersNum];

    for(new 
0playersNumi++)
    {
        
players[i] = ReadPackCell(pack);
        if(!( 
<= client <= MaxClients ) || !IsClientInGame(players[i]))
        {
            
i--;
            
playersNum--;
        }
    }
    new 
String:buffer[255];
    
ReadPackString(packbuffersizeof(buffer));
    new 
String:QuickFormat[255];
    new 
ColorChoose 0;
    if(
UseRandomColors == 1ColorChoose GetRandomInt(0CountColors);
    
Format(QuickFormatsizeof(QuickFormat), "%s"TextColors[ColorChoose]);
    
ReplaceStringEx(buffersizeof(buffer), "[SM]"QuickFormat);
    
    new 
Handle:bf StartMessage("SayText2"playersplayersNumUSERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
    
//BfWriteString(bf, buffer);
    
BfWriteByte(bf, -1);
    
BfWriteByte(bftrue);
    
BfWriteString(bfbuffer);
    
EndMessage();

Specifically:

PHP Code:
if(!( <= client <= MaxClients ) || !IsClientInGame(players[i])) 
Error in question is "undefined symbol: client"

Last edited by 404UserNotFound; 03-22-2013 at 23:03.
404UserNotFound is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-23-2013 , 04:57   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #33

Spoiler
Bacardi is offline
island55
Senior Member
Join Date: Aug 2010
Location: charleston
Old 03-23-2013 , 13:04   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #34

it doesn't compile anymore on the original post
island55 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-23-2013 , 14:14   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #35

Quote:
Originally Posted by island55 View Post
it doesn't compile anymore on the original post
use web compiler
Bacardi is offline
maxolahird
Veteran Member
Join Date: Dec 2012
Old 12-12-2013 , 13:19   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #36

How to make {default} tag in hex? or can i use \x01?
maxolahird is offline
MafiaBoss
AlliedModders Donor
Join Date: Aug 2013
Old 12-13-2013 , 04:38   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #37

Can someone tell me the config for white text?
MafiaBoss is offline
maxolahird
Veteran Member
Join Date: Dec 2012
Old 12-13-2013 , 14:30   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #38

Quote:
Originally Posted by MafiaBoss View Post
Can someone tell me the config for white text?
That's pretty easy.... &FFFFFF
maxolahird is offline
MafiaBoss
AlliedModders Donor
Join Date: Aug 2013
Old 12-13-2013 , 19:22   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #39

Quote:
Originally Posted by maxolahird View Post
That's pretty easy.... &FFFFFF
Well, I don't know hex.... So yea... Thx. What do I type into the config? Just &FFFFFF or *AAAAAAAA[*FFFFFFAASM*AAAAAAAA]&FFFFFF ?

EDIT : Can I have the hex for black instead? Thx!

Last edited by MafiaBoss; 12-13-2013 at 20:19.
MafiaBoss is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 12-14-2013 , 14:02   Re: [Any] "[SM]" Prefix changer! UPDATE: March 22, 2013
Reply With Quote #40

Black is 000000
__________________
Dr. McKay 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 17:22.


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