Raised This Month: $134 Target: $400
 33% 

Grenade Manager[V 0.2]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-17-2016 , 14:44   Grenade Manager[V 0.2]
Reply With Quote #1


Grenade Manager 0.2
Release: 17.06.2016 | Last Update: 29.06.2016

Table of Contents

Description top

With this plugin you can do two things:
  • Drop grenades(with "drop" command, like for any other weapon.
  • Control the max ammount of grenades that a player can have.

1.Grenades Drop features:
  • Drop grenades.
  • Press "g"(default bind for drop command)
  • Grenades are properly dropped

2.Grenade Ammo features:
  • As you know, in CS you have have 1 HE/ 2 FL/ 1 SK
  • Now, you can choose how many grenades a player can buy/pickup via cvars.
  • All grenades are fully usable and no useless entities are created.

Requirements top

This doesn't require much special things, only:
  • Orpheu module.
  • A server without dproto.
    This is not generally needed, but I won't help you if you are running an outdated server with dproto. If you are experiencing problems, update your server/ fix the erros by yourself.
Installation top

To install the plugin:
  1. Download the resources from this post.
  2. Put grenade_manager.amxx in addons/amxmodx/plugins
  3. Open addons/amxmodx/configs/plugins.ini and add at the end of this file grenade_manager.amxx
  4. You can put the sma file into addons/amxmodx/sources but this is not mandatory.
  5. Download the Grenade Manager archive and copy everything from orpheu folder to server's orpheu folder.
  6. Restart the server/change map.

To install orpheu:
  1. Download orpheu_files-2.5.1.zip and extrat the arhive.
  2. Copy orpheu_amxx.dll/orpheu_amxx_i386.so depending on your operation system into addons/amxmodx/modules
  3. The module will be auto-loaded, you don't need to add it into modules.ini

To compile locally:
  • First way:
    1. Download AMX Mod X for windows/linux from main site
    2. Extract somewhere the arhive and remember the folder!
    3. Copy the content from include folder from the orpheu archive into addons/amxmodx/scripting/include( in the folder created in the step 2 ).
    4. Download the source of the plugin( grenade_manager.sma) from this post and drag it over the compile.exe(scripting folder from the archive created at step 2)
    5. It will create a new folder called compiled. Open it and you will find your compiled plugin( grenade_manager.amxx )
  • Second way:
    1. Go to http://spider.limetech.org/
    2. Copy/paste the code from the .sma file into the website.
    3. Under the big blue Compile button you see a box which Drop .inc files here
    4. Then press Compile and Download

If you don't know/want to compile locally, you can download the attached amxx file(not the one from Get Plugin link).

Cvars top
  • max_flashbangs: max ammount of flashbangs that a player can have in his inventory. Default 2
  • max_hegrenades: max ammount of hegrenades that a player can have in his inventory. Default 1
  • max_smokegrenades: max ammount of smokegrenades that a player can have in his inventory. Default 1
  • drop_grenades: 1 - allow grenade drop | 0 - block grenade drop
API top

grenade_manager.inc
PHP Code:
#if defined _grenade_manager_included
  #endinput
#endif
#define _grenade_manager_included

/**
    *  Called when player wants to drop a grenade
    *
    *  @param id               PlayerIndex
    *  @param weaponClassName  Grenade classname
    *  @param weaponEntity     Grenade entity index that will be packed into the box
    *  @param weaponBoxEntity  Weapon box entity that will hold the grenade entity
    *  @param userBackpackAmmo Ammout of grenades that player has in his inventory(after packed it will be num - 1)
    
    *  @note    Return PLUGIN_HANDLED or any value bigger than 1 to stop the forward.
            This also stop the grenade drop and default "This weapon cannot be dropped" message appears.
*/
forward OnGrenadeDrop(idweaponClassName[], weaponEntityweaponBoxEntityuserBackpackAmmo
The purpose is to be able to hook/alter/block a grenade drop. Forward is executed as pre.
ChangeLog top
  • V 0.1:
    • Initial release
  • V 0.2:
    • Fixed plugin not working on linux
    • Code cleaned
    • Added a forward
Downloads top
  • 0.2 version: 15
End Note:

This is pretty experimental, though I tested it and everything seems to work as intended. It does a lot of things that game is not made to do. I did my best to handle every case, but if you find any kind of bugs please report so I can fix them.
Code has some comments for explaining why some methods were choosed and not the others.
I have not tested in linux, but signatures and offsets look ok. If someone can check I would be glad.

You may also noticed the "Grenade Drop+Ammo Control" plugin, which is basically this one, but I removed it since it was broken. This version should be fully functional and the name is better IMO. I'm open to suggestions, anyway.

Attached Files
File Type: sma Get Plugin or Get Source (grenade_manager.sma - 197 views - 20.1 KB)
File Type: zip Grenade Manager.zip (11.0 KB, 146 views)
File Type: amxx grenade_manager.amxx (7.3 KB, 78 views)
__________________

Last edited by HamletEagle; 09-18-2016 at 06:35.
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: Brazil, SP
Old 06-17-2016 , 16:41   Re: Grenade Manager[V 0.2]
Reply With Quote #2

I think i already see this post here. No?

But, of course, i like your job.
Nice
__________________
EFFx is offline
Send a message via Skype™ to EFFx
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-18-2016 , 14:17   Re: Grenade Manager[V 0.2]
Reply With Quote #3

You saw the older version which was not working on linux. I decided to remove it and post a new one when I get everything working.
This time I tested it pretty much and everything looks ok.
__________________

Last edited by HamletEagle; 06-18-2016 at 14:17.
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: Brazil, SP
Old 06-18-2016 , 15:59   Re: Grenade Manager[V 0.2]
Reply With Quote #4

Ah, and one more thing, remove the .amxx file.
__________________

Last edited by EFFx; 06-18-2016 at 16:00.
EFFx is offline
Send a message via Skype™ to EFFx
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-18-2016 , 16:43   Re: Grenade Manager[V 0.2]
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
Ah, and one more thing, remove the .amxx file.
Do you really believe I don't know the rules? Since I am approver I can upload amxx files.
__________________
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: Brazil, SP
Old 06-18-2016 , 18:40   Re: Grenade Manager[V 0.2]
Reply With Quote #6

and i dont know for what upload amxx files, already have Get Plugin and Get Source.


And i dont said that you dont know the rules, is only a request.
__________________

Last edited by EFFx; 06-18-2016 at 18:41.
EFFx is offline
Send a message via Skype™ to EFFx
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-18-2016 , 19:12   Re: Grenade Manager[V 0.2]
Reply With Quote #7

You can't use "Get Plugin" since plugin use custom includes(orpheu). Also, some people are lazy and don't want to compile. Having the amxx file does not hurt.
Now, can we get back to the topic? Thanks.
__________________

Last edited by HamletEagle; 06-18-2016 at 19:13.
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 06-19-2016 , 03:33   Re: Grenade Manager[V 0.2]
Reply With Quote #8

Can we have forward when grenade is dropped? Then, we can do more custom things there.
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-19-2016 , 07:30   Re: Grenade Manager[V 0.2]
Reply With Quote #9

Quote:
Originally Posted by zmd94 View Post
Can we have forward when grenade is dropped? Then, we can do more custom things there.
Done. Check main post.
__________________
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 06-19-2016 , 12:13   Re: Grenade Manager[V 0.2]
Reply With Quote #10

Nice, HamletEagle. This will be more fun.
__________________
Problem with ZP?
ZP Helper!
zmd94 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:41.


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