Raised This Month: $ Target: $400
 0% 

*Plugin Request* Server Information(s)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bandora
Junior Member
Join Date: Nov 2005
Old 07-08-2009 , 02:18   *Plugin Request* Server Information(s)
Reply With Quote #1

Hey all,

I am here asking for help. I am a total noob in scripting for amxmodx, and I really need a favor from you guys, I am asking (hopefully a small plugin that won't be too hard to make) for a plugin that when a player is on my server types for example /listmaps it will open the MOTD and it has a custom page that has all the maps that are on the server (which I can create/modify an html)...

Also a player can type /bhopmaps, /kzmaps, /surfmaps, /deathrunmaps and that takes them to different html pages on the MOTD and lists what maps are there for each type... (Because my server is a Deathrun/Surf/KZ/Bhop server).. also if there's a /help feature too like when a person types /help it would take them to another html page which has all the commands for this..

And also if you can add a couple of messages that appears from time to time (as a amx_csay; the text that appears on the middle of the screen. And regular colored text on the bottom left corner; like regular chat text).

I hope you guys can help me out on this..

Thanks in advance,

BaNdOrA

I just thought of this, it could be three different HTML pages instead of 6 pages.. like for the types of maps, they could be listed on one page but when someone types for example /surfmaps it would open a page like this maps.html#surf so it would like scroll to that section

Last edited by bandora; 07-08-2009 at 02:33.
bandora is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-08-2009 , 02:23   Re: *Plugin Request* Server Information(s)
Reply With Quote #2

Your thread title is rather vague. Would you please elaborate on what it is that you want?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
bandora
Junior Member
Join Date: Nov 2005
Old 07-08-2009 , 02:38   Re: *Plugin Request* Server Information(s)
Reply With Quote #3

Quote:
Originally Posted by DarkGod View Post
Your thread title is rather vague. Would you please elaborate on what it is that you want?
Hmm, ok.. like a plugin that basically gives info (by opening the MOTD) for a player by type /something in chat..

so like commands that I want would be:

/listmaps (ALL the maps that are on the server)
/surfmaps (ONLY surf maps that are on the server)
/deathrunmaps or /drmaps (ONLY deathrun maps that are on the server)
/kzmaps (ONLY kz maps that are on the server)
/bhopmaps (ONLY bhop maps that are on the server)
/help (Info on what commands the person can use on the server)

So when someone types those commands in chat the MOTD will show up and has an HTML page of what the maps are there on the server.

And on top of that I would like to have a reminder of that they can do those by having the plugin "advertise" those commands by having colored chat text something like: "[Server Info]: Type /surfmaps to view the surf maps that are on the server."

and then like a minute or two later: "[Server Info]: Type /kzmaps to view the kz maps that are on the server.".. etc.

I hope I cleared things up.

Thanks in advance,

BaNdOrA

Last edited by bandora; 07-08-2009 at 02:45.
bandora is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 07-08-2009 , 02:55   Re: *Plugin Request* Server Information(s)
Reply With Quote #4

This is a very easy coded plugin just that you have to repeat yourself.
Here is the base to show maps.txt as motd when writing /maps.
But id suggest you take a look at this: http://forums.alliedmods.net/showthread.php?t=24092

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_plugin("Motd example", "0.1", "Micke1101")
    
    register_clcmd("say /maps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "maps.txt")
}
micke1101 is offline
bandora
Junior Member
Join Date: Nov 2005
Old 07-08-2009 , 15:13   Re: *Plugin Request* Server Information(s)
Reply With Quote #5

Quote:
Originally Posted by micke1101 View Post
This is a very easy coded plugin just that you have to repeat yourself.
Here is the base to show maps.txt as motd when writing /maps.
But id suggest you take a look at this: http://forums.alliedmods.net/showthread.php?t=24092

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_plugin("Motd example", "0.1", "Micke1101")
    
    register_clcmd("say /maps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "maps.txt")
}
Hey thanks for the script.. But can you add on how to make the plugin display HUD messages in lets say Blue color that says like: "[FS]: Type /bhopmaps to show the bhop maps that are on the server." And then a minute or two later it will show another message for lets say.. /surfmaps. and it cycles through those 6 commands that I mentioned in my older post.

Thanks in advance,

BaNdOrA

P.S.: Just to be clear so in what I am requesting the code would be something like this?

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_plugin("Motd example", "0.1", "Micke1101")
    
    register_clcmd("say /drmaps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "dr.txt")
}

{
    register_clcmd("say /surfmaps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "surf.txt")
}

{
    register_clcmd("say /kzmaps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "kz.txt")
}

{
    register_clcmd("say /bhopmaps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "bhop.txt")
}

{
    register_clcmd("say /help","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "help.txt")
}

{
    register_clcmd("say /listmaps","ShowMotd");
}
public ShowMotd(id){
    show_motd(id, "allmaps.txt")
}

Last edited by bandora; 07-08-2009 at 15:18.
bandora is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 07-08-2009 , 15:35   Re: *Plugin Request* Server Information(s)
Reply With Quote #6

First the problem with your code is all registers should be in plugin_init not outside functions and then youre naming all motd functions the same so it wont work rename them to for example showmotd1 both in register and the function itself
This will make a blue hud
Code:
    set_hudmessage(0, 0, 255, 0.75, 0.01, 0, 6.0, 15.0) 
    show_hudmessage(id, "If you write /allmaps")
If someone else dosent show you ill fix it later im a little busy now...
micke1101 is offline
bandora
Junior Member
Join Date: Nov 2005
Old 07-09-2009 , 00:30   Re: *Plugin Request* Server Information(s)
Reply With Quote #7

Quote:
Originally Posted by micke1101 View Post
First the problem with your code is all registers should be in plugin_init not outside functions and then youre naming all motd functions the same so it wont work rename them to for example showmotd1 both in register and the function itself
This will make a blue hud
Code:
    set_hudmessage(0, 0, 255, 0.75, 0.01, 0, 6.0, 15.0) 
    show_hudmessage(id, "If you write /allmaps")
If someone else dosent show you ill fix it later im a little busy now...
Ok so it will be like this?

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_plugin("Motd example", "0.1", "Micke1101")
    
    register_clcmd("say /drmaps","DrMotd");

public DrMotd(id){
    show_motd(id, "dr.txt")}



    register_clcmd("say /surfmaps","SurfMotd");

public SurfMotd(id){
    show_motd(id, "surf.txt")}



    register_clcmd("say /kzmaps","KZMotd");

public KZMotd(id){
    show_motd(id, "kz.txt")}

    register_clcmd("say /bhopmaps","BhopMotd");

public BhopMotd(id){
    show_motd(id, "bhop.txt")}

    register_clcmd("say /help","HelpMotd");

public HelpMotd(id){
    show_motd(id, "help.txt")}

    register_clcmd("say /listmaps","AllMotd");

public AllMotd(id){
    show_motd(id, "allmaps.txt")}

}

set_hudmessage(0, 0, 255, 0.75, 0.01, 0, 6.0, 15.0) 
    show_hudmessage(id, "If you write /allmaps")
Is that right??? I think I messed up really bad.. I am a total noob in scripting btw. haha.

Also how can I make the hudmessage go through every function from time to time lets say 60 seconds or 120 seconds and then when it shows it goes back to the first one.. so something like this:

[FS]: Type /allmaps to view all maps on the server.
-- 1 or 2 minutes --
[FS]: Type /drmaps to view all Deathrun maps on the server.
-- 1 or 2 minutes --
[FS]: Type /surfmaps to view all Surf maps on the server.
-- 1 or 2 minutes --
[FS]: Type /kzmaps to view all KZ maps on the server.
-- 1 or 2 minutes --
[FS]: Type /bhopmaps to view all Bhop maps on the server.
-- 1 or 2 minutes --
[FS]: Type /help to view all commands that can be used on the server.
-- 1 or 2 minutes --
Then goes back to the first message.. and so on.

Thanks in advance.

BaNdOrA

Last edited by bandora; 07-09-2009 at 00:34.
bandora is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 07-09-2009 , 03:09   Re: *Plugin Request* Server Information(s)
Reply With Quote #8

This should be what you wanted except what the huds tells and maybe there position, and i added some notes
PHP Code:
/*
First note everything thats between /*here*/ //or after 2 slashes like this

//Wont affect the plugin



//Beginning of "Headers" these are needed for some codes cause they know how to translate/compile the codes so the computer will understand them.
#include <amxmodx>
#include <amxmisc>
//End of "Headers"

//Global variable so it can be used in several functions
new gMaxClients;

//Beginning of main part of the plugin (plugin_init) here is where almost everything begins in a plugin
public plugin_init() {
    
//When you write amxx plugins this is the info you get (and if it loads bad or something)
    
register_plugin("Motd example""0.1""Micke1101")
    
    
//Here is where we say that if someone says /drmaps for example will it activate the function DrMotd
    
register_clcmd("say /drmaps","DrMotd");
    
register_clcmd("say /surfmaps","SurfMotd");
    
register_clcmd("say /kzmaps","KZMotd");
    
register_clcmd("say /bhopmaps","BhopMotd");
    
register_clcmd("say /help","HelpMotd");
    
register_clcmd("say /listmaps","AllMotd");

    
//This one triggers the function newround on new round
    
register_event("ResetHUD","newround","b")
    
    
//Tells us how many players the server can hold
    
gMaxClients get_playersnum();
}
//End of main part

public DrMotd(id){
    
show_motd(id"dr.txt")
}
public 
DrHud(id){
    
//Goes though all the players and shows them the hud
    
for ( new Player 1Player <= gMaxClientsPlayer++ )
    {
        
set_hudmessage(002550.750.0106.015.0
        
show_hudmessage(Player"If you write /allmaps")
    }
    
//After 120 seconds will next hud appear
    
set_task(120.0"SurfHud")
}
public 
SurfMotd(id){
    
show_motd(id"surf.txt")
}
public 
SurfHud(id){
    for ( new 
Player 1Player <= gMaxClientsPlayer++ )
    {
        
set_hudmessage(002550.750.0106.015.0
        
show_hudmessage(Player"If you write /allmaps")
    }
    
set_task(120.0"KZHud")
}
public 
KZMotd(id){
    
show_motd(id"kz.txt")
}
public 
KZHud(id){
    for ( new 
Player 1Player <= gMaxClientsPlayer++ )
    {
        
set_hudmessage(002550.750.0106.015.0
        
show_hudmessage(Player"If you write /allmaps")
    }
    
set_task(120.0"BhopHud")
}
public 
BhopMotd(id){
    
show_motd(id"bhop.txt")
}
public 
BhopHud(id){
    for ( new 
Player 1Player <= gMaxClientsPlayer++ )
    {
        
set_hudmessage(002550.750.0106.015.0
        
show_hudmessage(Player"If you write /allmaps")
    }
    
set_task(120.0"HelpHud")
}
public 
HelpMotd(id){
    
show_motd(id"help.txt")
}
public 
HelpHud(id){
    for ( new 
Player 1Player <= gMaxClientsPlayer++ )
    {
        
set_hudmessage(002550.750.0106.015.0
        
show_hudmessage(Player"If you write /allmaps")
    }
    
set_task(120.0"AllHud")
}
public 
AllMotd(id){
    
show_motd(id"allmaps.txt")
}
public 
AllHud(id){
    for ( new 
Player 1Player <= gMaxClientsPlayer++ )
    {
        
set_hudmessage(002550.750.0106.015.0
        
show_hudmessage(Player"If you write /allmaps")
    }
    
set_task(120.0"DrHud")
}
public 
newround(){
    
//After 60 seconds on new round will DrHud be activated
    
set_task(60.0"DrHud")

micke1101 is offline
bandora
Junior Member
Join Date: Nov 2005
Old 07-12-2009 , 01:27   Re: *Plugin Request* Server Information(s)
Reply With Quote #9

Hey man I can't thank you enough for your help! And I would like to thank you even more for the tutorial (the extra notes).. Thank you thank you thank you so much! You are a very helpful person.

EDIT: I've compiled the plugin, and it's working, but there are two things that the plugin isn't doing... It's not showing any hudmessages (I was the only player on the server).. And when I type any of the commands lets say /drmaps it opens the Motd with the text in there that says dr.txt that's it.. I've placed a dr.txt in data/lang.. and I even put it in the configs folder, I still get the same thing.. :/ Any help would be MUCH appreciated!

Last edited by bandora; 07-12-2009 at 01:57.
bandora is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-12-2009 , 13:26   Re: *Plugin Request* Server Information(s)
Reply With Quote #10

MOTD files in this plugin need to be /<mod>/filename.txt, so if you are running Counter-Strike, they be like: /cstrike/filename.txt

/cstrike/dr.txt
/cstrike/surf.txt
/cstrike/kz.txt
/cstrike/bhop.txt
. . .
__________________
fysiks 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 12:29.


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