View Single Post
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-20-2014 , 07:53   Re: [TF2] game_text_tf advertisements
Reply With Quote #20

Quote:
Originally Posted by ddhoward View Post
Ahhh, I'm assuming from your code that AcceptEntityInput(entity, "Display") would cause the same entity to display the message a second time. That's good to know.



This does not qualify as constructive feedback, and is rather rude.


PHP Code:
 switch(color
        { 
            case 
2DispatchKeyValue(entity"background""3"); //also i think you did this one wrong lol
            
case 3DispatchKeyValue(entity"background""3"); 
            default: 
DispatchKeyValue(entity"background""3"); 
        } 
I wrote this on a phone, you should be sending the usermessage anyway, not spawning the entity.

This should do:
PHP Code:
CreateTFHNmessage(const String:message[], const String:icon[]="leaderboard_streak"team 0color 0)
{
    static 
UserMsg:HudNotifyCustom INVALID_MESSAGE_ID;
    if(
HudNotifyCustom == INVALID_MESSAGE_ID)
    {
        
HudNotifyCustom GetUserMessageId("HudNotifyCustom");
    }

    
decl targets[MaxClients];
    new 
count;
    for(new 
i=1i<=MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            if(
team)
            {
                if(
GetClientTeam(i) != team)
                {
                    continue;
                }
            }
            
targets[count] = i;
            
count++;
        }
    }
    
    if(
count)
    {
        new 
Handle:bf StartMessageEx(HudNotifyCustomtargetscount);
        
BfWriteString(bfmessage);
        
BfWriteString(bficon);
        
BfWriteByte(bfcolor);

        
EndMessage();
    }

__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 10-20-2014 at 15:48.
friagram is offline