Raised This Month: $51 Target: $400
 12% 

Convert to Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 06:25   Convert to Menu
Reply With Quote #1

Hello, with my new plugin release TFC WEAPONS I need a menu instead of players having to type it all. When the say /weapons it should bring up the menu.
Could somebody please convert my code to a menu? Please.
(REGULAR CODE)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <fun>

#define PLUGIN "TFC Weapons"
#define VERSION "1.0"
#define AUTHOR "Phantom Warrior"

public plugin_init() {
    
register_plugin("WeaponMe","0.1","Phantom Warrior)"
    
register_clcmd("say needrocket","fnSayNeedRocket")
    
register_clcmd("say needshotgun","fnSayNeedShotGun")
    
register_clcmd("say needknife","fnSayNeedKnife")
    
register_clcmd("say needsniper","fnSayNeedSniper")
    
register_clcmd("say needautorifle","fnSayNeedAutoRifle")
    
register_clcmd("say needflamer","fnSayNeedFlamer")
    
register_clcmd("say needrail","fnSayNeedRail")
    
register_clcmd("say needmedkit","fnSayNeedMedkit")
    
register_clcmd("say needac","fnSayNeedAc")
   
}

public 
fnSayNeedRocket(id) {
    
give_item(id"tf_weapon_rpg")
    
tfc_setbammo(idTFC_AMMO_ROCKETS,25)
    
client_cmd(id"tf_weapon_rpg")
    
}

public 
fnSayNeedKnife(id) {
    
give_item(id,"tf_weapon_knife")
    
client_cmd(id,"tf_weapon_knife")
    
}

public 
fnSayNeedShotGun(id) {
    
give_item(id"tf_weapon_shotgun")
    
client_cmd(id"tf_weapon_shotgun")
   
   }
   
  public 
fnSayNeedSniper(id) {
       
give_item(id"tf_weapon_sniperrifle")
    
client_cmd(id"tf_weapon_sniperrifle")
    
}

public 
fnSayNeedAutoRifle(id) {
    
give_item(id"tf_weapon_autorifle")
    
client_cmd(id"tf_weapon_autorifle")
    
}

public 
fnSayNeedFlamer(id) {
    
give_item(id"tf_weapon_flamethrower")
    
client_cmd(id"tf_weapon_flamethrower")
    
}

public 
fnSayNeedRail(id) {
    
give_item(id"tf_weapon_railgun")
    
client_cmd(id"tf_weapon_railgun")
    
}

public 
fnSayNeedMedKit(id) {
    
give_item(id"tf_weapon_railgun")
    
client_cmd(id"tf_weapon_railgun")
    
}

public 
fnSayNeedAc(id) {
    
give_item(id"tf_weapon_ac")
    
client_cmd(id"tf_weapon_ac")
    

(Menu Code Please)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <fun>

#define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
#define Keysmenu_2 #define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)

#define PLUGIN "TFC Weapons"
#define VERSION "1.0"
#define AUTHOR "Phantom Warrior"

new mTFCWeapons 
new mcbTFCWeapons 



public plugin_init() {
    
mTFCWeapons menu_create("TFC Weapons""mh_TFCWeapons")
    
mcbTFCWeapons menu_makecallback("mcb_TFCWeapons")
    
menu_additem(mTFCWeapons"RocketLauncher""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    

    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
}



public 
mh_TFCWeapons(idmenuitem) {
    
/* This event is called when someone presses a key on this menu */
}

public 
ma_TFCWeapons(id) {
    
/* This event is called when an item was selected */
}

public 
mcb_TFCWeapons(idmenuitem) {
    
/* This is the callback-event, here you can set items enabled or disabled. */
    /* If you want to enable an item, use: return ITEM_ENABLED */
    /* If you want to disable an item, use: return ITEM_DISABLED */

Phantom Warrior is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 08:19   Re: Convert to Menu
Reply With Quote #2

Ok, I've gotten this far now what =/:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>
#include <fun>

#define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
#define Keysmenu_2 

#define PLUGIN "TFC Weapons"
#define VERSION "1.0"
#define AUTHOR "Phantom Warrior"
new mTFCWeapons 
new mcbTFCWeapons 



public plugin_init() {
    
mTFCWeapons menu_create("TFC Weapons""mh_TFCWeapons")
    
mcbTFCWeapons menu_makecallback("mcb_TFCWeapons")
    
menu_additem(mTFCWeapons"RocketLauncher""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"ShotGun""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"Knife""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"Sniper""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"AutoRifle""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"FlameThrower""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"RailGun""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"MediKit""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"AC""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"SuperShotGun""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"Tranq""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    
menu_additem(mTFCWeapons"GrenadeLauncher""ma_TFCWeapons"ADMIN_SLAYmcbTFCWeapons)
    

    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
}



public 
mh_TFCWeapons(idmenuitem) {
    
/* This event is called when someone presses a key on this menu */
}

public 
ma_TFCWeapons(id) {
    
/* This event is called when an item was selected */
}

public 
mcb_TFCWeapons(idmenuitem) {
    
/* This is the callback-event, here you can set items enabled or disabled. */
    /* If you want to enable an item, use: return ITEM_ENABLED */
    /* If you want to disable an item, use: return ITEM_DISABLED */

Phantom Warrior is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-13-2007 , 15:20   Re: Convert to Menu
Reply With Quote #3

You haven't created one single plugin on you're own. All you EVER did was creating the commands, but they do nothing.
Not only talking bout this code.
[ --<-@ ] Black Rose is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 15:50   Re: Convert to Menu
Reply With Quote #4

Actually yes I have it's a private plugin for a friend of mine. Tell me what you did to help learn to script. You don't just all of the sudden know what to do..
Phantom Warrior is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-13-2007 , 17:09   Re: Convert to Menu
Reply With Quote #5

I read other scripts.
[ --<-@ ] Black Rose is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 17:42   Re: Convert to Menu
Reply With Quote #6

Yes but then once you submit your plugin, people say this is rip, and has a code that this or that has in it. =/
Phantom Warrior is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-13-2007 , 17:47   Re: Convert to Menu
Reply With Quote #7

You read other scripts to understand for example how to make a menu.

And you can't put 12 items in one menu.
The old menu natives are easier.

Last edited by [ --<-@ ] Black Rose; 02-13-2007 at 17:50.
[ --<-@ ] Black Rose is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 17:51   Re: Convert to Menu
Reply With Quote #8

BlackRose, sorry for getting all 'preppy' if you will.

Still having troubles though.
Phantom Warrior is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 02-13-2007 , 17:52   Re: Convert to Menu
Reply With Quote #9

Take a look at my plugin and see if you can change it to suit your needs.
stupok is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-13-2007 , 18:15   Re: Convert to Menu
Reply With Quote #10

Bingo, thanks.
Phantom Warrior is offline
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 09:58.


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