Raised This Month: $ Target: $400
 0% 

simple script please help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 07-15-2006 , 03:24   simple script please help
Reply With Quote #1

could someone tell me whats wrong with this?
Code:
#include <amxmodx> #include <amxmisc> #define KeysServers (1<<0)|(1<<1)|(1<<2)|(1<<3) public plugin_init() {  register_plugin("server menus ", "1.0", "AUTHOR")  register_menucmd(register_menuid("Servers"), KeysServers, "PressedServers")  register_concmd("say /servers", "ShowServers")  register_cvar("sv_serversmenu", "1")     } public funcconecttosurf(id)          {          if((get_cvar_num("sv_serversmenu") == 0)                      {                client_print(id,print_chat,"This menu is disabled")              return PLUGIN_HANDLED            }            else                    {            client_print(id,print_console,"connect 63.211.110.204:27015")            }          return PLUGIN_HANDLED } public funcconecttocustomskin(id)         {         if((get_cvar_num("sv_serversmenu") == 0)                      {                        client_print(id,print_chat,"This menu is disabled")                      return PLUGIN_HANDLED           }           else                    {                    client_print(id,print_console,"connect 216.198.244.158:27015")           }         return PLUGIN_HANDLED } public funcconecttodeathmatch(id)         {         if((get_cvar_num("sv_serversmenu") == 0)                     {                       client_print(id,print_chat,"This menu is disabled")                     return PLUGIN_HANDLED           }           else                    {                    client_print(id,print_console,"connect 70.31.209.45:27014")           }         return PLUGIN_HANDLED } public END_MENU(id) { return PLUGIN_HANDLED } public ShowServers(id)  {  if(get_cvar_num("sv_serversmenu") == 0)    client_print(id,print_chat,"This mod is disabled")     return PLUGIN_HANDLED    }  else   {                    show_menu(id, KeysServers, "Servers^n^n1. Go to the surf server^n2. Go to the custom skin server^n3. Go to the Death match server^n4. Exit^n", -1, "Servers")                    return PLUGIN_HANDLED          }          return PLUGIN_HANDLED } public PressedServers(id, key)         {         switch (key)         {                  case 0:                  {                              funcconecttosurf(id)                  }                  case 1:                  {                              funcconecttocustomskin(id)                    }                  case 2:                  {                              funcconecttodeathmatch(id)                  }                  case 3:                  {                              END_MENU(id)                  }         } }
k007 is offline
Send a message via MSN to k007
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 07-15-2006 , 03:45   Re: simple script please help
Reply With Quote #2

Code:
client_print(id,print_console,"connect 63.211.110.204:27015") to client_cmd(id, "connect 63.211.110.204:27015")

This need to be done to all of them. What you are doing is just printing to the client console. You need to use the client_cmd to send the command to the console.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Gizmo
Senior Member
Join Date: May 2006
Location: Sweden
Old 07-15-2006 , 03:47   Re: simple script please help
Reply With Quote #3

Like teame06 said, you need to connect to the server
Code:
#include <amxmodx> #include <amxmisc> #define KeysServers (1<<0)|(1<<1)|(1<<2)|(1<<3) public plugin_init() {     register_plugin("server menus ", "1.0", "AUTHOR")     register_menucmd(register_menuid("Servers"), KeysServers, "PressedServers")     register_concmd("say /servers", "ShowServers")     register_cvar("sv_serversmenu", "1") } public funcconecttosurf(id) {     if(get_cvar_num("sv_serversmenu") == 0)     {         client_print(id,print_chat,"This menu is disabled")         return PLUGIN_HANDLED     }     else     {         client_cmd(id, "connect 63.211.110.204:27015")     }     return PLUGIN_HANDLED } public funcconecttocustomskin(id) {     if(get_cvar_num("sv_serversmenu") == 0)     {         client_print(id,print_chat,"This menu is disabled")         return PLUGIN_HANDLED     }     else     {         client_cmd(id, "connect 216.198.244.158:27015")     }     return PLUGIN_HANDLED } public funcconecttodeathmatch(id) {     if(get_cvar_num("sv_serversmenu") == 0)     {         client_print(id,print_chat,"This menu is disabled")         return PLUGIN_HANDLED     }     else     {         client_cmd(id, "connect 70.31.209.45:27014")     }     return PLUGIN_HANDLED } public END_MENU(id) {     return PLUGIN_HANDLED } public ShowServers(id) {     if(get_cvar_num("sv_serversmenu") == 0)     {         client_print(id,print_chat,"This mod is disabled")         return PLUGIN_HANDLED     }     else     {         show_menu(id, KeysServers, "Servers^n^n1. Go to the surf server^n2. Go to the custom skin server^n3. Go to the Death match server^n4. Exit^n", -1, "Servers")         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public PressedServers(id, key) {     switch (key)     {         case 0: funcconecttosurf(id)         case 1: funcconecttocustomskin(id)         case 2: funcconecttodeathmatch(id)         case 3: END_MENU(id)     } }
__________________
Gizmo is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 07-15-2006 , 04:50   Re: simple script please help
Reply With Quote #4

thank you guys so much +karma and i just though printin it in the users concel is the same thing
k007 is offline
Send a message via MSN to k007
Reply


Thread Tools
Display Modes

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 08:06.


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