AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   excute motd file trought client menu (https://forums.alliedmods.net/showthread.php?t=86173)

eagle.eye 02-21-2009 23:49

excute motd file trought client menu
 
hey guys,,

ive been having trouble with writing a script where the menu can excute the command of opening the motd window.

the version of the script where a client types in a command (say /motd)
is alright but wouldnt mind having it excute through the menu

if any1 got idea plzz post..

very appretitatedd!!

fysiks 02-22-2009 02:12

Re: excute motd file trought client menu
 
PHP Code:

#include <amxmodx>
 
public plugin_init()
{
 
register_plugin("Test""1.0""Fysiks")
 
register_clcmd("say /motd""showmotd"0" - show MOTD")
}
public 
showmotd(id)
{
 
show_motd(id"motd.txt""Testing MOTD")


If you want to use it from a menu execute the showmotd(id) function from your menu handler.

eagle.eye 02-22-2009 02:23

Re: excute motd file trought client menu
 
thanx , allthough ive been trying to get it to excute from a script based menu , as there are multiple different files to be excuted into the the motd

any ideas on that ..

this is wat i got for the menu
_____________________________________________ _____________

#include <amxmod>
#define PLUGIN "ServerMenu"
#define VERSION "1.0"
#define AUTHOR "-----"
public plugin_init()
{
register_plugin("ServerMenu1.0","1.0","-------")
register_clcmd( "say /servermenu","ShowMenu", -1, "Private Server Menu" )
register_clcmd( "say_team /servermenu","ShowMenu", -1, "Private Server Menu" )
register_menucmd(register_menuid("\yServer Menu:"), 1023, "MenuCommand" )
return PLUGIN_CONTINUE
}
public ShowMenu( id )
{
new szMenuBody[256]
new keys
new nLen = format( szMenuBody, 255, "\yServer Menu:^n" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. First Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. Second Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. Third Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. Fourth Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. Fifth Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. 6 Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n\w5. 7 Option" )
nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. Exit" )
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6)
show_menu( id, keys, szMenuBody, -1 )
return PLUGIN_CONTINUE
}
public MenuCommand( id, key )
{
client_print( id, print_console, "[AMX] Key=%d", key )
client_print( id, print_chat, "[AMX] Key=%d", key )
switch( key )
{
case 0: client_print( id, print_chat, "Menu Option #1" )
case 1: client_print( id, print_chat, "Menu Option #2" )
case 2: client_print( id, print_chat, "Menu Option #3" )
case 3: client_print( id, print_chat, "Menu Option #4" )
case 4: client_print( id, print_chat, "Menu Option #5" )
case 5: client_print( id, print_chat, "Menu Option #6" )
case 6: client_print( id, print_chat, "Menu Option #7" )
case 7: client_print( id, print_chat, "Menu Option EXIT" )
}
return PLUGIN_HANDLED
}

how would i excute it with this menu??

Dr.G 02-22-2009 06:21

Re: excute motd file trought client menu
 
use the "new" menu system check out this -> http://forums.alliedmods.net/showthread.php?t=46364

fysiks 02-22-2009 17:15

Re: excute motd file trought client menu
 
PHP Code:

case 0:
{
 
showmotd(id)


or if you don't need to do anything special before the native show_motd() just use

PHP Code:

case 0:
{
 
show_motd(id"motd.txt""Testing MOTD")


Quote:

Originally Posted by Dr.G (Post 766520)
use the "new" menu system check out this -> http://forums.alliedmods.net/showthread.php?t=46364

There is nothing wrong with the "old" menu system. As far as I know it's not a depricated method. The "new" menu system is just an "easier" method of getting to the same place. Each has it's own qualities. If you can successfully do it the "more complicated" way then more power to ya.

eagle.eye 02-23-2009 02:01

Re: excute motd file trought client menu
 
thats heaps guys , ive officially completed it

and couldnt have done it without ur help

thanx a million

if u guy wann acheck it out

just tell me and ill uploud it.

thanx again guys

now im just stuck on have the motd pop up when a command is sed but i want it to open up the motd file that was last open by the client so basically i want it to open as it is ,, not to open a txt file.

any ideas ,,, thanx .. soz for the hassle

rx1983 04-02-2009 20:18

Re: excute motd file trought client menu
 
AS I MAKE SO THAT THE CUSTOMERS ARE REDIRECTED FOR A HTML.
(http://www.motd.vai.la)
SITE FOR THE COMMANDS /TOP10 /RANK /TOP15 OR OTHERS, ALREADY I LOOKED SOME PLUGINS AND MORE CLOSE THAT IT ARRIVED AT THE MY OBJECTIVE WAS MOTD MAGNAMET
register_clcmd("amx_browse","CMD_PublicBrowse ",0,"http://www.motd.vai.la/")
register_clcmd("say /top","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /top10","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /top15","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say top","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \top","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \top10","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \top15","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say rank","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /statsme","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /rank","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \rank","CMD_PublicBrowse",0,"http://www.motd.vai.la/")


TO PUT THIS BUGADO, SOMEBODY CAN CREATE A NEW PLUGIN?

fysiks 04-02-2009 21:36

Re: excute motd file trought client menu
 
show_motd(id, "http://www.motd.vai.la/" )

P.S. Why are you yelling at me? *cry*

danielkza 04-02-2009 22:01

Re: excute motd file trought client menu
 
Quote:

Originally Posted by rx1983 (Post 795853)
AS I MAKE SO THAT THE CUSTOMERS ARE REDIRECTED FOR A HTML.
(http://www.motd.vai.la)
SITE FOR THE COMMANDS /TOP10 /RANK /TOP15 OR OTHERS, ALREADY I LOOKED SOME PLUGINS AND MORE CLOSE THAT IT ARRIVED AT THE MY OBJECTIVE WAS MOTD MAGNAMET
register_clcmd("amx_browse","CMD_PublicBrowse ",0,"http://www.motd.vai.la/")
register_clcmd("say /top","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /top10","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /top15","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say top","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \top","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \top10","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \top15","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say rank","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /statsme","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say /rank","CMD_PublicBrowse",0,"http://www.motd.vai.la/")
register_clcmd("say \rank","CMD_PublicBrowse",0,"http://www.motd.vai.la/")


TO PUT THIS BUGADO, SOMEBODY CAN CREATE A NEW PLUGIN?

I noticed you're Brazilian, but really, stop acting like one, don't disrespect the forum rules, don't post in CAPS, don't talk in Portuguese outside the Multi-lingual forums. I know BRs are a worldwide internet plague, but you can make an effort and try being civilized.

Dores 04-03-2009 05:23

Re: excute motd file trought client menu
 
Quote:

Originally Posted by Dr.G (Post 766520)
use the "new" menu system check out this -> http://forums.alliedmods.net/showthread.php?t=46364

Actually, the older menu system is way more efficient, IMO.


All times are GMT -4. The time now is 16:56.

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