Raised This Month: $ Target: $400
 0% 

Help Anti Furien Weapon Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
weez
Junior Member
Join Date: Jul 2014
Old 08-14-2014 , 17:31   Help Anti Furien Weapon Menu
Reply With Quote #1

How to add new weapons in the weapon menu for furien.
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < ColorChat >


native give_weapon_oicw ( id );
native give_weapon_plasma ( id );
native give_weapon_balrog3 ( id );
native give_ethereal_wpn ( id );
native give_weapon_cannon ( id );

#define PLUGIN "CSO Weapons"
#define VERSION "1.0"
#define AUTHOR "Ionutz."


new bool: AlreadyChoose[ 33 ];


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

RegisterHam( Ham_Spawn, "player", "fwPlayerSpawn", 1 );

register_clcmd( "say /weapons", "ClcmdWeaponsMenus" );
}

public fwPlayerSpawn( id ) {
if( get_user_team ( id ) == 2 ) {

AlreadyChoose[ id ] = false;
ShowWeaponsMenu ( id );
}
return 0;
}


public ShowWeaponsMenu ( id ) {

new menu = menu_create ( "\yAnti-Furien\r Weapons Menu", "FurienWeaponsHandler" );
menu_additem ( menu , "\yOICW", "1" , 0 );
menu_additem ( menu , "\yBalrog \rIII", "2", 0 );
menu_additem ( menu , "\yPlasma \rGun", "3", 0 );
menu_additem ( menu , "\yDragon \rCannon", "4", 0 );
menu_additem ( menu , "\yEthereal", "5", 0 );

menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
menu_display ( id, menu, 0 );

return 1;
}

public FurienWeaponsHandler( id, menu, item ) {
if ( get_user_team ( id ) != 2 ) return 1;

if( item == MENU_EXIT )
{
menu_destroy ( menu )
return PLUGIN_HANDLED
}
switch( item )
{

case 0:
{
give_weapon_oicw (id);
AlreadyChoose[ id ] = true;

}

case 1:
{
give_weapon_balrog3 (id);
AlreadyChoose[ id ] = true;
}
case 2:
{
give_weapon_plasma (id);
AlreadyChoose[ id ] = true;
}
case 3:
{
give_weapon_cannon (id);
AlreadyChoose[ id ] = true;
}
case 4:
{
give_ethereal_wpn (id);
AlreadyChoose[ id ] = true ;
}
}
menu_destroy( menu )
return 1;
}
public ClcmdWeaponsMenus( id )
{
if( !is_user_alive( id ) ) {
ColorChat( id, GREEN, "^x01[^x04 Furien Weapons^x01 ] Nu poti alege arme cand esti mort!" );
return 1;
}

if( AlreadyChoose[ id ] ) {
ColorChat( id, GREEN, "^x01[^x04 Furien Weapons^x01 ] Ti-ai ales armele runda acesta" );
return 1;
}

if( get_user_team( id ) == 2 ) {
ShowWeaponsMenu( id );
}
return 1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
__________________

Last edited by weez; 08-14-2014 at 17:32.
weez is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-14-2014 , 20:32   Re: Help Anti Furien Weapon Menu
Reply With Quote #2

You can use this plugin:
Now, you can easily modify and rearrange your weapon menu. ;)

Last edited by zmd94; 08-14-2014 at 20:33.
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-15-2014 , 02:20   Re: Help Anti Furien Weapon Menu
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
You can use this plugin:
Now, you can easily modify and rearrange your weapon menu. ;)
Not really, he is using cso weapons.... it would be a pain to edit the plugin so it will work with them.
__________________

Last edited by HamletEagle; 08-15-2014 at 02:21.
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-15-2014 , 02:53   Re: Help Anti Furien Weapon Menu
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
Not really, he is using CSO weapons. It would be a pain to edit the plugin so it will work with them.
Maybe, he can give it a try. ;)
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-15-2014 , 04:01   Re: Help Anti Furien Weapon Menu
Reply With Quote #5


I'm 99% sure that this is impossible, without some changes. This is how it works:
  • Take weapon name from file( let's say AK47 )
  • Convert it to lower( ak47 )
  • Format a string to weapon_( weapon_ak47 )
  • Give the weapon
  • Get weapon id from weapon name( CSW_AK47 )
  • Set bpammo

If you write PlasmaGun, it will become weapon_plasmagun that doesn't exists. Yes, cso weapons just change the proprieties of already existing weapons, so you could edit cso source to apply the effects when a player get the needed weapons, BUT it the menu it cannot be the cso weap name.
It is possible to add a new field in the file: NameForMenu or sth like this. So, you will have PlasmanGun as name for menu, and the weapon that it's replace as a weapon for formating and for doing boring stuffs. Then, you can use xvar/bool/forward/even a native to know when a player get the weapon from the menu and apply effects.

On Topic: use php or small tags around the code.
__________________

Last edited by HamletEagle; 08-15-2014 at 09:33.
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-15-2014 , 05:04   Re: Help Anti Furien Weapon Menu
Reply With Quote #6

@ HamletEagle, thank you for the explanation. I appreciate it as I can learn a lot from it. ;)
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 13:21.


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