Raised This Month: $89 Target: $400
 22% 

[ANY] Weddings


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dr. O
Junior Member
Join Date: Jul 2013
Location: The House of Dr. O
Plugin ID:
3792
Plugin Version:
2.0.4
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    52 
    Plugin Description:
    Get married! Propose to other players, browse, accept and revoke proposals or get divorced again. Top couples will be chosen according to their combined score.
    Old 07-28-2013 , 05:15   [ANY] Weddings
    Reply With Quote #1

    ...WEDDINGS...


    Finally, you can get married to the people you have been playing with and start a stable relationship with them. Good luck with that!
    This is my first plugin, please report any bugs you'll find.

    Installation

    Extract the zip to your sourcemod folder. If you update to a new version, make sure you delete the file "cfg\sourcemod\weddings.cfg" so that the updated one can be created.
    By default, the sourcemod-local database will be used. To use a custom one, e.g. the same among multiple servers, define a "weddings" entry in "sourcemod\configs\databases.cfg" and set sm_weddings_database to 1.

    Commands
    • sm_marry
    Opens a menu so you can browse all connected singles on the server and propose to one by selecting.
    • sm_revoke
    Revokes a proposal you have made.
    • sm_proposals
    Opens a menu so you can browse all players who have proposed to you, selecting one will accept the proposal and you will be married. Congratz ;)
    • sm_divorce
    Ends your marriage. But why would you do that?
    • sm_couples
    Opens a menu with the top couples, i.e. those who have the highest score. Also displays the corresponding wedding dates.
    • sm_weddings_reset
    Admin command, default flag: ban. Resets database tables.


    CVars

    Code:
    // How many minutes clients must wait after successful command usage.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "30.000000"
    sm_weddings_command_delay "0"
    
    // What database to use. Change takes effect on plugin reload.
    // 0 = sourcemod-local | 1 = custom
    // If set to 1, a "weddings" entry is needed in "sourcemod\configs\databases.cfg".
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_weddings_database "0"
    
    // Whether to prevent unmarried clients from joining the server.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_weddings_disallow_unmarried "0"
    
    // Message to display to kicked clients.
    // Only applies if sm_weddings_disallow_unmarried is set to 1.
    // -
    // Default: "Unmarried clients currently not allowed"
    sm_weddings_kick_message "Unmarried clients currently not allowed"
    
    // How many couples to show in the !couples menu.
    // -
    // Default: "10"
    // Minimum: "3.000000"
    // Maximum: "100.000000"
    sm_weddings_show_couples "10"


    Natives/Forwards

    Code:
    /**
     * Retrieves the slot number of a client's partner. Use this function to check whether a client is married.
     *
     * @param client            The slot number of the client.
     * @return                    The slot number of the partner, -2 if the client is not married, -1 if the partner is not connected.
     *                            If 0 is returned, then either the client is not connected, or the marital status is still being checked.
     */
    native GetPartnerSlot(client);
    
    
    /**
     * Retrieves the name of a client's partner.
     *
     * @param client            The slot number of the client.
     * @param buffer            Destination buffer, will be empty if the client is not married.
     * @param maxLen            Destination buffer length.
     * @noreturn
     */
    native GetPartnerName(client, String:buffer[], maxLen);
    
    
    /**
     * Retrieves the steam ID of a client's partner.
     *
     * @param client            The slot number of the client.
     * @param buffer            Destination buffer, will be empty if the client is not married.
     * @param maxLen            Destination buffer length.
     * @noreturn
     */
    native GetPartnerID(client, String:buffer[], maxLen);
    
    
    /**
     * Retrieves the marriage score of a client.
     *
     * @param client            The slot number of the client.
     * @return                    The marriage score, -1 if the client is not married.
     */
    native GetMarriageScore(client);
    
    
    /**
     * Retrieves the timestamp of a client's wedding.
     *
     * @param client            The slot number of the client.
     * @return                    The timestamp of the wedding, -1 if the client is not married.
     */
    native GetWeddingTime(client);
    
    
    /**
     * Fills an array with the proposals of all connected clients.
     * Given a client with slot number x, array[x] = -2 means the client has not proposed to anyone,
     * array[x] = -1 means the client has proposed but the target is not connected.
     * array[x] = 0 means that either the client is not connected, or the marital status is still being checked.
     * Any other number indicates the slot number of the target.
     * This array will NOT be updated! To update the array call GetProposals again.
     *
     * @param array                Destination array.
     * @param maxLen            Destination array length. This should be MaxClients + 1.
     * @noreturn
     */
    native GetProposals(array[], maxLen);
    
    
    /**
     * Fills an array with the marital statuses of all connected clients.
     * Given a client with slot number x: array[x] = -2 means the client is not married,
     * array[x] = -1 means the client is married but the partner is not connected.
     * array[x] = 0 means that either the client is not connected, or the marital status is still being checked.
     * Any other number indicates the slot number of the partner.
     * This array will NOT be updated! To update the array call GetMarriages again.
     *
     * @param array                Destination array.
     * @param maxLen            Destination array length. This should be MaxClients + 1.
     * @noreturn
     */
    native GetMarriages(array[], maxLen);
    
    
    /**
     * Called when a client makes a marriage proposal.
     *
     * @param proposer            The slot number of the proposer. 
     * @param target            The slot number of the target.
     * @noreturn                      
     */
    forward OnProposal(proposer, target);
    
    
    /**
     * Called when a client accepts a marriage proposal.
     *
     * @param proposer            The slot number of the proposer. 
     * @param accepter            The slot number of the accepter.
     * @noreturn                      
     */
    forward OnWedding(proposer, accepter);
    
    
    /**
     * Called when a client divorces.
     *
     * @param divorcer            The slot number of the divorcer.
     * @param partner            The slot number of the partner, -1 if the partner is not connected.
     * @noreturn                      
     */
    forward OnDivorce(divorcer, partner);
    Changelog

    Code:
    1.0
    - Initial release.
    
    1.1 
    - Bots no longer listed in the !marry menu.
    - Added sm_weddings_version cvar.
    
    1.2
    - Fixed a rare but possible bug.
    - Minor code changes.
    
    1.3
    - Added a bunch of natives.
    - Added sm_weddings_show_couples cvar.
    - Added auto-generated weddings.cfg file.
    
    1.4
    - Added support for a custom database.
    - Code changes.
    
    1.5
    - Connecting players no longer listed in the !marry menu.
    - Modified divorce notification: duration of marriage included.
    - More natives.
    
    1.6
    - Added sm_weddings_reset admin command.
    
    1.7
    - Added sm_weddings_command_delay cvar.
    - Fixed a bug.
    
    1.8
    - Blocking bi-directional proposals, notifying about an existing proposal instead.
    - Bug fixes.
    
    1.9
    - Added sm_weddings_disallow_unmarried, sm_weddings_kick_message cvars.
    - Advanced command usage storing, allowing greater delays.
    - Added combined marriage score: sum of frags of both clients.
    - Top couples ordered by marriage score.
    - Bug fixes.
    
    1.9b
    - Small bug fixes.
    
    2.0
    - Switched to threaded-sql for better performance.
    - Drastically reduced interaction with the database by optimizing code.
    - Reworked existing native functions.
    - Added new native functions.
    
    2.0b
    - A few necessary fixes.
    
    2.0.1
    - Even more fixes.
    
    2.0.2
    - Filled some documentation gaps.
    
    2.0.3
    - Small bug fixes.
    
    2.0.4
    - Swapped marriage date and score in the !couples menu so that points are more easily visible.
    Credits

    Special thanks to:

    Testers from the awesome pvkii community:
    - Dinah
    - Sir Whiskeyngton
    - Asmundr

    Screenshots
    Attached Thumbnails
    Click image for larger version

Name:	Clipboard01.jpg
Views:	2116
Size:	33.6 KB
ID:	123323   Click image for larger version

Name:	Clipboard02.jpg
Views:	1295
Size:	13.8 KB
ID:	123324   Click image for larger version

Name:	Clipboard03.jpg
Views:	1105
Size:	36.2 KB
ID:	123325   Click image for larger version

Name:	Clipboard07.jpg
Views:	1195
Size:	11.7 KB
ID:	123335   Click image for larger version

Name:	1.jpg
Views:	1165
Size:	26.0 KB
ID:	128049  

    Click image for larger version

Name:	2.jpg
Views:	1480
Size:	58.5 KB
ID:	128050  
    Attached Files
    File Type: zip weddings_2.0.4.zip (36.7 KB, 1316 views)

    Last edited by Dr. O; 01-10-2015 at 13:06.
    Dr. O is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Location: Source SDK
    Old 07-28-2013 , 11:00   Re: Weddings
    Reply With Quote #2

    Can you please provide a screenshot?
    __________________
    Sreaper is offline
    Dr. O
    Junior Member
    Join Date: Jul 2013
    Location: The House of Dr. O
    Old 07-28-2013 , 11:28   Re: Weddings
    Reply With Quote #3

    Sure, I forgot to do that.
    Dr. O is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 07-28-2013 , 12:52   Re: Weddings
    Reply With Quote #4

    Love...

    Add natives for developers, this can be fun (for add abilities between married players, etc)
    __________________
    Veteran SourceMod Coder -> Activity channel
    Taking paid requests -> Add me in TELEGRAM or STEAM
    or Discord Franc1sco#7876
    | You like my work? donate me


    Last edited by Franc1sco; 07-28-2013 at 12:55.
    Franc1sco is offline
    Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
    vman315
    SourceMod Donor
    Join Date: Sep 2012
    Location: Behind a keyboard
    Old 07-28-2013 , 13:00   Re: Weddings
    Reply With Quote #5

    Intersting...
    __________________
    Last edited by ; Today at 08:20 AM. Reason: Get rid of s
    vman315 is offline
    Dr. O
    Junior Member
    Join Date: Jul 2013
    Location: The House of Dr. O
    Old 07-28-2013 , 13:22   Re: Weddings
    Reply With Quote #6

    Quote:
    Originally Posted by Franc1sco View Post
    Add natives for developers, this can be fun (for add abilities between married players, etc)
    Good suggestion, I will consider this.
    Dr. O is offline
    eyes of hunter
    Member
    Join Date: Dec 2011
    Old 07-28-2013 , 15:00   Re: Weddings
    Reply With Quote #7

    Nice idea!

    And great suggestion, Franc1sco. For instance in css, they could share their combined money at 50%, or you could put a bacon on them that can be seen only by the married ones.
    eyes of hunter is offline
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 07-28-2013 , 21:55   Re: Weddings
    Reply With Quote #8

    Quote:
    Originally Posted by eyes of hunter View Post
    Nice idea!

    And great suggestion, Franc1sco. For instance in css, they could share their combined money at 50%, or you could put a bacon on them that can be seen only by the married ones.
    Right, will be good and possible


    Quote:
    Originally Posted by Dr. O View Post
    Can anyone tell me where the number "Servers with this Plugin" comes from? I didn't put anything in there.
    You need to add a public cvar

    For example:

    PHP Code:
    public OnPluginStart() {
    CreateConVar("sm_Weddings_version"PLUGIN_VERSION"plugin info"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);

    And next, you can search servers with that cvar in websites as http://www.game-monitor.com/ or you will can see in "Servers with this Plugin:" when your plugin will be approve, however, now seems that this feature is buggy in "New plugins" section xD


    btw, add me in steam if you need or want help
    __________________
    Veteran SourceMod Coder -> Activity channel
    Taking paid requests -> Add me in TELEGRAM or STEAM
    or Discord Franc1sco#7876
    | You like my work? donate me


    Last edited by Franc1sco; 07-28-2013 at 21:57.
    Franc1sco is offline
    Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
    cREANy0
    SourceMod Donor
    Join Date: Jul 2012
    Location: Germany
    Old 07-28-2013 , 22:38   Re: Weddings
    Reply With Quote #9

    Hahahahahaha

    How do you get this Idea?

    btw nice plugin ;)
    __________________
    cREANy0 is offline
    scorpadorp
    SourceMod Donor
    Join Date: May 2012
    Location: NC
    Old 07-28-2013 , 23:18   Re: Weddings
    Reply With Quote #10

    Very neat idea. The players already love the plugin.

    1 bug:
    The Replay bot shows up in the menu. Try detecting it and removing it. This can help detect it:
    Code:
    stock bool:IsReplayBot(client) {
    	decl S];
    	GetClientName(client, name, sizeof(name));
    	return IsFakeClient(client) && StrContains(name, "Replay", false) > -1;	
    }
    Also, a suggestion, try adding a divorced list, showing who has been divorced and and how many times per client.
    scorpadorp is offline
    Reply


    Thread Tools
    Display Modes

    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 01:40.


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