Page 1 of 1

Cerere modificare plugin

Posted: 17 Dec 2013, 00:49
by HBK2310

Code: Select all

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Weapon Menu"
#define VERSION "1.0"
#define AUTHOR "fxfighter"
#define EDITOR "dipl.ing.Ju(R)a"

enum _:WeaponData
{
    wInfo[ 20 ],
    wName[ 20 ],
    wBpammo
}

new g_PrimaryWeapon[ ][ WeaponData ] =
{
    { "M4A1", "weapon_m4a1", 90 },
    { "AK47", "weapon_ak47", 90 },
    { "AWP", "weapon_awp", 30 },
    { "MP5", "weapon_mp5navy", 90 },
    { "M3", "weapon_m3", 32 },
    { "MAC10", "weapon_mac10", 90 },
    { "M249", "weapon_m249", 200 },
    { "GALIL", "weapon_galil", 90 },
    { "P90", "weapon_p90", 90 },
    { "SG552", "weapon_sg552", 90 },
    { "SCOUT", "weapon_scout", 90 }
}


new g_SecondaryWeapon[ ][ WeaponData ] =
{
	{ "DEAGLE", "weapon_deagle", 35 },
    { "USP", "weapon_usp", 100 },
    { "P228", "weapon_p228", 52 },
    { "ELITE", "weapon_elite", 120 }
}

new g_PrimaryMenu
new g_SecondaryMenu

public plugin_init( ) 
{
    RegisterHam( Ham_Spawn, "player", "Fw_PlayerSpawnPost", 1 )
    
    g_PrimaryMenu = menu_create( "Primary Weapon", "PrimaryHandler" )
    g_SecondaryMenu = menu_create( "Secondary Weapon", "SecondaryHandler" )
    
    for ( new i; i < sizeof g_PrimaryWeapon; i++ )
        menu_additem( g_PrimaryMenu, g_PrimaryWeapon[ i ][ wInfo ] )
        
    for ( new i; i < sizeof g_SecondaryWeapon; i++ )
        menu_additem( g_SecondaryMenu, g_SecondaryWeapon[ i ][ wInfo ] )
}

public Fw_PlayerSpawnPost( id )
{
     if(!is_user_alive(id))
          return PLUGIN_HANDLED;

     menu_display(id, g_PrimaryMenu);
     return PLUGIN_HANDLED;
}

public PrimaryHandler( id, menu, item )
{
    if ( item == MENU_EXIT )
        return PLUGIN_HANDLED
        
    strip_user_weapons( id )    
    give_item( id, "weapon_knife" ) 
    give_item( id,  g_PrimaryWeapon[ item ][ wName ] )  
    cs_set_user_bpammo( id, get_weaponid( g_PrimaryWeapon[ item ][ wName ] ), g_PrimaryWeapon[ item ][ wBpammo ] )
    
    menu_display( id, g_SecondaryMenu )
        
    return PLUGIN_HANDLED
}

public SecondaryHandler( id, menu, item )
{
    if ( item == MENU_EXIT )
        return PLUGIN_HANDLED
        
    give_item( id,  g_SecondaryWeapon[ item ][ wName ] )
    cs_set_user_bpammo( id, get_weaponid( g_SecondaryWeapon[ item ][ wName ] ), g_SecondaryWeapon[ item ][ wBpammo ] )
            
    return PLUGIN_HANDLED
}  
Vreau daca se poate dupa ce mor sa fie ca la respawn.In loc sa apas pe 1-1-1 sa iau arma, sa apas pe 2 sa ia setarile trecute, sau 3 sa numai apara meniul, iar arma sa se ia automat.

Re: Cerere modificare plugin

Posted: 17 Dec 2013, 18:10
by sUperstar
Mutat in sectiunea corespunzatoare!

1.5. Daca doriti MODIFICAREA unui plugin, postati la ACEASTA sectiune.

Re: Cerere modificare plugin

Posted: 09 Jan 2014, 15:14
by h4wk
TOPIC INCHIS !
MOTIV : Titlul trebuie sa fie concis si sa reflecte, pe cat de mult posibil, continutul. Nu mai sunt acceptate titlurile de genul "Cerere modificare plugin".