AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need simple print help! (https://forums.alliedmods.net/showthread.php?t=40353)

ZerroQ 06-26-2006 12:30

Need simple print help!
 
Greetings you all!
I really like the script Allow round finish! (made by: EKS)
But i've got an idea and it doesn't really go throught with my knowledges in thoose kind of scriptings.
(: So the point is: At the end of the finished round, starts the next round within changes the map to (nextmap).. when the last round is finished usually server opens the scores list and changes the map! I want at the same time print an text in the middle of screen. For example you can imagine, the printed text "Counter-Terorist win!"
Here's the code i believe in which i have to add that text:
Code:

public Event_EndRound()
{
        if(g_IsLastRound == 1)
        {
                client_print(0,print_chat,"The last round has ended!")
                client_print(0,print_center,"We appreciate your playing please wait untill the map changes!")
                set_task(5.0,"Task_DelayMapEnd",TASK_ID_DELAYMAPCHANGE,_,_,"a",1) // We delay the end of the map with a few sec, so the last guys death is viewable
        }
}
public server_changelevel(map[])
{
        if(g_IsLastRound == 1)
                Task_DelayMapEnd()
}
public Task_DelayMapEnd()
{
        remove_task(TASK_ID_DELAYMAPCHANGE)
        g_IsLastRound = 0
        if(get_cvar_num("mp_timelimit") == 0)
                server_cmd("mp_timelimit %d",g_OldTimelimit)
}

The line in red is what i have added to the script! Any suggestions, comments ?
Is it possible to change the color of the centered text ? ( IM ingame )

BetaX 06-26-2006 20:40

Re: Need simple print help!
 
Quote:

Originally Posted by ZerroQ
The line in red is what i have added to the script! Any suggestions, comments ?
Is it possible to change the color of the centered text ? ( IM ingame )

Honestly, I'd use a hudmessage. They're pretty n' such. >_>

http://amxmodx.org/funcwiki.php?go=func&id=28

But if you wanted to change the color of text...
Code:

    // This is from Damaged Soul's post a while back...
    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
    write_byte(id)
    write_string("^x03Team colored text ^x01Normal color")
    message_end()

Yeeea... You can only use Red, Green, White, though.

Tis' built into the game engine.

Sooo maybe...

Code:

      message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},0);
      write_byte(0)
      write_string(string[])
      message_end()

Would setting the id as 0 send it to everyone? I'm not very experienced with messages, honestly. :S

ZerroQ 06-28-2006 11:27

Re: Need simple print help!
 
I resolved this question by myself :)
Here's the code to print text in front of the crosshair ( in the middle of screen )
Code:

engclient_print(0,engprint_center, "Thank you for playing!^nLoading next map...")

Hawk552 06-30-2006 13:18

Re: Need simple print help!
 
Quote:

Originally Posted by ZerroQ
I resolved this question by myself :)
Here's the code to print text in front of the crosshair ( in the middle of screen )
Code:

engclient_print(0,engprint_center, "Thank you for playing!^nLoading next map...")

You can just use client_print(0,print_center... but whatever.

Code:
       message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},0);        write_byte(0)        write_string(string[])        message_end()

No, use MSG_BROADCAST rather than MSG_ONE.


All times are GMT -4. The time now is 08:03.

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