Raised This Month: $ Target: $400
 0% 

quick question.....


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sliver
New Member
Join Date: May 2004
Old 08-31-2004 , 17:02   quick question.....
Reply With Quote #1

im pretty new to making plugins but not to coding but i was wondering how i would go about reading a text file and displaying it in an MOTD or the console (whatever is easier)

pretty basic plugin just want some tips and natives to get me going



thx
Sliver is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 08-31-2004 , 17:28  
Reply With Quote #2

Lol, you don't need to be good at scripting to figure this out. Check out the include files.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
Sliver
New Member
Join Date: May 2004
Old 08-31-2004 , 17:36  
Reply With Quote #3

ok ok here is what i got so far
Code:
#include <amxmodx>
#include <amxmisc>


public showlastmaps(id)
{
        new header[80]
        new myversion[32]
        new lastmaps[64]
        get_configsdir(lastmaps, 63)
        format(lastmaps,63,"%s/map_manage/lastmapsplayed.txt", lastmaps)
        get_cvar_string("Deags_Map_Manage",myversion,31)
        format ( header , 79 ,"Displaying Last Maps Played",myversion )

        show_motd(id,lastmaps,header)
	return PLUGIN_CONTINUE
}

public plugin_init()
{
	register_plugin("Lastmaps","0.1","Sliver")
	register_clcmd("say /lastmaps","showlastmaps")
	return PLUGIN_CONTINUE
}
everything works as i wanted it to but here is what my lastmaps.txt looks like:
de_nuke
de_dust2
de_torn
de_dust2
de_aztec
//Generated by map_nominate plugin,
//these are most recent maps played

and that is what pops up in the MOTD, would there be any way to get rid of those comments? (the generated by map_nominate)
Sliver is offline
KRoT@L
Member
Join Date: Aug 2004
Location: http://www.amxmod.net
Old 08-31-2004 , 17:36  
Reply With Quote #4

/* Shows text in MOTD window. When there is no header, the MOTD title
* will be the name of server. If message is filename, then a contents
* of this file will be displayed as MOTD. */
native show_motd(player,const message[],const header[]="");

ex : show_motd(player, "/addons/amxx/your_motd.txt", "Motd title" )
KRoT@L is offline
Sliver
New Member
Join Date: May 2004
Old 08-31-2004 , 19:38  
Reply With Quote #5

ok...got it......is there a way to adjust the font/color of the MOTD? i know it is all in HTML but how owuld i make the backround black and the text red and bold, but still displaying the txt file, is that possible?
Sliver is offline
KRoT@L
Member
Join Date: Aug 2004
Location: http://www.amxmod.net
Old 08-31-2004 , 23:53  
Reply With Quote #6

Taken from the takeadookie plugin :

Code:
public do_help(id){     new len = 1300     new buffer[1301]     new n = 0     n += copy( buffer[n],len-n,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><body><pre>")     n += copy( buffer[n],len-n,"To take a dookie on dead bodies you have to bind a key to: takeadookie^n^n")     n += copy( buffer[n],len-n,"In order to bind a key you must open your console and use the bind command: ^n^n")     n += copy( buffer[n],len-n,"bind ^"key^" ^"command^" ^n^n")     n += copy( buffer[n],len-n,"ex:^n^n")     n += copy( buffer[n],len-n,"    bind f takeadookie      bind MOUSE3 takeadookie^n^n")     n += copy( buffer[n],len-n,"Now you can step over any dead body and press your dookie key^n^n")     n += copy( buffer[n],len-n,"For every 2 headshots you make your dookie is turned into a superdookie^n")     n += copy( buffer[n],len-n,"which just adds more effects for grossness^n")     n += copy( buffer[n],len-n,"</pre></body></html>")     show_motd(id,buffer,"Dookie Help")     return PLUGIN_CONTINUE }
KRoT@L 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 17:12.


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