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

[Any] Round Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author
joac1144
Senior Member
Join Date: Dec 2012
Location: Copenhagen, Denmark
Plugin ID:
4086
Plugin Version:
1.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Simple plugin that prints something to chat when a round begins or ends.
    Old 02-07-2014 , 15:29   [Any] Round Messages
    Reply With Quote #1

    Description:
    This is just a simple plugin that prints a message to all players every time a round starts or ends.


    CVAR list:
    eventmsg_startmessage "{lightgreen}The round is about to {green}start" //message to send when a round is about to start.
    eventmsg_endmessage "{lightgreen}The round has {green}ended" //message to send when a round ends.
    eventmsg_version //Plugin version.

    In order to compile the plugin yourself, you need morecolors.inc
    You can find all the available colors here.
    If you don't want to use any colors, remove the color tags in the CFG file.

    Command list:
    No commands.


    Changelog:
    Quote:
    2-7-2014 (v1.0)

    *Plugin released

    2-8-2014 (v1.1)

    *Morecolors isn't required
    Installation:
    Click 'Get Plugin', download the .smx file and put it into sourcemod/plugins/ folder.


    -This is my third plugin ever-
    Attached Files
    File Type: sp Get Plugin or Get Source (EventMessage.sp - 647 views - 1.4 KB)
    File Type: smx EventMessage.smx (9.5 KB, 509 views)
    __________________

    Last edited by joac1144; 02-16-2014 at 13:13. Reason: Update.
    joac1144 is offline
    ClassicGuzzi
    Veteran Member
    Join Date: Oct 2013
    Location: Argentina
    Old 02-08-2014 , 02:04   Re: [Any] Round Messages
    Reply With Quote #2

    i don't see the plugin :/
    ClassicGuzzi is offline
    joac1144
    Senior Member
    Join Date: Dec 2012
    Location: Copenhagen, Denmark
    Old 02-08-2014 , 05:27   Re: [Any] Round Messages
    Reply With Quote #3

    Quote:
    Originally Posted by ClassicGuzzi View Post
    i don't see the plugin :/
    I forgot to attach the file..
    Thanks for reminding me
    __________________

    Last edited by joac1144; 02-08-2014 at 05:27.
    joac1144 is offline
    joac1144
    Senior Member
    Join Date: Dec 2012
    Location: Copenhagen, Denmark
    Old 02-08-2014 , 08:34   Re: [Any] Round Messages
    Reply With Quote #4

    Plugin updated.
    Morecolors is now optional and not required.
    __________________
    joac1144 is offline
    ClassicGuzzi
    Veteran Member
    Join Date: Oct 2013
    Location: Argentina
    Old 02-08-2014 , 11:15   Re: [Any] Round Messages
    Reply With Quote #5

    Quote:
    Originally Posted by joac1144 View Post
    Plugin updated.
    Morecolors is now optional and not required.
    This isn't important, CPrintToChatAll and PrintToChatAll are the same if i don't use color tags like {yellow}. So, if don't want colors, i wont use color tags.

    Things you could add:
    • A version variable (if you are going to add more stuff)
    • Hint message and Center message
    • File with multiple phases that are piked randomly

    Just some ideas
    ClassicGuzzi is offline
    joac1144
    Senior Member
    Join Date: Dec 2012
    Location: Copenhagen, Denmark
    Old 02-08-2014 , 13:33   Re: [Any] Round Messages
    Reply With Quote #6

    Quote:
    Originally Posted by ClassicGuzzi View Post

    Things you could add:
    • A version variable (if you are going to add more stuff)
    Added.


    Quote:
    Originally Posted by ClassicGuzzi
    Hint message and Center message
    Do you mean that it should print the message as a Center/Hint message or that you can choose how it should print the message from the CFG file?


    Quote:
    Originally Posted by ClassicGuzzi
    File with multiple phases that are piked randomly
    I have no idea how to do this.


    Thanks for feedback
    __________________

    Last edited by joac1144; 02-08-2014 at 13:34.
    joac1144 is offline
    Mr.Freeman
    Senior Member
    Join Date: Nov 2013
    Location: Canada
    Old 02-08-2014 , 13:41   Re: [Any] Round Messages
    Reply With Quote #7

    You can use PrintHintText for hint text and use a random interval for what ClassicGuzzi requested
    Mr.Freeman is offline
    Js41637
    Member
    Join Date: May 2013
    Location: Australia, NSW
    Old 02-08-2014 , 20:02   Re: [Any] Round Messages
    Reply With Quote #8

    You can't compile the plugin because it requires morecolors.

    I think you can use #tryinclude or something instead of #include so that it isn't required but optional.

    Also, is there even any color tags in the code? You have;
    PHP Code:
    if (GetConVarInt(eventmsg_morecolors_enabled) == 1)
        {
            new 
    String:msg[128];
            
    GetConVarString(eventmsg_endmessagemsgsizeof(msg));
        
            
    CPrintToChatAll("%s"msg);
        }
        else
        {
            new 
    String:msg[128];
            
    GetConVarString(eventmsg_endmessagemsgsizeof(msg));
            
            
    PrintToChatAll("%s"msg);
        } 
    Which is just switching between PrintToChatAll and CPrintToChatAll however you have included no color tags. Something like this is maybe what you want?
    PHP Code:
    CPrintToChatAll("{green}%s"msg); 

    Last edited by Js41637; 02-08-2014 at 20:09.
    Js41637 is offline
    Send a message via Skype™ to Js41637
    joac1144
    Senior Member
    Join Date: Dec 2012
    Location: Copenhagen, Denmark
    Old 02-09-2014 , 04:25   Re: [Any] Round Messages
    Reply With Quote #9

    Quote:
    Originally Posted by Js41637 View Post
    You can't compile the plugin because it requires morecolors.

    I think you can use #tryinclude or something instead of #include so that it isn't required but optional.

    Also, is there even any color tags in the code? You have;
    PHP Code:
    if (GetConVarInt(eventmsg_morecolors_enabled) == 1)
        {
            new 
    String:msg[128];
            
    GetConVarString(eventmsg_endmessagemsgsizeof(msg));
        
            
    CPrintToChatAll("%s"msg);
        }
        else
        {
            new 
    String:msg[128];
            
    GetConVarString(eventmsg_endmessagemsgsizeof(msg));
            
            
    PrintToChatAll("%s"msg);
        } 
    Which is just switching between PrintToChatAll and CPrintToChatAll however you have included no color tags. Something like this is maybe what you want?
    PHP Code:
    CPrintToChatAll("{green}%s"msg); 
    If you want to use colors in the messages, you can do it in the CFG file (cfg/sourcemod/) that is autogenerated after first time the plugin is loaded.
    Eg: eventmsg_startmessage "{lightgreen}The round is about to {green}start"
    __________________

    Last edited by joac1144; 02-09-2014 at 04:30.
    joac1144 is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 02-09-2014 , 04:35   Re: [Any] Round Messages
    Reply With Quote #10

    You cannot make morecolors optional like that. Even with the cvar to use/not use it, there are still morecolors functions in your code. The compiler will refuse to compile the plugin if morecolors.inc is not present in the includes folder.

    Further, an option to use PrintToChatAll vs CPrintToChatAll is made even more pointless when you realize that the server does not need morecolors.inc to run the plugin. Include files like that are only needed by THE COMPILER. Once it's compiled, the include is done. Any server with a reasonably up-to-date version of Sourcemod can run that smx without needing anything extra.

    I recommend that you remove the cvar, and always use CPrintToChatAll.
    __________________

    Last edited by ddhoward; 02-09-2014 at 04:47.
    ddhoward 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 05:06.


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