Raised This Month: $51 Target: $400
 12% 

Subplugin Submission [ZP] Choose the survivor weapon 2.0 [10/06/13]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-12-2009 , 12:05   [ZP] Choose the survivor weapon 2.0 [10/06/13]
Reply With Quote #1

[ZP] Choose the survivor weapon 2.0
[Zombie Plague 4.2/4.3 & 5.* compatibility]

Description:
When you are a survivor, this plugin will show you a menu
where you can choose the primary weapon or random weapon

Cvar:
zp_cws_enable- Enables/disables the plugin.

Commands:
zp_cws_add_weapon <Weapon Name> <weapon_*> - Add weapon
- <Weapon Name> Ex: "Ak-47", "Glock 18", "Gold Ak-47" (If you have custom weapons available for survivor)
- <weapon_*> See weapon_* constants here

Ex: zp_cws_add_weapon "Dual MP5 Navy" weapon_mp5navy
Don't forget to put quotes in Weapon Name

IMPORTANT !
If you add a wrong weapon_* or you add only one weapon, the plugin doesn't work
Check server console to check which are wrong

Installation:
- Compile sma
- Put compiled plugin into \cstrike\addons\amxmodx\plugins
- Put zp_cws_weapons.cfg into \cstrike\addons\amxmodx\configs
- If you want change weapons, open zp_cws_weapons.cfg

Changelog:
HTML Code:
1.6 - First Version
1.6.1 - Optimized Code (Thanks Nextra :D)
1.7 - Fixed some errors and now survivor have unlimited clip
2.0 - Fully rewritten code. Now it's more optimized, clean and customizable
    - Removed secondary weapon
    - ML deleted
Bugs or Suggestions:
Post it in this thread or send me PM

To do:
- Remove weapons by another command like zp_cws_remove_weapon

Notes:

-If you use Zombie Plague 5.*, download zp_cws50.sma, if you use Zombie Plague 4.2 or 4.3, download zp_cws42-43.sma
-Added weapons will appears in the next round
-Default weapons: M249, Ak-47, M3, XM1014, Deagle

Servers running this plugin

V1.6: +100 downloads
V1.6.1: +140 downloads
V1.7: +8300 downloads

Enjoy my plugin and my english without translator (I hope it's fine)
Attached Thumbnails
Click image for larger version

Name:	cws.JPG
Views:	9101
Size:	73.2 KB
ID:	126537  
Attached Files
File Type: sma Get Plugin or Get Source (zp_cws42-43.sma - 4466 views - 4.5 KB)
File Type: sma Get Plugin or Get Source (zp_cws50.sma - 3522 views - 4.3 KB)
File Type: cfg zp_cws_weapons.cfg (387 Bytes, 2986 views)
__________________

Last edited by alan_el_more; 10-30-2013 at 07:29. Reason: Updated plugin
alan_el_more is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 04-12-2009 , 12:18   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #2

Nice,

Yeah, ML is needed here
crazyeffect is offline
Send a message via MSN to crazyeffect
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-12-2009 , 12:46   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #3

Added ML
Translations:
https://forums.alliedmods.net/showthread.php?t=89956
__________________
alan_el_more is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 04-12-2009 , 12:56   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #4

There's a way easier way!!!!

PHP Code:
  case 1:
  {
   
drop_weapons(id1)
   
fm_give_item(id"weapon_m249")
   
client_print(idprint_chat"[CWS] %L M249"id"CHOOSE_WEAPON")
   if(
get_pcvar_num(pcvar_secondary))
    
mostrarmenu2(id)
  } 
And then just one line in the ML file!

Quote:
CHOOSE_WEAPON = You have chosen
Attached Files
File Type: sma Get Plugin or Get Source (here.sma - 2000 views - 8.0 KB)
File Type: txt here.txt (157 Bytes, 794 views)

Last edited by crazyeffect; 04-12-2009 at 13:01.
crazyeffect is offline
Send a message via MSN to crazyeffect
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-12-2009 , 12:57   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #5

Quote:
Originally Posted by crazyeffect View Post
There's a way easier way!!!!

PHP Code:
  case 1:
  {
   
drop_weapons(id1)
   
fm_give_item(id"weapon_m249")
   
client_print(idprint_chat"[CWS] %L M249"id"CHOOSE_WEAPON")
   if(
get_pcvar_num(pcvar_secondary))
    
mostrarmenu2(id)
  } 
And then just one line in the ML file!
thanks
__________________
alan_el_more is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 04-12-2009 , 13:02   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #6

I don't like copy-paste
crazyeffect is offline
Send a message via MSN to crazyeffect
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-12-2009 , 15:59   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #7

Code:
[de]
CHOOSE_WEAPON = Du hast gewaehlt:
CHOOSE_RANDOM_WEAPON = wurde zufaellig ausgewaehlt.
Example how you can do the menu handling much easier and readable:

PHP Code:
new const primaries[][] =
{
    
"weapon_m249",
    
"weapon_m4a1",
    
"weapon_ak47",
    
"weapon_mp5navy"
}

new const 
primarynames[][] =
{
    
"M249",
    
"M4A1",
    
"AK-47",
    
"MP5"
}

public 
mostrarmenu(id)
{
    new 
menu menu_create("\rChoose the weapon \yprimary \rsurvivor:""mostrar_cliente")
    
    
menu_additem(menu"\yM249""0"0)
    
menu_additem(menu"\yM4a1""1"0)
    
menu_additem(menu"\yAK47""2"0)
    
menu_additem(menu"\yMP5""3"0)
    
menu_additem(menu"\yRandom""4"0)
    
    
menu_display(idmenu0)
}

public 
mostrar_cliente(idmenuitem)
{
    new 
data[6], iName[2];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata,5iName1callback );
    new 
choice str_to_num(data);
    
    if( 
choice == )
        
choice random_num0);
    
    
drop_weaponsid);
    
fm_give_itemidprimaries[choice] );
    
client_printidprint_chat"[CWS] %L %s"id"CHOOSE_WEAPON"primarynames[choice] );
    
    if( 
get_pcvar_numpcvar_secondary ) )
        
mostrarmenu2id );
    
    
menu_destroymenu );
    
    return 
PLUGIN_HANDLED;

__________________
In Flames we trust!

Last edited by Nextra; 04-12-2009 at 16:08.
Nextra is offline
dorin2oo7
Senior Member
Join Date: Jun 2008
Location: Sibiu, Romania
Old 04-12-2009 , 22:11   Re: [ZP] Choose the weapons survivor 1.6
Reply With Quote #8

Romanian Translation

Code:
[ro]
CHOOSE_WEAPON = Ai ales
CHOOSE_RANDOM_WEAPON = a fost aleasa aleator
__________________
dorin2oo7 is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 05-31-2009 , 12:47   Re: [ZP] Choose the weapons survivor 1.6.1
Reply With Quote #9

Plugin updated to 1.6.1. Check main post.
__________________
alan_el_more is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 06-26-2009 , 09:18   Re: [ZP] Choose the weapons survivor 1.7
Reply With Quote #10

Plugin updated at version 1.7!!!
__________________
alan_el_more is offline
Reply



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:02.


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