Quote:
Originally Posted by ddhoward
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 2: DispatchKeyValue(entity, "background", "3"); //also i think you did this one wrong lol case 3: DispatchKeyValue(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 = 0, color = 0)
{
static UserMsg:HudNotifyCustom = INVALID_MESSAGE_ID;
if(HudNotifyCustom == INVALID_MESSAGE_ID)
{
HudNotifyCustom = GetUserMessageId("HudNotifyCustom");
}
decl targets[MaxClients];
new count;
for(new i=1; i<=MaxClients; i++)
{
if(IsClientInGame(i))
{
if(team)
{
if(GetClientTeam(i) != team)
{
continue;
}
}
targets[count] = i;
count++;
}
}
if(count)
{
new Handle:bf = StartMessageEx(HudNotifyCustom, targets, count);
BfWriteString(bf, message);
BfWriteString(bf, icon);
BfWriteByte(bf, color);
EndMessage();
}
}
__________________