AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Display MOTD at end of map (https://forums.alliedmods.net/showthread.php?t=210650)

Blizzard_87 03-13-2013 06:13

Display MOTD at end of map
 
i want to display a motd at the end of a map during the mp_chattime..

to display whatever...

which forward do i need to hook ?

Kard1nal 03-13-2013 06:16

Re: Display MOTD at end of map
 
register_event("30", "eMapChange", "a")

Blizzard_87 03-13-2013 06:44

Re: Display MOTD at end of map
 
Quote:

Originally Posted by Kard1nal (Post 1911803)
register_event("30", "eMapChange", "a")

doesnt work.

Kard1nal 03-13-2013 06:48

Re: Display MOTD at end of map
 
Post your code.

Blizzard_87 03-13-2013 06:52

Re: Display MOTD at end of map
 
PHP Code:

public eMapChange()
{
    new 
sBuffer[MAX_BUFF_LEN], iLenszName[32], szMapName[32];

    new 
iMaxPlayers get_maxplayers( );
    new 
iFragsiPlayeriCurTop = -999;

    for( new 
1<= iMaxPlayersi++ )
    {
        if( 
is_user_connected) )
        {
            
iFrags RoundKills[i];
            if( 
iFrags iCurTop )
            {
                
iPlayer i,
                
iCurTop iFrags;
            }
        }
    } 
// iPlayer is 'leading' with iCurTop frags.    
    
    
get_user_name(iPlayerszName31)
    
get_mapname(szMapName31);
    
    
iLen formatex(sBuffercharsmax(sBuffer), "<html><body bgcolor='black' text='white'>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<center>")
    
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br><br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<font size='6'><b>%s</b></font>"szMapName)
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"<br>")
    

    
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen"</center>")
    
    
    
show_motd(0sBuffer"Map Winner!")
    
    return 
PLUGIN_HANDLED


this doesnt get called at end of map... just the scoreboard

hornet 03-13-2013 07:04

Re: Display MOTD at end of map
 
Intermission is called when the map timer runs out, not when the map is changed by an admin.

Blizzard_87 03-13-2013 07:18

Re: Display MOTD at end of map
 
Quote:

Originally Posted by hornet (Post 1911821)
Intermission is called when the map timer runs out, not when the map is changed by an admin.

so how do i disable the scoreboard and show my motd? during chattime?

hornet 03-13-2013 07:36

Re: Display MOTD at end of map
 
Like this:

Code:
public eMapChange() {     message_begin( MSG_ALL, SVC_FINALE );     write_string( "" );     message_end();             show_motd( 0, "some text", "some title" ); }

EDIT: I'm not exactly sure if there's a way to hook admin map change simply ... Still trying.

Blizzard_87 03-13-2013 07:43

Re: Display MOTD at end of map
 
Quote:

Originally Posted by hornet (Post 1911831)
Like this:

Code:
public eMapChange() {     message_begin( MSG_ALL, SVC_FINALE );     write_string( "" );     message_end();             show_motd( 0, "some text", "some title" ); }

EDIT: I'm not exactly sure if there's a way to hook admin map change simply ... Still trying.

thanks! seems to be working fine :P

EDIT: its all good... just want it to show at normal end map event.

meTaLiCroSS 03-13-2013 22:18

Re: Display MOTD at end of map
 
Quote:

Originally Posted by hornet (Post 1911831)
Like this:

Code:
public eMapChange() {     message_begin( MSG_ALL, SVC_FINALE );     write_string( "" );     message_end();             show_motd( 0, "some text", "some title" ); }

EDIT: I'm not exactly sure if there's a way to hook admin map change simply ... Still trying.

What does exactly the sending of the SVC_FINALE message?


All times are GMT -4. The time now is 21:44.

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