Raised This Month: $150 Target: $400
 37% 

[L4D] Item Buy System


Post New Thread Reply   
 
Thread Tools Display Modes
Author
(-DR-)GrammerNatzi
Senior Member
Join Date: Jun 2009
Plugin ID:
955
Plugin Version:
1.278
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    22 
    Plugin Description:
    This plug-in allows players to get points through various ways on both the infected and the survivors. They can use these points to purchase things that will help them, like incendiary ammo, ammo refills, health, items, weapons, infected, mobs, and more.
    Old 06-24-2009 , 22:20   [L4D] Item Buy System
    Reply With Quote #1

    This is my first plugin that I have made for Sourcemod. I decided that it would be nice to see something simple like this, and, seeing as I don't see any other addons that do this kind of thing (I may be wrong), I decided to make it my first project.

    The point of this plugin is to allow survivors (and infected) to be rewarded for teamwork. They can also be rewarded for killing special infected and a certain number of regular infected, but they will not get nearly as many points for doing so. They will get much more points for helping someone up or healing someone than killing a hunter. They can then use these points to buy rewards. I also added an admin gifting system that I made in my spare time, which probably won't be as useful, but is still a nice touch.

    Any constructive criticism is appreciated.

    Console Commands (add a ! or / and subtract sm_ for chat):

    • points - Shows the current number of points
    • itempointshelp - Shows the commands for points and provides a basic introduction of them to the client.
    • usepoints - The buy menu. Number of points needed to buy an item are displayed next to the item. Has two pages and contains all weapons, pipe-bombs and molotovs, refill, and heal.
    • repeatbuy - Purchases what you purchased previously.
    • refill - Refills an admin's ammo.
    • heal - Refills an admin's health (can revive).
    • fakegod - Makes an admin invincible.
    • sm_clientgive - Gives a client an item. Syntax - sm_clientgive <client(s)> [item number]. Numbers: 0 - Shotgun, 1 - SMG, 2 - Rifle, 3 - Hunting Rifle, 4 - Auto-shotty, 5 - Pipe Bomb, 6 - Molotov, 7 - Pistol, 8 - Pills, 9 - Medkit, 10 - Ammo, 11 - Health.
    • sm_clientgivemenu - Does the same as above, but with a menu. The above should only be used for binds.
    • sm_clientgivepoints - Gives clients (or yourself) points.
    • sm_clientsetpoints - Sets the points of a client (or you).
    Cvars (I only put working ones here. If it isn't shown, it doesn't work. Also, if the cvar has to do with a purchasable's cost, making the number -1 will disable the purchasable.):
    • points_on - Turns the point system on or off. (Default: 1)
    • points_amount_infected - How many points you get for killing a certain number of regular infected (Default: 2)
    • points_amount_specialinfected - How many points you get for killing a special infected. (Default: 1)
    • points_amount_heal - How many points you get for healing a teammate. (Default: 5)
    • points_amount_revive - How many points you get for reviving a teammate. (Default: 3)
    • points_amount_witch - How many points you get for killing a witch. (Default: 5)
    • points_amount_witch_instakill - How many additional points you get for killing a witch instantly. (Default: 3)
    • points_amount_tank - How many additional points you get for killing a tank. (Default: 2)
    • points_amount_infectednum - How many killed infected it takes to earn points. Headshot and minigun kills can be used to rank up extra kills. (Default: 25)
    • points_amount_extra_headshotkills - How many extra kills survivors are awarded for scoring headshots. 0 = None. (Default: 1)
    • points_amount_extra_minigunkills - How many extra kills survivors are awarded for scoring minigun kills. 0 = None. (Default: 1)
    • points_amount_infected_hurt - How many points infected get for hurting survivors a number of times. (Default: 2)
    • points_amount_infected_incapacitation - How many points infected get for incapacitating survivors. (Default: 5)
    • points_amount_infected_pull - How many points you get [as a smoker] for pulling a survivor. (Default: 1)
    • points_amount_infected_pounce - How many points you get [as a hunter] for pouncing a survivor. (Default: 1)
    • points_amount_infected_vomit - How many points you get [as a boomer] for vomiting/exploding on a survivor. (Default: 1) This can be racked up by vomiting/exploding on multiple survivors.
    • points_advertising - Turns on or off advertising. 1 = Short Advertisement, 2 = Normal Advertisement, and 0 = Nothing. (Default: 0)
    • points_price_<purchasable> - Adjusts the price of the purchasable.
    • points_infected_price_<purchasable> - Adjusts the price of an infected purchasable.
    • points_special_price_<purchasable> - Adjusts the price of special purchasables.
    • points_limit_<tanks/witches> - Sets the round limit for tanks and witches that can be bought using points.
    • points_advertising_remind - Tell clients how to get their broken number binds to work? (Default: 0)
    • points_reset_round - Do we want to reset points on round end? Resets points every two rounds in versus. (Default: 1)
    • points_advertising_ticks - How much time till the optional advertising is displayed? (Default: 80)
    • points_advertising_remind_ticks - How much time till the optional gamepad reminder is displayed? (Default: 60)
    • points_special_burn_time - How long do you get incendiary ammo for in seconds? (Default: 30)

    Future Additions:
    • Add more rewards.
    • Add more opportunities to get points.
    • Add more "power-ups".
    Servers running this plug-in:

    http://www.game-monitor.com/search.p...&type=variable

    Servers running the current version:

    http://www.game-monitor.com/search.p...ame=left4dead2

    Change Log:

    Version 1.278: Added a variable to set the amount of rounds until reset.

    Version 1.277: Fixed points_reset_round and made it reset every two rounds in versus. Also defaulted it to on. Was tired of all the servers with prices at about 5,000 for a shotgun, anyway.

    Version 1.276: Fixed infected getting SI and witch kill points. Also raised tankonfire array size a bit.

    Version 1.275: Made the PLAYERS variable control every number related to the amount of players and fixed up the code a bit.

    Version 1.274: Made the panic event five mobs instead.

    Version 1.273: Made the number that cancels the purchasable -1. Found out that the only reason it wouldn't do it was because of some stupid typo I made.

    Version 1.272: Added super incendiary ammo that can burn special infected for a higher price and made the points announcements shorter.

    Version 1.271: Got rid of points_reset.

    Version 1.27: Added incendiary ammo and changed the points menu. There is now a special menu that has things that are more like power-ups than items. Expect more to be added soon. There is only incendiary ammo right now. You can also change the time incendiary ammo lasts, too.

    Version 1.263: Fixed bug where optional advertising could not be turned off.

    Version 1.262: You can now change the amount of time till the optional advertisement/gamepad reminder comes up. A few bugs have been fixed, too.

    Version 1.261: Points can now be chosen to reset at round ends, map loads, or both.

    Version 1.26: Added the ability to spawn mobs and panic events, and added the repeatbuy command.

    Version 1.256: Boomer cost fixed.

    Version 1.255: Changed disabling cost.

    Version 1.254: You can now disable items by making their cost -1 or below. Infected can no longer spawn in safe areas. Also, there is now an option to remind players how to get their number keys working.

    Version 1.253: Tank and witch spawning bug fixed.

    Version 1.252: There is now a limit for the amount of tanks and witches that players can spawn per round.

    Version 1.251: Can't get points as infected by attacking your own teammates now.

    Version 1.25: The points menu has been revamped to be more flexible. Tank points are now fixed (no more mass points when a tank is burned), and you can now change the price of items. Also, the code is a little cleaner, but it's not like you'll care.

    Version 1.24: Fixed a big error that made the plug-in not work.

    Version 1.23: Added a set points command and fixed some bugs here and there.

    Version 1.22: Tank burning points working now, tank and witch price raised to make versus a tiny bit less of a survivor slaughter fest.

    Version 1.21: Fixed a few problems concerning points and removed end round point clearance for versus and survival.

    Version 1.2: Big changes here. Infected can now get their own points by pouncing, vomiting/exploding and pulling survivors plus more. They even get their own menu, which is opened using the same command. Admins can now give clients points, too. Also, tank burn points are in again.

    Version 1.156: Now compatible with Super Versus.

    Version 1.155: Commented out two cvars.

    Version 1.154: Plugin now auto-creates a config.

    Version 1.153: Commented out tank burning points, since it was very buggy.

    Version 1.152: Some typos in text fixed.

    Version 1.151: Points can also be earned by killing or burning the tank now (sadly, there is no way I have found so far as to finding out if a player hurt a tank). You can get a total of 4 points from a tank.

    Version 1.15: You can now get points by killing a witch and additional points for killing the witch instantly. Points are now named item points (although are often called points for short) to make them a bit more self-explanatory.

    Version 1.14:
    Advertising is now off by default. If you want to turn it on, there is now a cvar to do so.

    Version 1.13: Even more hotfixing. Turns out I made a typo on the heal item, so it wouldn't work. This is fixed now. Also, the number of points you have is now shown in the menu title.

    Version 1.12:
    Another hotfix. The default value of points you get for killing 25 infected has been raised by a point and some text has been changed.

    Version 1.11: Hotfix considering invalid point numbers.

    Version 1.1: Added convars for points, added convars to turn off points (sm_on_versus doesn't work yet), and also fixed some code here and there. You no longer get points for opening doors (it was buggy). I also made the repeating message a bit more informative about what the plug-in actually does; some people I was playing with thought it was some other version of HLStatsX and ended up leaving. Also, refill, heal, and fakegod are now admin only commands, but they can still be awarded to clients and refill and heal can still be used with the point system. The price of the Shotgun and the SMG were raised to 5 to prevent cheap refills.

    Version 1.0: None.

    Credits:

    Madcap, {7~11} TROLL - I used their code for the Tankbuster menu (Troll) and ledge release (Madcap) as a reference. I learned how to give items to clients and create menus from Madcap's code (in fact, some of it is in there, just heavily modified), and I learned how to tie events to functions from Troll's code.

    AlliedModders LLC - I used the slap code as a reference for the gift plugin.

    The SourceMod Community as a whole - Special thanks to Exvel (I used his method of god mode for the fakegod in this plugin) and base64 (I used his method of message announcing for the announcement of the plugin on the server every 80 seconds).
    Attached Files
    File Type: sp Get Plugin or Get Source (L4DPointsandGift.sp - 11051 views - 67.8 KB)

    Last edited by (-DR-)GrammerNatzi; 10-05-2009 at 19:22.
    (-DR-)GrammerNatzi is offline
    GM-Scorp
    Senior Member
    Join Date: Jun 2009
    Location: netherlands
    Old 06-25-2009 , 03:19   Re: [L4D] Points and Adming Gifting System
    Reply With Quote #2

    Does it work on Vesus to cuzz i dont think it should

    cuzz people can heal themselves when they have the points

    so it causes more rage quiters
    because people heal them selfes with the points

    maby you can make it so it turns itself off when a Versus match is on ?

    Just my opinion of it but for Coop it verry Cool man Good job

    Owyeah and how do ya give stuff as an ADMIN ?
    GM-Scorp is offline
    Send a message via MSN to GM-Scorp
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 06-25-2009 , 06:36   Re: [L4D] Points and Adming Gifting System
    Reply With Quote #3

    Can you add more info on how it actually works, what cvars you can use for tweaking plugin settings, is there a menu being added? Will it work in versus, what rewards you can give to players?
    olj is offline
    (-DR-)GrammerNatzi
    Senior Member
    Join Date: Jun 2009
    Old 06-25-2009 , 10:06   Re: [L4D] Points and Adming Gifting System
    Reply With Quote #4

    Quote:
    Originally Posted by olj View Post
    Can you add more info on how it actually works, what cvars you can use for tweaking plugin settings, is there a menu being added? Will it work in versus, what rewards you can give to players?
    I will add information for it, so sorry that I didn't add it earlier. I was kind of in a rush. Also, it will work in versus, but I understand that isn't a good thing, and so I will change it soon.
    (-DR-)GrammerNatzi is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 06-25-2009 , 12:31   Re: [L4D] Points and Adming Gifting System
    Reply With Quote #5

    GOOD thing would be if you make cvar which will allow or disallow it in versus (depending on cvar setting) . If someone using modified versus settings with tons of zombies it would be great, but on classic versus this plugin can ruin game for infected, so just make cvar which will turn it off and on for versus. I see this as a good addition for those 10 vs 10 massacre games. Will test it now btw. Also looked into source code. !pointshelp, !pointsmenu, !points is say-commands to use as i understood. Btw, thanks for actually doing some good stuff for best MP game ever =)
    olj is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 06-25-2009 , 13:03   Re: [L4D] Points and Adming Gifting System
    Reply With Quote #6

    OK, played against bots, works as it should in versus. I will adjust numbers of points you get in source code, so it will give less points and try to use it in multiplayer. I think you should add cvars for these settings. So admins can adjust prices and how much points survivors will get fot proper events. Also need more info on fakegod command.

    Ok, tried fakegod command, it crushes game badly. And i cant find way how i can give rewards to players as an admin.

    Also giving to someone SMG or shotgun for 1 point = refill ammo for 1 point.

    Last edited by olj; 06-25-2009 at 13:29. Reason: ..
    olj is offline
    (-DR-)GrammerNatzi
    Senior Member
    Join Date: Jun 2009
    Old 06-25-2009 , 16:16   Re: [L4D] Points and Adming Gifting System
    Reply With Quote #7

    Quote:
    Originally Posted by olj View Post
    OK, played against bots, works as it should in versus. I will adjust numbers of points you get in source code, so it will give less points and try to use it in multiplayer. I think you should add cvars for these settings. So admins can adjust prices and how much points survivors will get fot proper events. Also need more info on fakegod command.

    Ok, tried fakegod command, it crushes game badly. And i cant find way how i can give rewards to players as an admin.

    Also giving to someone SMG or shotgun for 1 point = refill ammo for 1 point.
    Thanks. I just realized that. Also, if you want to make it so they get less points, try getting rid of the revive and closet rescue points. Those give the survivors a lot of points. I'm going to make a ton of cvars to control this so that you can switch on and off when they get points and how many they get. Don't take away too many points from the system, though, or it'll completely destroy the purpose.

    EDIT: Ok, I just added a lot of things to a new update that makes the mod a bit cleaner and better to use. I also changed the title to make this plugin sound a bit more interesting that just a point system (which it is).

    Last edited by (-DR-)GrammerNatzi; 06-25-2009 at 17:12.
    (-DR-)GrammerNatzi is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 06-26-2009 , 11:49   Re: [L4D] Item Buy and Admin Gifting System
    Reply With Quote #8

    Nice Does it create its cfg file automatically? I saw a thread in forums somewhere, how to add this feature to plugin. Dont remember where though.

    Whats with fakegod command, is it really buggy or its just my internal problem.

    How about granting points for killing witch and burning up the tank? Or +1 point to all who took part in killing tank. That would be nice.

    Last edited by olj; 06-26-2009 at 11:58.
    olj is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 06-26-2009 , 12:43   Re: [L4D] Item Buy and Admin Gifting System
    Reply With Quote #9

    sm_clientgivemenu isn't working (. But sm_clientgive works fine. Fakegod doesnt work either, but at least it stopped crushing game.
    olj is offline
    (-DR-)GrammerNatzi
    Senior Member
    Join Date: Jun 2009
    Old 06-26-2009 , 15:32   Re: [L4D] Item Buy and Admin Gifting System
    Reply With Quote #10

    Quote:
    Originally Posted by olj View Post
    Nice Does it create its cfg file automatically? I saw a thread in forums somewhere, how to add this feature to plugin. Dont remember where though.
    Not yet. I'll add that soon, though.

    Quote:
    Originally Posted by olj View Post
    How about granting points for killing witch and burning up the tank? Or +1 point to all who took part in killing tank. That would be nice.
    I don't know about burning the tank, but +1 to all who took part in killing the tank and killing the witch is probably possible. I'll try and add those.
    (-DR-)GrammerNatzi 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 14:55.


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