Raised This Month: $ Target: $400
 0% 

excute motd file trought client menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eagle.eye
Junior Member
Join Date: Feb 2009
Old 02-21-2009 , 23:49   excute motd file trought client menu
Reply With Quote #1

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!!
eagle.eye is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-22-2009 , 02:12   Re: excute motd file trought client menu
Reply With Quote #2

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.
fysiks is offline
eagle.eye
Junior Member
Join Date: Feb 2009
Old 02-22-2009 , 02:23   Re: excute motd file trought client menu
Reply With Quote #3

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??
eagle.eye is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-22-2009 , 06:21   Re: excute motd file trought client menu
Reply With Quote #4

use the "new" menu system check out this -> http://forums.alliedmods.net/showthread.php?t=46364
__________________
Dr.G is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-22-2009 , 17:15   Re: excute motd file trought client menu
Reply With Quote #5

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 View Post
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.

Last edited by fysiks; 02-22-2009 at 17:21.
fysiks is offline
eagle.eye
Junior Member
Join Date: Feb 2009
Old 02-23-2009 , 02:01   Re: excute motd file trought client menu
Reply With Quote #6

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

Last edited by eagle.eye; 02-23-2009 at 02:55.
eagle.eye is offline
rx1983
Senior Member
Join Date: Jan 2009
Location: BRASIL
Old 04-02-2009 , 20:18   Re: excute motd file trought client menu
Reply With Quote #7

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?
rx1983 is offline
Send a message via MSN to rx1983
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-02-2009 , 21:36   Re: excute motd file trought client menu
Reply With Quote #8

show_motd(id, "http://www.motd.vai.la/" )

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

Last edited by fysiks; 04-02-2009 at 21:38.
fysiks is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 04-02-2009 , 22:01   Re: excute motd file trought client menu
Reply With Quote #9

Quote:
Originally Posted by rx1983 View Post
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.
__________________

Community / No support through PM
danielkza is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 04-03-2009 , 05:23   Re: excute motd file trought client menu
Reply With Quote #10

Quote:
Originally Posted by Dr.G View Post
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.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores 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 16:56.


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