AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Choose the survivor weapon 2.0 [10/06/13] (https://forums.alliedmods.net/showthread.php?t=89955)

alan_el_more 04-12-2009 12:05

[ZP] Choose the survivor weapon 2.0 [10/06/13]
 
4 Attachment(s)
[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)

crazyeffect 04-12-2009 12:18

Re: [ZP] Choose the weapons survivor 1.6
 
Nice,

Yeah, ML is needed here :P

alan_el_more 04-12-2009 12:46

Re: [ZP] Choose the weapons survivor 1.6
 
Added ML
Translations:
https://forums.alliedmods.net/showthread.php?t=89956

crazyeffect 04-12-2009 12:56

Re: [ZP] Choose the weapons survivor 1.6
 
2 Attachment(s)
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

alan_el_more 04-12-2009 12:57

Re: [ZP] Choose the weapons survivor 1.6
 
Quote:

Originally Posted by crazyeffect (Post 803800)
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 :D

crazyeffect 04-12-2009 13:02

Re: [ZP] Choose the weapons survivor 1.6
 
I don't like copy-paste :D

Nextra 04-12-2009 15:59

Re: [ZP] Choose the weapons survivor 1.6
 
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;



dorin2oo7 04-12-2009 22:11

Re: [ZP] Choose the weapons survivor 1.6
 
Romanian Translation

Code:

[ro]
CHOOSE_WEAPON = Ai ales
CHOOSE_RANDOM_WEAPON = a fost aleasa aleator


alan_el_more 05-31-2009 12:47

Re: [ZP] Choose the weapons survivor 1.6.1
 
Plugin updated to 1.6.1. Check main post.

alan_el_more 06-26-2009 09:18

Re: [ZP] Choose the weapons survivor 1.7
 
Plugin updated at version 1.7!!!


All times are GMT -4. The time now is 14:48.

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