Raised This Month: $51 Target: $400
 12% 

[Problem] Motd that shows from the website


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kasutaja99
Junior Member
Join Date: Dec 2014
Old 01-18-2015 , 06:33   [Problem] Motd that shows from the website
Reply With Quote #1

I did somehow the first command that shows motd and motd shows from the website. But this time I did another command and it didn't show the MOTD.
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "test"
#define VERSION "test"
#define AUTHOR "test"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /command""Ea");
}

public 
Ea(id) {
    
show_motd(id"weblink here""MOTD");
    return 
PLUGIN_HANDLED;

Kasutaja99 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-18-2015 , 07:01   Re: [Problem] Motd that shows from the website
Reply With Quote #2

Just try below:
PHP Code:
#include <amxmodx>
#include <amxmisc>

new cvar_website;

new 
g_mapname[64];

public 
plugin_init()
{
    
register_plugin("MOTD Website""0.1""Exolent");
    
    
register_clcmd("say /motd""CmdMotd");
    
    
cvar_website register_cvar("motd_website""http://www.yourwebsite.com/index.php?map=%map%");
    
    
get_mapname(g_mapnamesizeof(g_mapname) - 1);
}

public 
CmdMotd(client)
{
    new 
website[128];
    
get_pcvar_string(cvar_websitewebsitesizeof(website) - 1);
    
    
replace(websitesizeof(website) - 1"%map%"g_mapname);
    
    new 
motd[256];
    
formatex(motdsizeof(motd) - 1,\
        
"<html><head><meta http-equiv=^"Refresh^" content=^"0;url=%s^"></head><body><p><center>Loading...</center></p></body></html>",\
            
website);
    
    
show_motd(clientmotd);

zmd94 is offline
Kasutaja99
Junior Member
Join Date: Dec 2014
Old 01-18-2015 , 07:05   Re: [Problem] Motd that shows from the website
Reply With Quote #3

Well is there any better way, that is not with map thing?
Kasutaja99 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-18-2015 , 10:27   Re: [Problem] Motd that shows from the website
Reply With Quote #4

Just visit this thread:

https://forums.alliedmods.net/showthread.php?t=161352
zmd94 is offline
Kasutaja99
Junior Member
Join Date: Dec 2014
Old 01-18-2015 , 10:36   Re: [Problem] Motd that shows from the website
Reply With Quote #5

Well,i don't know is that a problem, but I got 2 motds on each plugin (1 motd on 1 plugin). Is that the problem?

Last edited by Kasutaja99; 01-18-2015 at 10:36.
Kasutaja99 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-18-2015 , 10:48   Re: [Problem] Motd that shows from the website
Reply With Quote #6

Just show the code.
zmd94 is offline
Kasutaja99
Junior Member
Join Date: Dec 2014
Old 01-18-2015 , 10:59   Re: [Problem] Motd that shows from the website
Reply With Quote #7

I don't get it.. In new game it pops up, but in server it won't..
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "test"
#define VERSION "0.99"
#define AUTHOR "test"

new g_iHeaderName
new g_iHeaderNameRules
new g_iUrlPlace
new g_iUrlPlaceRules

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /sms","Motd")
    
register_clcmd("say /teenused","Motd")
    
register_clcmd("say /reeglid","reeglid")
    
register_clcmd("say /rules","reeglid")
    
g_iHeaderName register_cvar("mt_Headername","SMS teenused")
    
g_iHeaderNameRules register_cvar("mt_Headername","SMS teenused")
    
g_iUrlPlace register_cvar("mt_Url","http://pohja-eesti.bugs3.com/serverid/hns/sms/index.php")
    
g_iUrlPlaceRules register_cvar("mt_Url","http://pohja-eesti.bugs3.com/serverid/hns/reeglid/index.php")
    
}

public 
Motd(id)
{
    new 
i_Header[33];
    new 
i_Url[33]
    
get_pcvar_string(g_iHeaderNamei_Headercharsmax(i_Header));
    
get_pcvar_string(g_iUrlPlacei_Urlcharsmax(i_Url));

    
show_motd(idi_Urli_Header);


public 
reeglid(id)
{
    new 
i_Header[33];
    new 
i_Url[33]
    
get_pcvar_string(g_iHeaderNameRulesi_Headercharsmax(i_Header));
    
get_pcvar_string(g_iUrlPlaceRulesi_Urlcharsmax(i_Url));

    
show_motd(idi_Urli_Header);


Last edited by Kasutaja99; 01-18-2015 at 10:59.
Kasutaja99 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-18-2015 , 11:35   Re: [Problem] Motd that shows from the website
Reply With Quote #8

What are the differents?
Code:
    g_iHeaderName = register_cvar("mt_Headername","SMS teenused")
    g_iHeaderNameRules = register_cvar("mt_Headername","SMS teenused")
    g_iUrlPlace = register_cvar("mt_Url","http://pohja-eesti.bugs3.com/serverid/hns/sms/index.php")
    g_iUrlPlaceRules = register_cvar("mt_Url","http://pohja-eesti.bugs3.com/serverid/hns/reeglid/index.php")
zmd94 is offline
Kasutaja99
Junior Member
Join Date: Dec 2014
Old 01-18-2015 , 11:52   Re: [Problem] Motd that shows from the website
Reply With Quote #9

One should show the first motd and second should show the second motd. That's the difference.
__
EDIT:
Making to clear to it:
PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /sms","Motd")
    
register_clcmd("say /teenused","Motd")
    
register_clcmd("say /reeglid","reeglid")
    
register_clcmd("say /rules","reeglid")
    
g_iHeaderName register_cvar("mt_Headername","SMS teenused")
    
g_iHeaderNameRules register_cvar("mt_HeadernameRules","Reeglid")
    
g_iUrlPlace register_cvar("mt_Url","http://pohja-eesti.bugs3.com/serverid/hns/sms/index.php")
    
g_iUrlPlaceRules register_cvar("mt_UrlSMS","http://pohja-eesti.bugs3.com/serverid/hns/reeglid/index.php")
    


Last edited by Kasutaja99; 01-18-2015 at 12:17.
Kasutaja99 is offline
Kasutaja99
Junior Member
Join Date: Dec 2014
Old 01-18-2015 , 12:27   Re: [Problem] Motd that shows from the website
Reply With Quote #10

Quote:
Originally Posted by Kasutaja99 View Post
One should show the first motd and second should show the second motd. That's the difference.
__
EDIT:
Making to clear to it:
PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /sms","Motd")
    
register_clcmd("say /teenused","Motd")
    
register_clcmd("say /reeglid","reeglid")
    
register_clcmd("say /rules","reeglid")
    
g_iHeaderName register_cvar("mt_Headername","SMS teenused")
    
g_iHeaderNameRules register_cvar("mt_HeadernameRules","Reeglid")
    
g_iUrlPlace register_cvar("mt_Url","http://pohja-eesti.bugs3.com/serverid/hns/sms/index.php")
    
g_iUrlPlaceRules register_cvar("mt_UrlSMS","http://pohja-eesti.bugs3.com/serverid/hns/reeglid/index.php")
    

OR

Is there anyways to get this work?

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /sms""sms")
    
register_clcmd("say /teenused""sms")
    
register_clcmd("say /reeglid""reeglid")
    
register_clcmd("say /rules""reeglid")
}

public 
sms(id) {
    
show_motd(id"http://pohja-eesti.bugs3.com/serverid/hns/sms/index.php""SMS teenused");
    return 
PLUGIN_HANDLED;
}

public 
reeglid(id) {
    
show_motd(id"http://pohja-eesti.bugs3.com/serverid/hns/reeglid/index.php""Reeglid / Rules");
    return 
PLUGIN_HANDLED;

Kasutaja99 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 15:25.


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