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

Market


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Plugin ID:
450
Plugin Version:
1.2
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Provides tools for other plugins use to to send the "market" menu to clients
    Old 07-06-2008 , 17:09   Market
    Reply With Quote #1

    Market
    Version 1.2 FINAL

    Requirements:
    • Sourcemod 1.0.3
    Description:
    This plugin simple provides an include file for other plugins to use. Other plugins can use this plugin to build a menu of weapons from a pre-defined list in configs/market/weapons.txt. Allows the plugin to control when the menu is sent, and whether to allow the player to purchase a weapon.

    Todo:
    (Strikethrough = Completed)
    • (none)
    Include:
    Code:
    /**
     * ====================
     *        Market
     *   File: market.inc
     *   Version: 1.2
     *   Author: Greyscale
     * ==================== 
     */
    
    /**
     * Used to send the market to a client
     * @param client   Client index
     * @param title   Title of the market menu
     * @param rebuy   Text to display for the "Rebuy" option
     * @noreturn
     */   
    native Market_Send(client, const String:title[], const String:rebuy[]);
    
    /**
     * Used to send the market to a client
     * @param weapondid   ID of the weapon whose info will be returned
     * @param display   The display name of the weapon
     * @param weapon   The entity name of the weapon
     * @param price   The price of the weapon
     * @return   True if weaponid exists, false if not
     */
    native bool:Market_GetWeaponIDInfo(const String:weaponid[], String:display[], String:weapon[], &price);
    
    /**
     * Called when a player makes a selection from the menu
     * @param client   Client index
     * @param weaponid   Returns the ID of the weapon selected ("rebuy" is returned when player selected rebuy)
     * @return   True to allow purchase, false to block
     */
    forward bool:Market_OnWeaponSelected(client, String:weaponid[]);
    
    /**
     * Called after a player makes a selection from the menu
     * @param client   Client index
     * @param allowed   True if selection was allowed and false if it was blocked
     * noreturn
     */
    forward Market_PostOnWeaponSelected(client, &bool:allowed);
    
    
    
    public SharedPlugin:__pl_market = 
    {
        name = "market",
        file = "market.smx",
    #if defined REQUIRE_PLUGIN
        required = 1,
    #else
        required = 0,
    #endif
    };
     
    public __pl_market_SetNTVOptional()
    {
        MarkNativeAsOptional("Market_Send");
        MarkNativeAsOptional("Market_GetWeaponIDInfo");
    }
    Installation:
    • Extract the contents of the zip file into cstrike
    • Your done!
    Changelog:

    July 6th
    • Released
    July 9th
    • Now creates a library for plugins to keep track of its availability
    • New native Market_GetWeaponIDInfo which returns all the data about a weapon
    • Market_OnWeaponSelected now returns a weapon id to use in Market_GetWeaponIDInfo
    July 11th
    • Reselecting weapon in the menu will refill the ammo (went through special measures to stop it from refilling the clip too)
    • Market_PostOnWeaponSelected forward added which will be called after the weapon is given
    • Update weapons.txt or ammo won't work
    • Final Update.
    February 15th 2010
    • Fixed exploit
    Attached Files
    File Type: zip market.zip (12.8 KB, 10544 views)
    __________________

    Last edited by Greyscale; 02-15-2010 at 18:31.
    Greyscale is offline
    leegeek
    Junior Member
    Join Date: Jun 2008
    Old 07-07-2008 , 02:29   Re: Market 1.0
    Reply With Quote #2

    GJ,i need this one for Zombie Riot v1.2

    Last edited by leegeek; 07-10-2008 at 02:59.
    leegeek is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-09-2008 , 18:21   Re: Market 1.1
    Reply With Quote #3

    Update

    • Now creates a library for plugins to keep track of its availability
    • New native Market_GetWeaponIDInfo which returns all the data about a weapon
    • Market_OnWeaponSelected now returns a weapon id to use in Market_GetWeaponIDInfo
    Anyone using this for ZRiot or Zombie:Reloaded please update to this version if you are using the newest versions of these plugins. (1.2.1 & 2.2.1)
    __________________
    Greyscale is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-10-2008 , 00:27   Re: Market 1.1
    Reply With Quote #4

    Anyone who installed this plugin between 5 PM today and now, please reinstall

    Files weren't updated in the release , updated now
    __________________
    Greyscale is offline
    leegeek
    Junior Member
    Join Date: Jun 2008
    Old 07-10-2008 , 03:02   Re: Market 1.1
    Reply With Quote #5

    Sweet, i am going to update
    leegeek is offline
    ifx
    Senior Member
    Join Date: Apr 2008
    Old 07-10-2008 , 11:06   Re: Market 1.1
    Reply With Quote #6

    it would be nice, if ammo automaticaly refinite in choosed weapon in menu
    or admin can setup this option in CVAR

    thanks!
    ifx is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-10-2008 , 15:07   Re: Market 1.1
    Reply With Quote #7

    I will release 1.2 (final) version of this plugin when I am ready to release ZR and ZRiot, each have a couple fixes ready. I don't want to release and then realize I need to change something else. I don't plan on updating ZR many more times.

    Updates for this is re-selection of a weapon in your possession will read the ammo data off weapons.txt and charge accordingly.
    I also included a new forward that is called AFTER the weapon is given.

    If there is nothing else this plugin will be final so I dont have to update ZR/ZRiot every time I update this.
    __________________

    Last edited by Greyscale; 07-10-2008 at 15:09.
    Greyscale is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-11-2008 , 19:08   Re: Market
    Reply With Quote #8

    Update
    • Reselecting weapon in the menu will refill the ammo (went through special measures to stop it from refilling the clip too)
    • Market_PostOnWeaponSelected forward added which will be called after the weapon is given
    • Update weapons.txt or ammo won't work
    • Final Update.
    __________________
    Greyscale is offline
    Silent Sniper
    Member
    Join Date: May 2006
    Location: UK
    Old 10-02-2008 , 18:08   Re: Market
    Reply With Quote #9

    This page is passworded. Where can we download this plugin?
    __________________
    Silent Sniper
    Silent Sniper is offline
    Send a message via AIM to Silent Sniper
    WoRsTy
    New Member
    Join Date: Sep 2008
    Old 10-06-2008 , 08:10   Re: Market
    Reply With Quote #10

    Could realy do with this plugin.
    WoRsTy 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 10:05.


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