Raised This Month: $ Target: $400
 0% 

My WeaponMenu Doesn't work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-20-2005 , 01:42  
Reply With Quote #2

Umm, try this:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {   register_plugin("Weapon Menu", "0.10", "NiGHTFiRE")   register_menucmd(register_menuid("\yWhich Weapon?"), 1023, "giveWeapon")   register_clcmd("giveme","showWeaponMenu", ADMIN_SLAY, "Shows the menu for giving weapons")   register_clcmd("say /giveme","showWeaponMenu", ADMIN_SLAY, "Shows the menu for giving weapons")   return PLUGIN_CONTINUE } public showWeaponMenu(id) {     new szMenuBody[256]     new keys     new len = format(szMenuBody, 255, "\yWhich weapon?:^n")     len += format(szMenuBody[len], 255-len, "^n\w1. AK-47")     len += format(szMenuBody[len], 255-len, "^n\w2. M4A1")     len += format(szMenuBody[len], 255-len, "^n\w3. AWP")     len += format(szMenuBody[len], 255-len, "^n\w4. Deagle")     len += format(szMenuBody[len], 255-len, "^n^n\w0. Exit")     keys = (1<<0|1<<1|1<<2|1<<3|1<<9)         show_menu(id, keys, szMenuBody, -1)     return PLUGIN_CONTINUE } public giveWeapon(id, key) {     switch(key) {         case 0:         {             give_item(id, "weapon_ak47")         }         case 1: {             give_item(id, "weapon_m4a1")         }         case 2: {             give_item(id, "weapon_awp")         }         case 3: {             give_item(id, "weapon_deagle")         }     }     return PLUGIN_HANDLED }

Also, I changed all of those else if's into one simple switch statement.

*Edited (x2)*
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 14:14.


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