Raised This Month: $ Target: $400
 0% 

Weapon Menu V2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
JeSa
Junior Member
Join Date: May 2011
Old 05-03-2011 , 17:38   Weapon Menu V2
Reply With Quote #1

Description: When you type /weapon he shows you a Menu of Weapons u can get of course that will cost you
CVARS:
None

.SMA
Code:
#include <amxmodx> 
#include <fun> 
#include <colorchat>
#include <cstrike>

#define PLUGIN "Weapon"  
#define VERSION "v2"  
#define AUTHOR "JeSa or NikolaJ"  

public plugin_init() 
{ 
    register_clcmd("say /weapon","weaponmenu") 
} 

public weaponmenu(id) 
{ 
    new prim_weaponmenu = menu_create("yPick a weapon:", "giveweapon") 

    menu_additem(prim_weaponmenu, "wM4A1", "1", 0); 
    menu_additem(prim_weaponmenu, "wAK47", "2", 0); 
    menu_additem(prim_weaponmenu, "wScout", "3", 0); 
    menu_additem(prim_weaponmenu, "wAwp", "4", 0); 
    menu_additem(prim_weaponmenu, "wMp5", "5", 0); 
    menu_additem(prim_weaponmenu, "wM249", "6", 0); 
    menu_additem(prim_weaponmenu, "wM3", "7", 0);
    menu_additem(prim_weaponmenu, "wDeagle", "8", 0);
    menu_additem(prim_weaponmenu, "wGlock18", "9", 0);
    menu_additem(prim_weaponmenu, "wUSP", "10", 0);
         
    menu_setprop(prim_oruzjemenu, MPROP_EXIT, MEXIT_ALL); 
    menu_display(id, prim_weaponmenu, 0); 
    return PLUGIN_HANDLED 
} 

public sub_primgun_menu(id, prim_weaponmenu, item) 
{ 
     
    if (item == MENU_EXIT) 
    { 
        menu_destroy(prim_oruzjemenu); 
        return PLUGIN_HANDLED; 
    } 
     
    new Data[7], Name[64]; 
    new Access, Callback; 
    menu_item_getinfo(prim_weaponmenu, item, Access, Data,5, Name, 63, Callback); 
     
    new Key = str_to_num(Data); 
     
    switch (Key) 
    { 
        case 1: 
        { 
            give_item(id, "weapon_m4a1") 
            cs_set_user_money(id, cs_get_user_money(id) - 2500) 
            ColorChat(id, TEAM_COLOR, "You got an M4A1") 
             
        } 
        case 2:  
        { 
            give_item(id, "weapon_ak47") 
            cs_set_user_money(id, cs_get_user_money(id) - 2300) 
            ColorChat(id, TEAM_COLOR, "You got an AK47") 
        } 
        case 3: 
        { 
            give_item(id, "weapon_scout") 
            cs_set_user_money(id, cs_get_user_money(id) - 2000) 
            ColorChat(id, TEAM_COLOR, "You got an Scout") 
        } 
        case 4: 
        { 
            give_item(id, "weapon_awp") 
            cs_set_user_money(id, cs_get_user_money(id) - 5000) 
            ColorChat(id, TEAM_COLOR, "You got an Awp") 
         }    
        case 5: 
        { 
            give_item(id, "weapon_mp5navy") 
            cs_set_user_money(id, cs_get_user_money(id) - 1500) 
            ColorChat(id, TEAM_COLOR, "You got an MP5") 
        }       
        case 6: 
        { 
            give_item(id, "weapon_m249") 
            cs_set_user_money(id, cs_get_user_money(id) - 5700) 
            ColorChat(id, TEAM_COLOR, "You got an Krmacu") 
        } 
        case 7: 
        { 
            give_item(id, "weapon_m3") 
            cs_set_user_money(id, cs_get_user_money(id) - 1000) 
            ColorChat(id, TEAM_COLOR, "You got an M3") 
        } 
        case 8: 
        { 
            give_item(id, "weapon_deagle") 
            cs_set_user_money(id, cs_get_user_money(id) - 800) 
            ColorChat(id, TEAM_COLOR, "You got an Deagle") 
        } 
        case 9: 
        { 
            give_item(id, "weapon_glock18") 
            cs_set_user_money(id, cs_get_user_money(id) - 5700) 
            ColorChat(id, TEAM_COLOR, "You got an GLOCK") 
        } 
        case 10: 
        { 
            give_item(id, "weapon_usp") 
            cs_set_user_money(id, cs_get_user_money(id) - 5700) 
            ColorChat(id, TEAM_COLOR, "You got an USP") 
        } 
    } 
     
    menu_destroy(prim_weaponmenu); 
    return PLUGIN_HANDLED; 
}

Last edited by JeSa; 05-05-2011 at 12:50.
JeSa is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-03-2011 , 17:47   Re: Weapon Menu V2
Reply With Quote #2

Redundant, useless, unapproved.

At least try to make something more dynamic, and check player money before taking it and give a weapon...


Last, don't attach .amxx file, it is forbidden.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-03-2011 at 17:49.
ConnorMcLeod is offline
JeSa
Junior Member
Join Date: May 2011
Old 05-04-2011 , 10:22   Re: Weapon Menu V2
Reply With Quote #3

Sry i am new in making plugins

And tnx
And one more
What to attach then?
JeSa is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 05-04-2011 , 11:11   Re: Weapon Menu V2
Reply With Quote #4

Quote:
Originally Posted by JeSa View Post
Sry i am new in making plugins

And tnx
And one more
What to attach then?
the sma
__________________
vato loco [GE-S] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-04-2011 , 11:31   Re: Weapon Menu V2
Reply With Quote #5

Something i hadn't see before :

PHP Code:
    new prim_oruzjemenu menu_create("yPick a weapon:""giveweapon"

    
menu_additem(prim_weaponmenu"wM4A1""1"0); 
You changed the menu index variable name and forgot to updated it in each occurence.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
JeSa
Junior Member
Join Date: May 2011
Old 05-04-2011 , 11:43   Re: Weapon Menu V2
Reply With Quote #6

Ok but what to atach
When i put a plugin?
JeSa is offline
JeSa
Junior Member
Join Date: May 2011
Old 05-04-2011 , 12:40   Re: Weapon Menu V2
Reply With Quote #7

I dint saw his post
I will change it
JeSa is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 05-04-2011 , 16:52   Re: Weapon Menu V2
Reply With Quote #8

Thnx.

This plugin make not Say /weapon this menu the beginning of each hand to ask?
__________________
Erdener is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 05-04-2011 , 17:04   Re: Weapon Menu V2
Reply With Quote #9

and make only CT ?
__________________
Erdener is offline
JeSa
Junior Member
Join Date: May 2011
Old 05-05-2011 , 12:50   Re: Weapon Menu V2
Reply With Quote #10

Tnx alot i changed
JeSa is offline
Old 06-02-2011, 17:11
MuzzMikkel
This message has been deleted by Exolent[jNr]. Reason: Spam
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 00:28.


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