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

[HELP] Please help me to Build say motd plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VarmaRitik
Senior Member
Join Date: Jul 2014
Location: India
Old 02-02-2015 , 02:07   [HELP] Please help me to Build say motd plugin
Reply With Quote #1

Hello to all for giving their valuable time to Read this post..

I got a "say /motd" plugin but I want to Build my own "motd" plugin.
Whenever a player types motd in Chat or in TeamChat I want to display the default Counter-Strike 1.6 motd.
Don't make this plugin or don't give me the link for this plugin.. I want to Learn this..
So, if anyone can help me to Build this plugin.. It will be Great!!

Thank You.

Last edited by VarmaRitik; 02-02-2015 at 02:08.
VarmaRitik is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 02-02-2015 , 02:18   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("MOTD""1.0""Gullu Bhai");
    
register_clcmd("say /motd""cmdMOTD");
    
register_clcmd("say_team /motd""cmdMOTD");
}

public 
cmdMOTD(id)
{
    
show_motd(id"site url / file location ""title");


Last edited by tousif; 02-02-2015 at 02:28.
tousif is offline
Old 02-02-2015, 04:21
VarmaRitik
This message has been deleted by VarmaRitik.
VarmaRitik
Senior Member
Join Date: Jul 2014
Location: India
Old 02-02-2015 , 05:06   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #3

@tousif,
Thank You, but I got a problem.. it's not displaying me the motd..See the Screenshot below.

I have created "admins.txt" to be display as my motd..

Admins.txt
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Admins motd</title>
<style type="text/css">
pre     {
        font-family:Trebuchet MS;
        color:#FFB000;
        }
body    {
        background:#000000;
        margin-left:8px;
        margin-top:0px;
        }
a    {
        text-decoration:    none;
    }
a:link  {
    color:  #FFFFFF;
    }
a:visited   {
    color:  #FFFFFF;
    }
a:active    {
    color:  #FFFFFF;
    }
a:hover {
    color:  #FFFFFF;
    text-decoration:    underline;
    }
</style>
</head>
<body scroll="no">
<pre>
Our server admins are :
1. Striker [Owner]

for adminship contact us at <a href="http://www.facebook.com/VarmaRitik">Facebook</a>
</pre>
</body>
</html>
plugin source code
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Say MOTD"
#define VERSION "1.0"
#define AUTHOR "Striker"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /motd", "cmdMOTD");
    register_clcmd("say_team /motd", "cmdMOTD");
}

public cmdMOTD(id) {
    show_motd(id, "D:\Counter-Strike 1.6\cstrike\admins.txt", "Our Server Admins");
}
What did I messed up with?
please help me to solve this problem..

Thank You.
Attached Thumbnails
Click image for larger version

Name:	motd problem.png
Views:	460
Size:	33.8 KB
ID:	142095  

Last edited by VarmaRitik; 02-02-2015 at 05:07.
VarmaRitik is offline
choloo
Senior Member
Join Date: Nov 2014
Location: Groznyj, Chechnya
Old 02-02-2015 , 05:55   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #4

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)

// Add your code here...
register_clcmd("say /motd""cmdMOTD");
}

public 
cmdVIP(id) {
show_motd(id"admins.txt");

And here a good .txt, just edit it how you want and put in cstrike folder!

EDIT: your problem when you see white motd is:
1. You need to change Cs 1.6 client and use IE
2. If you have path in the code you need to put it in: "Resource/UI/MOTD.res"
Attached Files
File Type: txt vip.txt (1.5 KB, 307 views)

Last edited by choloo; 02-02-2015 at 05:58.
choloo is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 02-02-2015 , 06:14   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #5

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("MOTD""1.0""Author");
    
register_clcmd("say /motd""cmdMOTD");
    
register_clcmd("say_team /motd""cmdMOTD");
}

public 
cmdMOTD(id)
{
    
show_motd(id"admins.txt""Our Server Admins");

try it
and why did u aded this include <amxmisc>



Its working Compile the one i gave

Last edited by tousif; 02-02-2015 at 06:32.
tousif is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-02-2015 , 06:16   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #6

Code:
#include <amxmodx>

public plugin_init() 
{
    register_clcmd("say /motd", "cmdMOTD");
    register_clcmd("say_team /motd", "cmdMOTD");
}

public cmdMOTD(id) 
{
    show_motd(id, "admins.txt", "Our Server Admins");
}
zmd94 is offline
VarmaRitik
Senior Member
Join Date: Jul 2014
Location: India
Old 02-02-2015 , 10:07   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #7

Thank You all of you guys for helping me..
I'll never forget this..
And the plugin is working.

Thank You..

Last edited by VarmaRitik; 02-02-2015 at 10:07.
VarmaRitik is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 02-03-2015 , 01:20   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #8

Quote:
Originally Posted by VarmaRitik View Post
Thank You all of you guys for helping me..
I'll never forget this..
And the plugin is working.

Thank You..
np its our duty to help
tousif is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 02-03-2015 , 01:50   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #9

Instead of asking everything you can start reading the Code and Snippets section.
Do some homework by yourself.getting Spoon-fed every time will not actually help much according to me.
Google is your friend.. Look into source codes and try to understand how the code is working.. when you get stuck .. ask the issue here.
Rest is upto you.
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
VarmaRitik
Senior Member
Join Date: Jul 2014
Location: India
Old 02-03-2015 , 02:22   Re: [HELP] Please help me to Build say motd plugin
Reply With Quote #10

Well as you guys said "Learn Yourself".. Hmm. It's weird..
But I'll learn myself and I can't find Source Code for plugins.
I tried Searching several times for several code but didn't get at all..

So if anyone can provide me the Source Code so I can start learning myself.

Thank You.
VarmaRitik is offline
Old 02-03-2015, 02:26
VarmaRitik
This message has been deleted by VarmaRitik.
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 08:31.


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