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

Request : Center HUD Text as welcome message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jeremy0118
Member
Join Date: May 2013
Old 05-14-2013 , 03:38   Request : Center HUD Text as welcome message
Reply With Quote #1

Hi!

My friend sended a plugin that shows 3 Colored HUD lines in when the map starts. It looks like this : http://puu.sh/2Te2S.jpg

Its for the game Alien Swarm that does support hud ( sourcebased game )

Now i would like to make people see a message with a big colored "WELCOME {NAME}" in the center of the screen, as soon as a player joins the server.

Anyone who can help me? is it a simple edit in the smx or? 10$ who helps me, paypal required

.smx looks like :

PHP Code:
#pragma semicolon 1
#include <sourcemod>
 
//#define MAX_PLAYERS 8
#define NUMBER_OF_MESSAGES 3
 
new Handle:hHudText INVALID_HANDLE;
 
new 
number_of_color_schemes;
new 
SchemeColor[3*NUMBER_OF_MESSAGES];
 
new 
String:message1[128];
new 
String:message2[128];
new 
String:message3[128];
 
new 
String:lineBuf[128];
 
public 
Plugin:myinfo = {
        
name "Asbi Announcer",
        
author "Mad Orange",
        
description "Asbi difficulty announcer+",
        
version "0.2",
        
url "n/a"
};
 
public 
OnPluginStart()
{
        
HookEvent("marine_selected"MarineSelected);
 
        
decl String:path[PLATFORM_MAX_PATH];
        
BuildPath(Path_SMpathsizeof(path), "configs/asbi_announce.cfg");
        new 
Handle:file OpenFile(path"r");
        if (
file == INVALID_HANDLE)
        {
                
PrintToServer("asbi_announce.cfg is missing!");
                return;
        }
 
        
ReadFileLine(filemessage1sizeof(message1));
        
ReadFileLine(filemessage2sizeof(message2));
        
ReadFileLine(filemessage3sizeof(message3));
 
        
ReadFileLine(filelineBufsizeof(lineBuf)); //first empty line
       
        
ReadFileLine(filelineBufsizeof(lineBuf));
        
number_of_color_schemes StringToInt(lineBuf);
 
        
ReadFileLine(filelineBufsizeof(lineBuf)); //second empty line
 
//chosing random position of color scheme
        
new offset GetRandomInt(0number_of_color_schemes-1)*4-1;
//      PrintToChatAll("%d", offset);
        
for(new i=0i<offseti++)
        {
                
ReadFileLine(filelineBufsizeof(lineBuf));
        }      
       
 
///Getting NUMBER_OF_MESSAGES number lines in string array
        
decl String:SchemeColorStrings[3*NUMBER_OF_MESSAGES][4]; //red1, green1, blue1, red2, green2, blue2, red3, green3, blue3 etc
        
new j=0;
        for(new 
ColSchemeLinesCounter=0ColSchemeLinesCounter<NUMBER_OF_MESSAGESColSchemeLinesCounter++)
        {
                
ReadFileLine(filelineBufsizeof(lineBuf));
               
                new 
LinePartCounter=0;
                for (new 
i=0lineBuf[i] != '\n'lineBuf[i+1] != '\0'i++)
                {
                        if (
lineBuf[i] == ' ')
                        {
                                
SchemeColorStrings[j][LinePartCounter] = '\0';
                                
j++;
                                
LinePartCounter 0;
                        }
                        else
                        {
                                
SchemeColorStrings[j][LinePartCounter] = lineBuf[i];
                                
LinePartCounter++;     
                        }
 
                }
 
                
SchemeColorStrings[j][LinePartCounter] = '\0';
                
j++;
        }
//String array->usial array    
        
for(new i=0i<3*NUMBER_OF_MESSAGESi++)
        {
                
SchemeColor[i] = StringToInt(SchemeColorStrings[i]);
        }
 
        
CloseHandle(file);
 
}
 
public 
Action:MarineSelected(Handle:event, const String:name[], bool:dontBroadcast)
{
        new 
client GetClientOfUserId(GetEventInt(event"userid"));
       
//timers to show messages after some delay
        
CreateTimer(1.5PrintMsg1client);
        
CreateTimer(3.0PrintMsg2client);
        
CreateTimer(4.5PrintMsg3client);
        
CreateTimer(10.0HandleCloseFuncclient);
 
        return 
Plugin_Handled;
}
 
public 
Action:PrintMsg1(Handle:timerany:client)
{
        
hHudText CreateHudSynchronizer();
        
SetHudTextParams(-1.00.765.0SchemeColor[0], SchemeColor[1], SchemeColor[2], 25512.00.50.5);
        
ShowSyncHudText(clienthHudTextmessage1);
        return 
Plugin_Continue;
}
 
public 
Action:PrintMsg2(Handle:timerany:client)
{
        
hHudText CreateHudSynchronizer();
        
SetHudTextParams(-1.00.805.0SchemeColor[3], SchemeColor[4], SchemeColor[5], 25512.00.50.5);
        
ShowSyncHudText(clienthHudTextmessage2);
        return 
Plugin_Continue;
}
 
public 
Action:PrintMsg3(Handle:timerany:client)
{
        
hHudText CreateHudSynchronizer();
        
SetHudTextParams(-1.00.845.0SchemeColor[6], SchemeColor[7], SchemeColor[8], 25512.00.50.5);
        
ShowSyncHudText(clienthHudTextmessage3);
        return 
Plugin_Continue;
}
 
public 
Action:HandleCloseFunc(Handle:timerany:client)
{
        
CloseHandle(hHudText);
        return 
Plugin_Continue;


Last edited by jeremy0118; 05-14-2013 at 12:19.
jeremy0118 is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 05-14-2013 , 13:16   Re: Request : Center HUD Text as welcome message
Reply With Quote #2

Hi, please do not create a duplicate topic an hour later because you received no responses.
This thread: Yesterday , 11:06 PM Request : Center HUD Text as welcome message
Last thread: Yesterday , 12:38 AM Request : Center HUD Text as welcome message

Last edited by Sreaper; 05-14-2013 at 13:27.
Sreaper is offline
jeremy0118
Member
Join Date: May 2013
Old 05-14-2013 , 13:23   Re: Request : Center HUD Text as welcome message
Reply With Quote #3

everyone my apologies for making 2 topics, wasnt meant to! im new and acctidently made a new topic, after my first one failed. now i dont know how to delete it.

Last edited by jeremy0118; 05-14-2013 at 13:39.
jeremy0118 is offline
Helvetica
Senior Member
Join Date: Nov 2011
Location: U.S.
Old 05-14-2013 , 13:24   Re: Request : Center HUD Text as welcome message
Reply With Quote #4

If you still need help and haven't received any replies in two weeks, bump your original topic.

Last edited by Helvetica; 05-14-2013 at 13:28.
Helvetica is offline
jeremy0118
Member
Join Date: May 2013
Old 05-14-2013 , 13:25   Re: Request : Center HUD Text as welcome message
Reply With Quote #5

what you mean?

Last edited by jeremy0118; 05-14-2013 at 13:42.
jeremy0118 is offline
1up
New Member
Join Date: May 2013
Old 05-15-2013 , 02:52   Re: Request : Center HUD Text as welcome message
Reply With Quote #6

Means, post a reply in your own topic so that it will be bumped to the top of the forum topic list. Bumpity!
1up is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-15-2013 , 03:32   Re: Request : Center HUD Text as welcome message
Reply With Quote #7

Isnt it just synch hud text?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 05-15-2013 , 08:35   Re: Request : Center HUD Text as welcome message
Reply With Quote #8

Quote:
Originally Posted by Helvetica View Post
If you still need help and haven't received any replies in two weeks, bump your original topic.
Quote:
Originally Posted by http://forums.alliedmods.net/misc.php?do=showrules
Do not "bump" your threads. Bumping is posting simply to make the thread higher in the forum sort order.
bl4nk 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 20:14.


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