AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Shop (https://forums.alliedmods.net/showthread.php?t=322108)

Explait 03-16-2020 06:00

[L4D2] Shop
 
2 Attachment(s)
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:3
----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!:wink:
DONATE: https://www.donationalerts.com/r/smariov

Explait 03-16-2020 08:44

Re: [L4D2] Shop
 
Quote:

Originally Posted by BloodyBlade (Post 2687183)
Смешивание стилей не очень хорошо.
* Converted plugin source to the latest syntax. Requires SourceMod 1.8 or newer.
Please update your post)


Thank you, this is my second plugin, I am glad that people help me):3

mikaelangelis 03-19-2020 09:02

Re: [L4D2] Shop
 
Can you designate shop command to an object like a vendor machine only so when we reach a vendor machine, we can use only shop, not anytime and anywhere?

Explait 03-19-2020 15:39

Re: [L4D2] Shop
 
Quote:

Originally Posted by mikaelangelis (Post 2687589)
Can you designate shop command to an object like a vendor machine only so when we reach a vendor machine, we can use only shop, not anytime and anywhere?


ok, now I will do the update)

mikaelangelis 03-23-2020 15:13

Re: [L4D2] Shop
 
Quote:

Originally Posted by Explait (Post 2687648)
ok, now I will do the update)

glad to hear ur working on that feature :D

L4D2Noob 03-28-2020 15:45

Re: [L4D2] Shop
 
1 Attachment(s)
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 :-)

L4D2Noob 03-28-2020 18:17

Re: [L4D2] Shop
 
Quote:

Originally Posted by L4D2Noob (Post 2689108)
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?

L4D2Noob 03-28-2020 18:46

Re: [L4D2] Shop
 
Quote:

Originally Posted by L4D2Noob (Post 2689147)
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 03-28-2020 18:53

Re: [L4D2] Shop
 
1 Attachment(s)
My version (1.3)
  • Dollar icon removed
  • The store can be used once every 90 seconds

Balloons 03-28-2020 19:10

Re: [L4D2] Shop
 
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?


All times are GMT -4. The time now is 10:19.

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