Raised This Month: $ Target: $400
 0% 

(help) What's wrong with my menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
keyblade
Member
Join Date: Nov 2010
Location: China
Old 11-27-2010 , 05:46   (help) What's wrong with my menu
Reply With Quote #1

This is my code:

Code:
 
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "weapons shop"
#define VERSION "1.0"
#define AUTHOR "Ice-Action |#KeyBlade"

public plugin_init()
{
      register_plugin(PLUGIN, VERSION, AUTHOR)
      new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
      register_menucmd(register_menuid("choose weapons"), keys, "giveWeapon")
      register_clcmd("say /bw", "showWeaponMenu")
}

public showWeaponMenu(id)
{
    new menu[192]
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
    format(menu, 191, "choose weapons^n^n1-AK47^n2-M4A1^n3-AWP^n^n^n^n^n^n^n^n0-Exit")
    show_menu(id, keys, menu)
    return PLUGIN_HANDLED
}

public giveWeapon(id, key)
{
    if (key == 0)
    {
         give_item(id, "weapon_ak47")
    } else if (key == 1) {
         give_item(id, "weapon_m4a1")
    } else if (key == 2) {
         give_item(id, "weapon_awp")
    }
}
I press 3 in the game but I can't get AWP.What's wrong?

I'm a script beginner.Sorry for my bad english.
keyblade is offline
 



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 11:17.


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