AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help Anti Furien Weapon Menu (https://forums.alliedmods.net/showthread.php?t=246272)

weez 08-14-2014 17:31

Help Anti Furien Weapon Menu
 
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 }
*/

zmd94 08-14-2014 20:32

Re: Help Anti Furien Weapon Menu
 
You can use this plugin:
Now, you can easily modify and rearrange your weapon menu. ;)

HamletEagle 08-15-2014 02:20

Re: Help Anti Furien Weapon Menu
 
Quote:

Originally Posted by zmd94 (Post 2184138)
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.

zmd94 08-15-2014 02:53

Re: Help Anti Furien Weapon Menu
 
Quote:

Originally Posted by HamletEagle (Post 2184198)
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. ;)

HamletEagle 08-15-2014 04:01

Re: Help Anti Furien Weapon Menu
 

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.

zmd94 08-15-2014 05:04

Re: Help Anti Furien Weapon Menu
 
@ HamletEagle, thank you for the explanation. I appreciate it as I can learn a lot from it. ;)


All times are GMT -4. The time now is 13:21.

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