Raised This Month: $ Target: $400
 0% 

Buy Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
varsponic
Junior Member
Join Date: Apr 2007
Old 04-07-2007 , 17:27   Buy Menu
Reply With Quote #1

How would you go about making a plugin or clcmd that would make a menu that had the options make the person "say" something to just clump the other plugin buy commands together so the end result would be like:

1. FrostNade600$ - pressing it makes them say /fn not in console
2. Molotov - say molotov
3. Jetpack - says /buyjetpack
4. BuyThat - says whatever the plugin configured the object to be bought with

instead of having to know the individual commands to buy things so it wouldnt be as cluttered.
could i just copy his and replace one set of options with names and the other with the "say /fn" cmnds?
http://forums.alliedmods.net/showthr...highlight=menu
varsponic is offline
varsponic
Junior Member
Join Date: Apr 2007
Old 04-07-2007 , 20:03   Re: Buy Menu
Reply With Quote #2

I got the menu part to work but could someone tell me how or if its possible to make the person using the menu SAY in regular chat, something as a result of his option? Do need to predefine something or just put the command in..


Code:
 
/* AMX Mod script.
*
* (c) 2007, bigdickboy
* This file is provided as is (no warranties).
*
*  Generated by AMX MenuMaker v1.5 (http://sniperbeamer.amxmod.info)
*/
#include <amxmod>
#include <amxmisc>
new bool:cstrik_running
public plugin_init()
{
 register_plugin("Menu","1.0","bigdickboy")
 register_menucmd(register_menuid("Shop"),1023,"actionMenu")
 register_clcmd("shop","showMenu",0)
 new modName[32]
 get_modname(modName,31)
 cstrik_running = equal(modName,"cstrike") ? true : false
}
public actionMenu(id,key)
{
 switch(key){
 case 0:{
"say /frostnade"
 }
 case 1:{
"say molotov"
 }
 }
 return PLUGIN_HANDLED
}
public showMenu(id,level,cid)
{
 if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
 new menuBody[512]
 new len = format(menuBody,511,cstrik_running ? "\yShop\R^n^n\w" : "Shop^n^n")
 len += format(menuBody[len],511-len,"1. Frost Grenade 600$^n2. Molotov Cocktail 400$^n^n0. Exit")
 show_menu(id,((1<<0)|(1<<1)|(1<<9)),menuBody)
 return PLUGIN_HANDLED
}
varsponic is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 04-07-2007 , 22:52   Re: Buy Menu
Reply With Quote #3

I think you might wanna read up, and view a few more plugins.
You're switch statement is no were near correct.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
varsponic
Junior Member
Join Date: Apr 2007
Old 04-07-2007 , 23:09   Re: Buy Menu
Reply With Quote #4

yehh i dont know, the menu worked in game..
"generated by AMX MenuMaker v1.5"

i get that im going to have to use
engclient_cmd ( index,const command[],arg1[]= )
so i almost have it.. but could someone give me an example of how to fill out the second part? like when should i record the player index
varsponic is offline
varsponic
Junior Member
Join Date: Apr 2007
Old 04-08-2007 , 14:39   Re: Buy Menu
Reply With Quote #5

Ive been trying to read other scripts and such to make sense of it, but when i compile it it says lines 30-31 and 33-34 the expressions have no affect. The menu opens and you can click the options but it doesnt work, how do i code these 2 commands correctly?


Code:
/* AMX Mod script.
*
* (c) 2007, bigdickboy
* This file is provided as is (no warranties).
*
*  Generated by AMX MenuMaker v1.5 (http://sniperbeamer.amxmod.info)
*/
#include <amxmod>
#include <amxmisc>
new bool:cstrik_running
public plugin_init()
{
register_plugin("Menu","1.0","bigdickboy")
register_menucmd(register_menuid("Shop"),1023,"actionMenu")
register_clcmd("shop","showMenu",0)
new modName[32]
get_modname(modName,31)
cstrik_running = equal(modName,"cstrike") ? true : false
}
public actionMenu(id,key)
{
switch(key){
case 0:{
engclient_cmd ( id,say,/frostnade) 
}
case 1:{
engclient_cmd ( id,say,molotov ) 
}
}
return PLUGIN_HANDLED
}
public showMenu(id,level,cid)
{
if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
new menuBody[512]
new len = format(menuBody,511,cstrik_running ? "\yShop\R^n^n\w" : "Shop^n^n")
len += format(menuBody[len],511-len,"1. Frost Grenade 600$^n2. Molotov Cocktail 400$^n^n0. Exit")
show_menu(id,((1<<0)|(1<<1)|(1<<9)),menuBody)
return PLUGIN_HANDLED
}
varsponic is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 04-08-2007 , 18:56   Re: Buy Menu
Reply With Quote #6

Actually, you're making it more complicated than it is. Use:

engclient_cmd( id, "say /frostnade" );

The key part being the quotes.

Also, as a tip, I would reccomend defining your strings as global constants, for optimization purposes. Your plugin will still work without doing this, but if you read This Article you will see what I mean about that.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
d0ck
Junior Member
Join Date: May 2007
Old 05-19-2007 , 23:18   Re: Buy Menu
Reply With Quote #7

i hate to revive a dead topic like this but i dont suppose you got this working ever did you?
d0ck 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 06:42.


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