Raised This Month: $ Target: $400
 0% 

New MOTD style


Post New Thread Reply   
 
Thread Tools Display Modes
StormZone
BANNED
Join Date: Nov 2008
Location: [RO]Hunedoara/Petrosani
Old 10-17-2009 , 16:02   Re: New MOTD style
Reply With Quote #11

How?
StormZone is offline
Send a message via Yahoo to StormZone Send a message via Skype™ to StormZone
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-17-2009 , 16:26   Re: New MOTD style
Reply With Quote #12

Ok make a new folder in your cstrike directory and name it MotdFolder, Inside that place a file named Text.txt, then use this code in your server.

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

#define PLUGIN "Rules"
#define VERSION "1.0"
#define AUTHOR "OneMoreLevel"

new const message[] =
{
"If you see this, that means that you have no text.txt in your MotdFolder/ folder"
}
new const 
header[] =
{
"This is a header"
}

public 
plugin_init() {
    
register_plugin("Rules""1.0""OneMoreLevel")
    
    
register_clcmd ("say /rules""rules"0"Show the rules")
}
public 
rules(id)
{    if ( 
file_exists "MotdFolder/text.txt" ) == )
    
show_motd(idmessageheader
    else if ( 
file_exists "MotdFolder/text.txt" ) == )
    
show_motd(id"MotdFolder/rules.txt""My file"
    

__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
StormZone
BANNED
Join Date: Nov 2008
Location: [RO]Hunedoara/Petrosani
Old 10-17-2009 , 17:01   Re: New MOTD style
Reply With Quote #13

Thanks a lot.
StormZone is offline
Send a message via Yahoo to StormZone Send a message via Skype™ to StormZone
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-17-2009 , 17:06   Re: New MOTD style
Reply With Quote #14

No Problem
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
StormZone
BANNED
Join Date: Nov 2008
Location: [RO]Hunedoara/Petrosani
Old 10-17-2009 , 17:15   Re: New MOTD style
Reply With Quote #15

So if y do this then it will display al the characther is the txt with no limit?
StormZone is offline
Send a message via Yahoo to StormZone Send a message via Skype™ to StormZone
StormZone
BANNED
Join Date: Nov 2008
Location: [RO]Hunedoara/Petrosani
Old 10-17-2009 , 17:34   Re: New MOTD style
Reply With Quote #16

Not workin.
I did exatly wath it sez and when y tipe /rules it show me an motd thay show the path of the file.Not the file content.

EDIT:
This is wath y want to display.
PHP Code:
public cmd_whoisidarg[] )
{
    new 
name[32], 0;
    new 
message[4096] = ""temp[1024] = ""stemp[1024] = ""temp2[64] = ""sname[64] = "";
    new 
bool:bHasASkill false;

    new 
pid cmd_target(idarg0);

    if (!
pid)
    {
        
client_print(idprint_chat"[%s] Could not find a matching player [%s]"MODarg);
        return 
PLUGIN_HANDLED;
    }

    
get_user_name(pidname31);

    
// Count # skillpts unspent
    
new skillptsavail get_availskillptspid );

    
// Get the # available attrib pts
    
new apts get_availattribptspid );

    
// Get the # available resist pts
    
new rpts get_availresistptspid );

    
// Calculate how many attrib/resist points can be spent
    
new extra_xp = (playerxp[pid] - xplevel_lev[enh_minlevel]);
    if (
extra_xp 0)
    {
        
extra_xp 0;
    }

    new 
exp = (extra_xp 10);

    
addmessage4096"<body bgcolor=#000000><font color=#FFB000>" );
    
formatstemp1024"<center><b>Character Sheet: %s</b></center><p>"name );

    
addmessage4096stemp );
    
addmessage4096"<center><table width=800 border=1 cellpadding=4 cellspacing=4>" );
    
addmessage4096"<tr><td valign=top width=50%><font color=#FFB000>" );

    
formatstemp1024"Player Name: %s <br>"name );
    
addmessage4096stemp );

    
formatstemp1024"Player Level: %d <br>"p_level[pid] );
    
addmessage4096stemp );

    
formatstemp1024"Player Rank: %s <br>"p_rank[pid] );
    
addmessage4096stemp );

    
formatstemp1024"Skillpts Available: %d <br>"skillptsavail );
    
addmessage4096stemp );

    
formatstemp1024"Ultimates: %d/%d <br>"ultlearned[id], p_maxultimates[id] );
    
addmessage4096stemp );

    
addmessage4096"</td><td valign=top width=50%><font color=#FFB000>" );

    if (
p_level[pid] == (MAX_LEVEL-1))
    {
        
formatstemp1024"Player XP: %d <br>"playerxp[pid] );
    }
    else
    {
        
formatstemp1024"Player XP: %d / %d <br>",
        
playerxp[pid], xplevel_lev[p_level[pid]+1] );
    }

    
addmessage4096stemp );

    if (
p_level[pid] == (MAX_LEVEL-1))
    {
        
addmessage4096"XP Needed: NA <br>" );
    }
    else
    {
        
formatstemp1024"XP Needed: %d <br>", (xplevel_lev[p_level[pid]+1] - playerxp[pid]) );
        
addmessage4096stemp );
    }

    
formatstemp1024"Enhancement XP: %d <br>"exp );
    
addmessage4096stemp );

    
formatstemp1024"Attribute Pts Available: %d <br>"apts );
    
addmessage4096stemp );

    
formatstemp1024"Resistance Pts Available: %d <br>"rpts );
    
addmessage4096stemp );

    
addmessage4096"</td></tr><tr><td valign=top><font color=#FFB000>" );
    
addmessage4096"<center><b>Attributes</b></center><p>" );

    
formatstemp1024"Strength: %d / %d <br>"p_attribs[pid][ATTRIBIDX_STR], ATTRIB_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Intellect: %d / %d <br>"p_attribs[pid][ATTRIBIDX_INT], ATTRIB_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Dexterity: %d / %d <br>"p_attribs[pid][ATTRIBIDX_DEX], ATTRIB_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Agility: %d / %d <br>"p_attribs[pid][ATTRIBIDX_AGI], ATTRIB_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Constitution: %d / %d <br>"p_attribs[pid][ATTRIBIDX_CON], ATTRIB_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Wisdom: %d / %d <br>"p_attribs[pid][ATTRIBIDX_WIS], ATTRIB_MAX_VALUE );
    
addmessage4096stemp );

    
addmessage4096"</td><td valign=top><font color=#FFB000>" );
    
addmessage4096"<center><b>Resistances</b></center><p>" );

    
formatstemp1024"Poison Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_POISON], RESIST_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Disease Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_DISEASE], RESIST_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Electricity Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_ELECTRIC], RESIST_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Fire Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_FIRE], RESIST_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Magic Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_MAGIC], RESIST_MAX_VALUE );
    
addmessage4096stemp );

    
formatstemp1024"Rot Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_ROT], RESIST_MAX_VALUE );
    
addmessage4096stemp );
    
    
formatstemp1024"Rot Resistance: %d / %d <br>"p_resists[pid][RESISTIDX_ICE], RESIST_MAX_VALUE );
    
addmessage4096stemp );

    
addmessage2047"</td></tr><tr><td colspan=2 valign=top><font color=#FFB000>" );
    
addmessage2047"<center><b>Skills Trained</b></center><p>" );
    
//add( message, 4096, "<table align=center border=0 cellpadding=4 cellspacing=4>" );

    //new tmpCounter = 1;

    
for ( 1MAX_SKILLSj++ )
    {

        
//counter++;

        
if (<= 8)
            
copy(sname31skillset1[j]);
        else if (
<= 16)
            
copy(sname31skillset2[j-8]);
        else if (
<= 24)
            
copy(sname31skillset3[j-16]);
        else if (
<= 32)
            
copy(sname31skillset4[j-24]);
        else if (
<= 40)
            
copy(sname31skillset5[j-32]);
        else if (
<= 48)
            
copy(sname31skillset6[j-40]);
        else if (
<= 56)
            
copy(sname31skillset7[j-48]);
        else if (
<= 64)
            
copy(sname31skillset8[j-56]);

        if (
p_skills[pid][j])
        {
            
bHasASkill true;
            new 
mstr[32] = "";
            if ((
p_skills[pid][j] == skill_limits[j]) && (skill_limits[j] > 1))
            {
                
copy(mstr31"(Master)");
            }

            
format(temp2,64,"%s [level %d] %s <br>"snamep_skills[pid][j], mstr );
            
add(temp,1024,temp2);
        }
    }

    if (!
bHasASkill)
    {
        
add(temp,1024"No skills trained");
    }

    
addmessage2048temp );
    
addmessage2048"</td></tr>" );

    
addmessage,2048,"</table></center>" );

    new 
mtitle[64];
    
formatmtitle64"Character Sheet for %s"name );
    
show_motdidmessagemtitle );

    return 
PLUGIN_HANDLED;


Last edited by StormZone; 10-17-2009 at 17:40.
StormZone is offline
Send a message via Yahoo to StormZone Send a message via Skype™ to StormZone
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-18-2009 , 00:40   Re: New MOTD style
Reply With Quote #17

The second argument of show_motd() can only be a certain length. Therefore you cannot circumvent this if you use show_motd() with the whole message contained in the string argument. You would have to link to an external page (a webserver html page).
__________________
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 15:42.


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