Raised This Month: $66 Target: $400
 16% 

Counter-Strike Pick Up Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Admin Commands        Approver:   HamletEagle (32)
Craxor
Veteran Member
Join Date: Jan 2016
Location: ro
Old 09-16-2016 , 20:08   Counter-Strike Pick Up Manager
Reply With Quote #1

Counter-Strike Pick Up Manager
Current version: 1.6 | Last Update: 15 of June 2016

Table of Contents

Description top


When you touch a weapon from the ground, if that weapon exist in vault, this plugin will block picking-up it or will remove it( depends of the cvar ).
You can add or remove weapons in the vault by using commands.

Example to block m4a1:
Quote:
amx_cspum_addkey "m4a1"
'm4a1' is a key wich blocks the weapon M4a1 to be picked up or can be removed on touch(dependes on cvar ).
For list of all keys check the 'Admin commands' section.


Admin Command top

Spoiler

Installation top

To install the plugin:
  • Download cspum.sma and cspum.amxx and cspum.txt
  • Go to cstrike/amxmodx/plugins and open plugins.ini , please add at the end of the file: "cspum.amxx" ( without quotes ).
  • Leave cspum.txt in cstrike/amxmodx/data/lang.
  • Optionaly You could take cspum.sma and leave it in addons/amxmodx/scripting/ , but it's not a must...
  • Change map/Open the server and enjoy life.

Cvars top

Spoiler


Credits top
  • I wanne special thanks to Bugsy and HamletEagle for their hard contribution.
  • But also to the next people:
    • ConnorMcLeod
    • Addonszz
    • Arkshine
  • And also to all guys who contribute here, thanks guys.
ChangeLog top
Click
Attached Files
File Type: txt cspum.txt (3.8 KB, 343 views)
File Type: sma Get Plugin or Get Source (CSPum.sma - 969 views - 12.6 KB)

Last edited by Craxor; 06-23-2017 at 12:55.
Craxor is offline
Send a message via ICQ to Craxor
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 09-16-2016 , 21:07   Re: CS Pick Up Manager [ v1.0 ]
Reply With Quote #2

I like your code. So fucking cool man!
__________________
Quote:
Originally Posted by wickedd View Post
Make me or STFU boy
pupdebox is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: ro
Old 09-16-2016 , 21:36   Re: CS Pick Up Manager [ v1.0 ]
Reply With Quote #3

Quote:
Originally Posted by pupdebox View Post
I like your code. So fucking cool man!
ok but you understand what this plugin does? I'm very bad at writing descriptions also i try to write the plugin in a easy manner to read the code so i hope i acomplish it


EDIT: Also for the upcoming release not ready public you can always check my githube too what's new ( GitHub ).
__________________
Project: Counter-Strike Dragon Ball Mod (csdb) [done: 0%]

Last edited by Craxor; 09-17-2016 at 13:16.
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-17-2016 , 06:18   Re: CS Pick Up Manager [ v1.0 ]
Reply With Quote #4

From what I understood, bugsy did most of the code. Do you understand it? Are you able to provide support/fixes/updates?
__________________
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: ro
Old 09-17-2016 , 07:56   Re: CS Pick Up Manager [ v1.0 ]
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
From what I understood, bugsy did most of the code. Do you understand it? Are you able to provide support/fixes/updates?
Yes i'm able, just tell what modifications i should add.

Bugsy help my with a lot of codes about nvault and fix my some errors i got, maybe he will help if i will got other sticking points , and yes i'm understand perfectly what bugsy modify, i'm able to support it
__________________
Project: Counter-Strike Dragon Ball Mod (csdb) [done: 0%]

Last edited by Craxor; 09-17-2016 at 07:57.
Craxor is offline
Send a message via ICQ to Craxor
Craxor
Veteran Member
Join Date: Jan 2016
Location: ro
Old 09-20-2016 , 13:16   Re: Counter-Strike Pick Up Manager
Reply With Quote #6

Update.
__________________
Project: Counter-Strike Dragon Ball Mod (csdb) [done: 0%]
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-07-2016 , 12:32   Re: Counter-Strike Pick Up Manager
Reply With Quote #7

For approval:

1. Making global variables static means they are in the scope of current file(they are visible only in the file they are created). Since you don't work with multiple files, static is misused. Use new.
2. Be consistent with your function naming. For example, you have "addkey", "remkey", etc and suddenly "_ShowKeyLists". Keep the same style regarding naming patter and capitalization. "OnPlayerTouchItem" here you start with upper case, in "addkey" for example with lower case. Pick a style and stick to it.
3. Not very important, but since "player" string is used multiple times, I would do something like this:
PHP Code:
new const PlayerClass[] = "player"
register_touch"armoury_entity" PlayerClass "OnPlayerTouchItem" );  
etc 
4. I would like you to add the cvar description and possible values inside source file. That way, it's easier for anyone to understand how to use your plugin.
5. Inside addkey:
  • The !read_argv check looks useless. cmd_access makes sure you have enough params. Remove it(also in remkey).
  • client_print( id , 2, "Unable to find the key '%s', type amx_cspum_keylist for all keys available to insert." , szWeaponArg ); Don't use magic number, use the associated constant. Here it is print_console, instead of 2.
6. In block_all:
  • Indent properly.
  • Check if weapon is not already blocked before formatting and setting into vault(if(!(gBlockWeapons & (1 << i))). That way you can avoid useless native calls.
7. It's not logical to allow any admin to access amx_cspum_keylist since only admins with ban access can use the plugin. Apply the same restriction here(add ADMIN_BAN when registering the command and use cmd_access instead of is_user_admin).
8.In _ShowKeyLists: if ( gKeyList[ i ][ 0 ] ) : since gIgnoreWeapons exists, use it.
9.In OnPlayerTouchItem:
  • !ent check is invalid. It should be ent != -1 or simply call pev_valid.
  • static is misused, switch to new.
  • case 1: engfunc( EngFunc_RemoveEntity, ent ); that's really wrong.
    • When you want to remove the weaponbox entity, you must also remove the weapon from the box, not only the box. The proper way is to make it think immediately(by call_think for example). This triggers internally CWeaponBox::Kill which takes care of things properly.
    • If you want to remove an armoury_entity, you should not actually delete the entity. This entities are a bit special, if you remove them they won't respawn the next round again and this is the issue if cvar is changed or key is removed. Use game's own method:
      PHP Code:
      const XoCArmoury 
      const m_iCount 35
      set_pdata_int
      (entm_iCount0XoCArmoury)
      set_pev(entpev_effectspev(entpev_effects) | EF_NODRAW
      What this does is to set the item count to 0(so entity contain 0 weapons) and make it invisible. Game will automatically respawn them on new round.
    • For shield you can simply call EngFunc_RemoveEntity.
    Inside case 1 you have to check what kind of entity you have and deal with it properly.

For your information, CSW_SHIELD should be named to CSW_SHIELDGUN, because this is the real name. Also it's value is 99, not 31. This constant was added into amxx 1.8.3.
In general, for consistency you should keep it's original name and value, but because here you use it for indexing an array and because there is too much empty space from 30 to 99 you can and should keep it like that.

If you don't understand something ask. Don't forget that everything can be discussed.
__________________

Last edited by HamletEagle; 10-07-2016 at 12:36.
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: ro
Old 10-07-2016 , 22:20   Re: Counter-Strike Pick Up Manager
Reply With Quote #8

ok, before start, the modification i've made are all 'here' so give a look.

All things done, just:

4. What do you mean, i don't understand Inside of plugin_init, above of the cvar registration add a comment what each value of the cvar it does?

5.
about !read_argv .. i would like to keep this one because it is also specify about amx_cspum_keylist and lead the admins in 'how to use' it. i hope you understand my points, anyway i would like to leave it but you decide so i'm wait your answer.

8. It is not needed.

The loop already skip 'empty spaces' because i check if ... i < sizeof( gKeyList ) , so is not more needed.

9. I just note that, but i have a big problem, i don't know how to insert/block the armor.

As you see , i didn't added in the key list, and is not having an index that weapon, i try to touch it and print the ID and on fy_snow is show my '32' and '22' ? ( Wich 22 is M4a1 ).

Anyway, don't bother with this, i wil read your tutorial about armoury and find a way, just tell my about the modification i've maded if they're fine.
__________________
Project: Counter-Strike Dragon Ball Mod (csdb) [done: 0%]

Last edited by Craxor; 10-07-2016 at 22:31.
Craxor is offline
Send a message via ICQ to Craxor
Craxor
Veteran Member
Join Date: Jan 2016
Location: ro
Old 11-10-2016 , 19:11   Re: Counter-Strike Pick Up Manager
Reply With Quote #9

Any modder/approver can move this in Plugins Review or something like this?

I have no time to continue update this one for a while, because i need to move on from Great UK back to roumania so i will be realy busy in real life, i'm waiting an response, thank you all .
__________________
Project: Counter-Strike Dragon Ball Mod (csdb) [done: 0%]
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-13-2016 , 15:11   Re: Counter-Strike Pick Up Manager
Reply With Quote #10

It will be unapproved until you do the requested changes and PM me.
__________________
HamletEagle 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 07:29.


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