Raised This Month: $ Target: $400
 0% 

Unknown command?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 14:17   Unknown command?
Reply With Quote #1

When you type "wpnmenu" in the console or say "/wpnmenu" a menu is suppose to come up in-game. I keep getting just "unknown command, anyone know why?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <weaponmod>
#include <weaponmod_stocks>
 
// Plugin informations
new const PLUGIN[] = "WPN Buysystem"
new const VERSION[] = "0.6"
new const AUTHOR[] = "DevconeS"
new const PREFIX[] = "[WeaponMod]"
 
// List of supported mods
#define MAX_SUPPORTED_MODS 3
new const SUPPORTED_MODS[MAX_SUPPORTED_MODS][] = {"cstrike""czero""ts"}
 
// CVAR Pointers
new g_BuyMode
new g_Advertise
new g_Enabled
 
// User Informations
new g_InBuyzone[33]
new 
g_MenuPage[33]
 
// Others
new g_MenuTitle[64]
new 
g_ColoredMenus
 
// Register the plugin
 
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
// Before doing anything, we wanna make sure we're running on a supported mod
 
wpn_set_supported_mods(SUPPORTED_MODSMAX_SUPPORTED_MODS"addon")
 
 
wpn_register_addon()
 
 
// CVARs
 
g_BuyMode register_cvar("wpn_buymode""2")
 
g_Advertise register_cvar("wpn_advertise""1")
 
g_Enabled get_cvar_pointer("wpn_enabled")
 
 
// Commands
 
register_clcmd("wpnbuy""cmdBuy"0"<wpnid> - buys a weapon")
 
register_clcmd("wpnmenu""cmdMenu"0"- displays weapon menu")
 
register_clcmd("say /wpnmenu""cmdMenu"0"- displays weapon menu")
 
 
// Events
 
new mod[32]
 
get_modname(mod31)
 if(
equal(mod"cstrike") || equal(mod"czero"))
 {
  
register_event("StatusIcon""eventStatusIcon""be")
 }
 
register_event("RoundTime""eventRoundTime""bc")
 
 
// Menu
 
g_ColoredMenus colored_menus()
 if(
g_ColoredMenus)
  
formatex(g_MenuTitle63"\y%s Buymenu"PREFIX)
 else
  
formatex(g_MenuTitle63"%s Buymenu"PREFIX)
 
register_menucmd(register_menuid(g_MenuTitle), 1023"actionBuyMenu")
}
// Manages message display on round begin
public eventRoundTime()
{
 if (
read_data(1) == get_cvar_num("mp_roundtime")*60)
 {
  
// New round has started, if the advertisment option is enabled, print the text
  
if(get_pcvar_num(g_Advertise))
   
client_print(0print_chat"%s Type wpnmenu in console to open the WeaponMod menu or bind <key> wpnmenu"PREFIX)
 }
}
// Event StatusIcon (to check if the user is in the buyzone)
public eventStatusIcon(id)
{
 new 
icon[32]
 
read_data(2,icon,31)
 if(
equal(icon"buyzone"))
 {
  if(
read_data(1))
   
g_InBuyzone[id] = true
  
else
  
g_InBuyzone[id] = false
 
}
}
// Checks if the given player is able to buy a weapon
canBuyWeapon(id)
{
 new 
mode get_pcvar_num(g_BuyMode)
 if(
mode == 0)
 {
  
// Buying disabled
  
client_print(idprint_console"%s Buying of weapons has been disabled"PREFIX)
  return 
false
 
}
 
 if(!
g_InBuyzone[id] && mode == 2)
 {
  
// Player not in buyzone but buyzone is required
  
client_print(idprint_console"%s You aren't in buyzone"PREFIX)
  return 
false
 
}
 
 return 
true
}
// Buy command
public cmdBuy(id)
{
 if(!
get_pcvar_num(g_Enabled)) return PLUGIN_HANDLED
 
if(!canBuyWeapon(id)) return PLUGIN_HANDLED
 
 
new wpnCount wpn_weapon_count()
 if(
wpnCount 0)
 {
  if(
read_argc() < 2)
  {
   
// No weapon given, list all available weapon and buy command
   
client_print(idprint_console"%s Available Weapons are:^nTo buy type: wpnbuy <weaponid>"PREFIX)
   new 
weapon[32]
   for(new 
0wpnCounti++)
   {
    
// Only display information, if the weapon is enabled
    
if(!is_plugin_enabled(wpn_get_integer(iwpn_pluginid))) continue
 
    
wpn_get_string(iwpn_nameweapon31)
    
client_print(idprint_console"%d - %s - $%d"iweaponwpn_get_integer(i,wpn_cost))
   }
  } else {
   new 
wpn[64], wpnid
   read_argv
(1wpn63)
   
wpnid str_to_num(wpn)
 
   if(
wpnid > -&& wpnid wpnCount)
   {
    if(!
is_plugin_enabled(wpn_get_integer(wpnidwpn_pluginid)))
    {
     
// Player tryed to buy a disabled weapon
     
client_print(idprint_console"%s This weapon is currently disabled"PREFIX)
     return 
PLUGIN_HANDLED
    
}
 
    new 
money wpn_gi_get_offset_int(idoffset_money)
    new 
cost wpn_get_integer(wpnidwpn_cost)
 
    new 
weapon[32]
    
wpn_get_string(wpnidwpn_nameweapon31)
 
    if(
money cost)
    {
     
// User has less money than required
     
client_print(idprint_console"%s You haven't got enough money for a '%s' ($%d)"PREFIXweaponcost)
     
client_print(idprint_chat"%s You haven't got enough money for a '%s' ($%d)"PREFIXweaponcost)
     return 
PLUGIN_HANDLED
    
}
 
    
// Take the money :)
    
wpn_gi_set_offset_int(idoffset_moneymoney-cost)
 
    
// Give him the weapon or refill it
    
if(wpn_give_weapon_or_refill(idwpnid) == 1)
    {
     
// New weapon was given
     
client_print(idprint_console"%s You've got now a '%s'"PREFIXweapon)
     
client_print(idprint_chat"%s You've got now a '%s'"PREFIXweapon)
    } else {
     
// Refilled
     
client_print(idprint_console"%s Your '%s' has now full ammo"PREFIXweapon)
     
client_print(idprint_chat"%s Your '%s' has now full ammo"PREFIXweapon)
    }
   } else {
    
// Player tryed to buy an unknown weapon
    
client_print(idprint_console"%s Invalid Weapon ID '%s'"PREFIXwpnid)
   }
  }
 } else {
  
// No weapons are registered to WeaponMod
  
client_print(idprint_console"%s No weapons available"PREFIX)
 }
 
 return 
PLUGIN_HANDLED
}
// Checks if the given plugin is enabled
is_plugin_enabled(id)
{
 new 
temp[2],status[16]
 
get_plugin(idtemp1temp1temp1temp1status15)
 if(
status[0] == 's' || status[0] == 'p')
 {
  return 
false
 
}
 return 
true
}
// Menu command
public cmdMenu(id)
{
 if(!
get_pcvar_num(g_Enabled)) return PLUGIN_HANDLED
 
if(!canBuyWeapon(id)) return PLUGIN_HANDLED
 
 
if(wpn_weapon_count() > 0)
 {
  
// Display menu at page 1
  
g_MenuPage[id] = 0
  showBuyMenu
(id)
 } else {
  
// No weapons available
  
client_print(idprint_chat"%s No weapons available"PREFIX)
 }
 
 return 
PLUGIN_HANDLED
}
// Displays WeaponMod buymenu
public showBuyMenu(id)
{
 
// Init variables, get weapon count and calculate amount of pages
 
new menu[512], keys
 
new wpnCount wpn_weapon_count()
 new 
pageCount = (wpnCount/8) + (((wpnCount%8) > 0) ? 0)
 
 
// Add menu header
 
new len
 
if(g_ColoredMenus)
  
len formatex(menu511"%s\R%d/%d^n\w^n"g_MenuTitleg_MenuPage[id]+1pageCount)
 else
  
len formatex(menu511"%s - Page %d/%d^n^n"g_MenuTitleg_MenuPage[id]+1pageCount)
 
 
// Calculate weapon start index and end index of all available weapons
 
new start g_MenuPage[id]*8
 
new end = (((start+8) <= wpnCount) ? start+wpnCount)
 new 
money wpn_gi_get_offset_int(idoffset_money)
 new 
costweapon[32]
 
 
// Now cycle through all weapons
 
for(new startendi++)
 {
  
cost wpn_get_integer(iwpn_cost)
  
wpn_get_string(iwpn_nameweapon31)
  if(
cost <= money)
  {
   if(
is_plugin_enabled(wpn_get_integer(iwpn_pluginid)))
   {
    
// Weapon is enabled, add it to the menu and allow pressing the specifiec number
    
keys |= (1<<i-start)
    if(
g_ColoredMenus)
     
len += formatex(menu[len], 511-len"%d. %s \R\y$%d\w^n"i+1-startweaponcost)
    else
     
len += formatex(menu[len], 511-len"%d. %s - $%d^n"i+1-startweaponcost)
   } else {
    
// The current weapon is disabled
    
if(g_ColoredMenus)
     
len += formatex(menu[len], 511-len"\d%d. %s \R\rDISABLED\w^n"i+1-startweaponcost)
    else
     
len += formatex(menu[len], 511-len"#. %s - DISABLED^n"weaponcost)
   }
  } else {
   
// Player does not have enough money
   
if(g_ColoredMenus)
    
len += formatex(menu[len], 511-len"\d%d. %s \R\y$%d\w^n"i+1-startweaponcost)
   else
    
len += formatex(menu[len], 511-len"#. %s - $%d^n"weaponcost)
  }
 }
 
 if(
end wpnCount)
 {
  
// There are more weapons available and so more pages, add next button
  
keys |= (1<<8)
  
len += formatex(menu[len], 511-len"^n9. Next")
 }
 
 
// If we're on the first page, we add the exit button, otherwise the back
 
keys |= (1<<9)
 if(
start <= 0)
  
len += formatex(menu[len], 511-len"^n0. Exit")
 else
  
len += formatex(menu[len], 511-len"^n0. Back")
 
 
// Finally show the generated menu
 
show_menu(idkeysmenu)
 return 
PLUGIN_CONTINUE
}
// Handles WeaponMod buymenu
public actionBuyMenu(id,key)
{
 switch(
key)
 {
  case 
8:
  {
   
// Next page
   
g_MenuPage[id]++
   
showBuyMenu(id)
  }
  case 
9:
  {
   if(
g_MenuPage[id] > 0)
   {
    
// Previous page
    
g_MenuPage[id]--
    
showBuyMenu(id)
   }
  }
  default:
  {
   
// Buy weapon
   
client_cmd(id"wpnbuy %d"g_MenuPage[id]*8+key)
  }
 } 
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-01-2008 at 14:57.
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-01-2008 , 14:23   Re: Compiling errors ..
Reply With Quote #2

As I've ALREADY said by MP, use the latest version of plugins from HERE

Then, using this webcompiler to compile the plugin.

Same thing for other addons/base weapoins. Retrieve from SVN.
__________________
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 14:33   Re: Compiling errors ..
Reply With Quote #3

Ok, I've changed it, I've found another plugin just the same that compile but I am still getting this error.

Does anyone know why, and can anyone fix this?
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-01-2008 at 14:45.
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-01-2008 , 15:49   Re: Unknown command?
Reply With Quote #4

...

Sigh. Again, use the SVN version. It compiles fine. All files from SVN works and compiles fine.

Wait, that's not difficult to retrieve the plugin. Just click on 'download'. Did you do that ?

Or retrieve all files at once from SVN using this link. if it feels more easy for you.
__________________

Last edited by Arkshine; 08-01-2008 at 15:56.
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 16:43   Re: Unknown command?
Reply With Quote #5

You must not be understanding me.

This file here, the one above is from that link.
I've told you this several times already. And when you install it and it runs fine, but when you type "wpnmenu" in the console you get the response "Unknown command"

Quote:
Today , 02:49 PM Re: Unknown command?
#4 ...

Sigh. Again, use the SVN version. It compiles fine. All files from SVN works and compiles fine.

Wait, that's not difficult to retrieve the plugin. Just click on 'download'. Did you do that ?

Or retrieve all files at once from SVN using this link. if it feels more easy for you.
Also, I never said anything about this not compiling.
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-01-2008 at 16:53.
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-01-2008 , 16:49   Re: Unknown command?
Reply With Quote #6

Quote:
You must not be understanding me.
That's possible. But I know WM and all files from SVN works perfectly fine.

Quote:
This file here, yep the one in the first post IS FROM THAT LINK.
So, you didn't get the right file. You should get the latest revision which is the first at the top.


To avoid such errors, do what I said : download ALL files via the link above. You will get all files and the latest revision.

Now, after downloading, compiling, if you get again errors, paste here the result of the command 'amxx list'.
__________________
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 16:52   Re: Unknown command?
Reply With Quote #7

Code:
WPN Laser Tripmin  1.0.3       Arkshine          wp_tripmine.amx  running  
WPN Buysystem      0.6         DevconeS          wpn_buysystem.a  running  
WPN RPG            0.1         DevconeS(Edited   wpn_rpg.amxx     running  
WPN Gravity Gun    0.6         DevconeS          wpn_gravity.amx  running  
WPN Minigun        1.5         A.F.              wpn_minigun.amx  running  
WPN Laser          0.7         DevconeS/World C  wpn_laser.amxx   running  
WPN GameInfo CS    0.82        DevconeS          wpn_gameinfo_cs  debug    
10 plugins, 10 running
----- Entries 40 - 49 of 55 -----
----- Use 'amx_plugins 50' for more -----
] wpnmenu
Unknown command

From my Console
---
And here is a picture of my console for running the server.
These are the latest files, keep in mind.

__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-01-2008 at 16:56.
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-01-2008 , 16:56   Re: Unknown command?
Reply With Quote #8

No. Not amx_plugins, but amxx list

Via the server console. if you want to use the console in game, you have to write before :

rcon_password "yourpass"
rcon amxx list

Then paste the whole result.
__________________
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 17:01   Re: Unknown command?
Reply With Quote #9

Yes, I just wanted to show you they are running. But here is another picture of my console including both runtime errors for both:
Code:
wpn_gameinfo_cs.amxx, and wpn_buysystem.amxx


And here is my Amxx list
Code:
AMX Mod X 1.8.0.3660
Authors: 
         David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko, Felix "SniperBeamer" Geyer
         Jonny "Got His Gun" Bergstrom, Lukasz "SidLuke" Wlasinski
         Christian "Basic-Master" Hammacher, Borja "faluco" Ferrer
         Scott "Damaged Soul" Ehlert
Compiled: Oct 25 2007, 22:03:40
URL:http://www.amxmodx.org/
Core
__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-01-2008 , 17:02   Re: Unknown command?
Reply With Quote #10

Quote:
if you want to use the console in game, you have to write :

rcon_password "yourpass"
rcon amxx list
__________________
Arkshine 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 05:33.


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