Raised This Month: $ Target: $400
 0% 

Weapon Storage version 1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
kinsprite2
Junior Member
Join Date: Mar 2006
Old 09-18-2006 , 03:11   Weapon Storage version 1.1
Reply With Quote #1

Weapon Storage version 1.1, by KinSprite

[Description]:

With this plugin, you can drop a weapon model that can provide a number of weapons each round. When a player touch this entity, he may get a weapon/item on condition that such as touch a weapon in fy_iceworld. Also, you can set the cvar to allow multi weapons .
A storage has two parameters . 1, belong to which team (Terrorist, CT or All teams); 2, provide how many weapons in this model.
You can save these options in map config file loaded when change map.
The menu command "ws_menu" is powerful. You can drop a storage in front of you ; remove a storage aimed at; remove all storages in the map; clear storage options saved in the map config file.

[Required Modules]:

1. Engine
2. Fun
3. Cstrike

[Installation]:

1. copy weaponstorage.sam to "addons/amxmodx/amxmodx/scripting"; weaponstorage.txt" to "<amxx_datadir> (default is "addons/amxmodx/data")/lang"
2. compile weaponstorage.sam
3. copy "addons/amxmodx/scripting/compiled/weaponstorage.amxx" to <amxx_pluginsdir> (default is "addons/amxmodx/plugins")
4. in <amxx_plugins> (default is "addons/amxmodx/configs/plugins.ini") add a line "weaponstorage.amxx"
5. in "<amxx_configsdir>(default is "addons/amxmodx/configs")/amxx.cfg" config the Cvars.

[Commands]:

[Admin CMD]

ws_menu
// - Show Weapon Storage Menu

amx_weaponstorage_menu
// - Show Weapon Storage Menu, the same as "ws_menu"

amx_weaponstorage_drop
// - Drop weapons in world and Save for the map?
// [USAGE]: amx_weaponstorage_drop <wpnID> <team> <amount> [SAVE]

amx_weaponstorage_clear
// - Clear weapon storages in the map

amx_weaponstorage_clmapcfg
// - Clear weapon storages' option in the map config file


[Server CMD]

amx_createweaponstorage
// - Drop weapons in world
// amx_createweaponstorage <wpnID> <team> <amount> <Float:Origin[3]> <Float:Angles[3]>

[Cvars]:

amx_weaponstorage "1"
// Use this plugin's effect. To disable, set to 0
amx_weaponstorage_allowmulti "0"
// allow multi weapons, set to 1
amx_weaponstorage_c4ct "0"
// allow CT pick up C4 in C4 storage, set to 1
amx_weaponstorage_ctplant "0"
// allow CT plant C4 when pick up C4 in C4 storage, set 1
amx_weaponstorage_kitt "0"
// allow Terrorist pick up defuse kit in kit storage, set 1

[Log]:
v1.1, add item Nightvision Goggles
use cs_get_user_shield() instead of custom stock function.
use register_touch() instead of pfn_touch(), and optimize this function.
use static flag ADMIN_IMMUNITY instead.

v1.0, finished on 9/18, 2006

[Weapons or Items list]:
1. Weapons: all Counter-Strike weapons
2. Items: Kevlar Vest, Kevlar Vest & Helmet, Nightvision Goggles, Defuse Kit, Long Jump, Medical Kit.
Attached Thumbnails
Click image for larger version

Name:	de_dust2_cz0000.jpg
Views:	9654
Size:	47.4 KB
ID:	10875  
Attached Files
File Type: txt weaponstorage.txt (8.0 KB, 1679 views)
File Type: sma Get Plugin or Get Source (weaponstorage.sma - 3321 views - 35.5 KB)

Last edited by kinsprite2; 09-21-2006 at 03:44.
kinsprite2 is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 09-18-2006 , 06:24   Re: Weapon Storage version 1.0
Reply With Quote #2

强啊 KinSprite
学习一下,谢谢

+Karma
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
ThomasNguyen
Senior Member
Join Date: May 2006
Old 09-18-2006 , 07:47   Re: Weapon Storage version 1.0
Reply With Quote #3

This sounds 1337. I still dont get the description though. more detail? so im guessing when you save a gun to the storage for that map, a player can get that certain gun out of the storage?
__________________
ThomasNguyen is offline
kinsprite2
Junior Member
Join Date: Mar 2006
Old 09-18-2006 , 09:26   Re: Weapon Storage version 1.0
Reply With Quote #4

Quote:
Originally Posted by ThomasNguyen View Post
This sounds 1337. I still dont get the description though. more detail? so im guessing when you save a gun to the storage for that map, a player can get that certain gun out of the storage?
An entity is a storage. In its structure, there is what kind of weapon or item a player can get out of it, the amount it can provide, whitch team it belongs to, and the amount remains.
kinsprite2 is offline
spinaczsoft
Junior Member
Join Date: Jan 2006
Old 09-18-2006 , 14:30   Re: Weapon Storage version 1.0
Reply With Quote #5

You are amazing !

+karma
spinaczsoft is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 09-18-2006 , 19:33   Re: Weapon Storage version 1.0
Reply With Quote #6

gj, however the name is misleading
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-18-2006 , 21:26   Re: Weapon Storage version 1.0
Reply With Quote #7

I really couldn't find anything wrong with your code, except for little things here and there. Heres what could be improved, recomended, but doesn't have to be done.

1) Use new menu system (menu_create(), etc).
2)
Code:
public pfn_touch(ent, player)
Instead use register_think() to create a hook to the entity's think.
3)
Code:
    if ( id && !(get_user_flags(id) & get_admin_flag()) ){         console_print(id, "%L", id, "HAVE_NO_ACCESS", PLUGIN_NAME)         return PLUGIN_HANDLED     }

You could replace this with a cmd_access() check.

4)
Code:
    if (!get_pcvar_num(g_weaponstorage) && !id)
Thats all that was really obvious.

Other than that, good Job .
+karma
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
kinsprite2
Junior Member
Join Date: Mar 2006
Old 09-19-2006 , 03:11   Re: Weapon Storage version 1.0
Reply With Quote #8

Thank you for your advice. I will rewrite this plugin.

The next version will use register_touch() and fix / optimize the script. The admin flag , I think it's ok. In new menu system, there are only 7 items to a page. But, the plugin needs 8 items to display.

Last edited by kinsprite2; 09-21-2006 at 03:55.
kinsprite2 is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 09-19-2006 , 05:41   Re: Weapon Storage version 1.0
Reply With Quote #9

yes, register_touch() will save more cpu usage.
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
Deepcho
Junior Member
Join Date: May 2006
Old 12-12-2006 , 16:16   Re: Weapon Storage version 1.1
Reply With Quote #10

*** [Fail]: fail to wirte text into the map config file "de_dust2.cfg"
[Weapon Storage] Admin: "hatenoobs" create "Tactical Shield" for "All teams" (Amount: 1)

HELP ;-\

where must be "de_dust2.cfg" file ???

i have looked the path in the .sma file but i dont understand.. help please
Deepcho 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 20:31.


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