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

[L4D2] Shop


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Explait
Junior Member
Join Date: Oct 2019
Plugin ID:
6986
Plugin Version:
1.5
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    l4d2 Shop
    Old 03-16-2020 , 06:00   [L4D2] Shop
    Reply With Quote #1

    This plugin adds a store to l4d2 games to open a store and buy something just type !shop in the chat (or sm_shop in the console), for admins there is a command !givemoney with this command you can give players money for example: !givemoney pewdiepie 100000.
    If your friend does not have enough money, just share your money a little: enter !pay your friend’s name and the amount of money.


    ----Creators-----
    Coder, SHOP,FUNCTIONS - https://steamcommunity.com/profiles/76561198858326120/
    Coder, MENU - https://steamcommunity.com/id/luckymate
    ----Creators-----

    ----New Updates-----
    1.zombie killing system - using this system you will receive a different amount of credits for zombies for example (boomer - 25) (smoker - 50)

    2.Adding store settings - Using the settings, you can change the number of credits for killing zombies

    3.Fixing Bugs
    ----New Updates-----

    -------NEXT Updates------


    Cars will be scattered throughout the map, with which you can use the store.

    You can add new products and change them.-------NEXT Updates------

    have fun!
    DONATE: https://www.donationalerts.com/r/smariov
    Attached Thumbnails
    Click image for larger version

Name:	awegarg.PNG
Views:	1215
Size:	9.1 KB
ID:	180246  
    Attached Files
    File Type: sp Get Plugin or Get Source ([L4D2] Store.sp - 1842 views - 22.1 KB)

    Last edited by Silvers; 10-28-2021 at 03:10. Reason: removed .SMX (compiles on forum fine)
    Explait is offline
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 03-28-2020 , 15:45   Re: [L4D2] Shop
    Reply With Quote #2

    Hey guys! I attached a version of the plugin that I edited for my server. Her changes:
    • Reduced the number of bonuses issued for killing infected
    • Defibrillator and full HP cut out for balance
    • Fixed a bug with a double purchase of adrenaline
    • Prices increased by 2 times
    • Fully translated into Russian

    But I still did not understand how to limit the use of the !Shop command? So that it can be used every 4 minutes. Help pills :-)
    Attached Files
    File Type: sp Get Plugin or Get Source ([L4D2] Store.sp - 525 views - 19.3 KB)
    __________________
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 03-28-2020 , 18:17   Re: [L4D2] Shop
    Reply With Quote #3

    Quote:
    Originally Posted by L4D2Noob View Post
    Hey guys! I attached a version of the plugin that I edited for my server. Her changes:
    • Reduced the number of bonuses issued for killing infected
    • Defibrillator and full HP cut out for balance
    • Fixed a bug with a double purchase of adrenaline
    • Prices increased by 2 times
    • Fully translated into Russian

    But I still did not understand how to limit the use of the !Shop command? So that it can be used every 4 minutes. Help pills :-)
    HTML Code:
    public Action HinT(int client, int args) // создаем функцию для комманды)
    {
    	Menu menu = CreateMenu(MeleeMenuHandler);
    	SetMenuTitle(menu, "Твои деньги %d", g_iCredits[client]);
    
    	AddMenuItem(menu, "option1", "Оружие");
    	AddMenuItem(menu, "option2", "Рукопашное");
    	AddMenuItem(menu, "option3", "Остальное");
    	DisplayMenu(menu, client, MENU_TIME_FOREVER);
    	SetMenuExitButton(menu, true);
    
    	// Timer
    	int currentTime = GetTime();
        if (cooldownTimes[client] != -1 && cooldownTimes[client] > currentTime)
        {
            ReplyToCommand(client, "Эй, ты слишком часто используешь магазин, подожди ка!");
            return Plugin_Handled;
        }
        // ayy at this point they're thing is -1 (they haven't used it before) or their cooldown is OK
        
        cooldownTimes[client] = currentTime + 240;
    	//End Timer
    	
    	return Plugin_Handled;
    }
    The code that is above, it creates a menu and starts counting the Cooldown at the same time.

    How to make it right so that either the menu opens or the Cooldown starts?
    __________________

    Last edited by L4D2Noob; 03-28-2020 at 18:27.
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 03-28-2020 , 18:46   Re: [L4D2] Shop
    Reply With Quote #4

    Quote:
    Originally Posted by L4D2Noob View Post
    HTML Code:
    public Action HinT(int client, int args) // создаем функцию для комманды)
    {
    	Menu menu = CreateMenu(MeleeMenuHandler);
    	SetMenuTitle(menu, "Твои деньги %d", g_iCredits[client]);
    
    	AddMenuItem(menu, "option1", "Оружие");
    	AddMenuItem(menu, "option2", "Рукопашное");
    	AddMenuItem(menu, "option3", "Остальное");
    	DisplayMenu(menu, client, MENU_TIME_FOREVER);
    	SetMenuExitButton(menu, true);
    
    	// Timer
    	int currentTime = GetTime();
        if (cooldownTimes[client] != -1 && cooldownTimes[client] > currentTime)
        {
            ReplyToCommand(client, "Эй, ты слишком часто используешь магазин, подожди ка!");
            return Plugin_Handled;
        }
        // ayy at this point they're thing is -1 (they haven't used it before) or their cooldown is OK
        
        cooldownTimes[client] = currentTime + 240;
    	//End Timer
    	
    	return Plugin_Handled;
    }
    The code that is above, it creates a menu and starts counting the Cooldown at the same time.

    How to make it right so that either the menu opens or the Cooldown starts?
    So it works!

    Spoiler
    __________________
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 03-28-2020 , 18:53   Re: [L4D2] Shop
    Reply With Quote #5

    My version (1.3)
    • Dollar icon removed
    • The store can be used once every 90 seconds
    Attached Files
    File Type: sp Get Plugin or Get Source ([L4D2] Store.sp - 624 views - 19.8 KB)
    __________________

    Last edited by Silvers; 10-28-2021 at 03:09. Reason: removed .SMX (compiles on forum fine)
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    BloodyBlade
    Senior Member
    Join Date: Feb 2018
    Old 05-02-2020 , 11:49   Re: [L4D2] Shop
    Reply With Quote #6

    Quote:
    Originally Posted by L4D2Noob View Post
    My version (1.3)
    • Dollar icon removed
    • The store can be used once every 90 seconds
    PHP Code:
    //SourceMod Batch Compiler
    // by the SourceMod Dev Team


    //// [L4D2] Store.sp
    //
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(55) : warning 217: loose indentation
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(56) : warning 217: loose indentation
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(65) : warning 217: loose indentation
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(125) : warning 219: local variable "menu" shadows a variable at a preceding level
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(148) : warning 219: local variable "menu" shadows a variable at a preceding level
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(161) : warning 219: local variable "menu" shadows a variable at a preceding level
    // Code size:            16576 bytes
    // Data size:             8312 bytes
    // Stack/heap size:      16384 bytes
    // Total requirements:   41272 bytes
    //
    // 6 Warnings.
    //
    // Compilation Time: 1,53 sec
    // ----------------------------------------

    Press enter to exit ... 
    Fixed version:
    Attached Files
    File Type: sp Get Plugin or Get Source ([L4D2] Store.sp - 336 views - 19.8 KB)

    Last edited by BloodyBlade; 05-02-2020 at 11:56.
    BloodyBlade is offline
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 05-02-2020 , 14:28   Re: [L4D2] Shop
    Reply With Quote #7

    Quote:
    Originally Posted by BloodyBlade View Post
    PHP Code:
    //SourceMod Batch Compiler
    // by the SourceMod Dev Team


    //// [L4D2] Store.sp
    //
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(55) : warning 217: loose indentation
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(56) : warning 217: loose indentation
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(65) : warning 217: loose indentation
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(125) : warning 219: local variable "menu" shadows a variable at a preceding level
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(148) : warning 219: local variable "menu" shadows a variable at a preceding level
    // D:\Games\Left4Dead2_Repack_by_Pioneer\scripting\sm&mm\sourcemod-1.10.0-git6478-windows\addons\sourcemod\scripting\[L4D2] Store.sp(161) : warning 219: local variable "menu" shadows a variable at a preceding level
    // Code size:            16576 bytes
    // Data size:             8312 bytes
    // Stack/heap size:      16384 bytes
    // Total requirements:   41272 bytes
    //
    // 6 Warnings.
    //
    // Compilation Time: 1,53 sec
    // ----------------------------------------

    Press enter to exit ... 
    Fixed version:
    Thank! I shared a new version in my community! And left a link to your profile!
    __________________
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    3aljiyavslgazana
    Member
    Join Date: Dec 2018
    Old 05-21-2020 , 01:43   Re: [L4D2] Shop
    Reply With Quote #8

    Awesome plugin !! here some suggestions :

    - add back button in the shop menu (there is only exit button)
    - make the shop menu disappear automatically after buying item
    - a command to show how much money you have (sm_money)
    - add more items and upgrades like laser and explosive ammo
    - let us open the shop menu in cooldown but can't buy from it
    - after cooldown is over show message saying (shop is open now!)

    .
    3aljiyavslgazana is offline
    Balloons
    Member
    Join Date: Feb 2020
    Old 03-28-2020 , 19:10   Re: [L4D2] Shop
    Reply With Quote #9

    Is there a way of adding a 'previous' button after selecting any of the sub menus? Or have the player start with a certain amount of cash?
    Balloons is offline
    mikaelangelis
    Senior Member
    Join Date: Oct 2017
    Old 04-08-2020 , 05:23   Re: [L4D2] Shop
    Reply With Quote #10

    Any news on the next update?
    mikaelangelis 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 08:22.


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