AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Colored TXT (https://forums.alliedmods.net/showthread.php?t=87539)

One 03-13-2009 11:00

Colored TXT
 
Hi,

i know there are already more topics about this but there i cant understand anything... :(

so i want to print ma txt colored.

PHP Code:

#include <amxmodx>

#define PLUGIN "Commands Helper"
#define VERSION "1.0"
#define AUTHOR "One"
new ad_time

public plugin_init()
{
    
register_clcmd("say cm""CommandHelper")
    
register_clcmd("say /cm""CommandHelper")
    
ad_time register_cvar("ads_time","60");
    
set_task(float(get_pcvar_num(ad_time)), "ads");
}

public 
CommandHelper(id)
{
    
show_motd(id,"commands.txt""Commands Helper")
}  
public 
ads()
{
    
client_print(0print_chat"Say /cm to see the validable Commands to you!")    
    
set_task(float(get_pcvar_num(ad_time)), "ads")


how can i give this random colors? exam :

first time : green
secund time : blue
& ....

minimiller 03-13-2009 11:05

Re: Colored TXT
 
PHP Code:

#include <amxmodx>
#include <colorchat>

#define PLUGIN "Commands Helper"
#define VERSION "1.0"
#define AUTHOR "One"
new ad_time

public plugin_init()
{
    
register_clcmd("say cm""CommandHelper")
    
register_clcmd("say /cm""CommandHelper")
    
ad_time register_cvar("ads_time","60");
    
set_task(float(get_pcvar_num(ad_time)), "ads");
}

public 
CommandHelper(id)
{
    
show_motd(id,"commands.txt""Commands Helper")
}  

public 
ads()
{
    switch(
random_num(1,4))
    {
        case 
1//Red
        
{
            
ColorChat(0RED"Say /cm to see the validable Commands to you!");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
2//Green
        
{
            
ColorChat(0GREEN"Say /cm to see the validable Commands to you!");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
3//Blue
        
{
            
ColorChat(0BLUE"Say /cm to see the validable Commands to you!");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
4//Grey
        
{
            
ColorChat(0GREY"Say /cm to see the validable Commands to you!");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
    }



One 03-13-2009 11:08

Re: Colored TXT
 
Ty, but :

#include <colorchat>

Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Cannot read from file: "colorchat" on line 2

Compilation aborted.
1 Error.
Could not locate output file C:\Dokumente und Einstellungen\One\Desktop\aaaaa\command_helper.amx (compile failed).


where can i dl colorchat.inc?

minimiller 03-13-2009 11:11

Re: Colored TXT
 
1 Attachment(s)
have fun =]

One 03-13-2009 11:12

Re: Colored TXT
 
Quote:

Originally Posted by minimiller (Post 779698)
have fun =]

TY. :oops:

One 03-13-2009 11:48

Re: Colored TXT
 
ok new problem :

when i say /cm this will open a motd but there is only :

PHP Code:

commands.txt 

i added ma commands.txt in config folder but this will not work :cry:

PHP Code:

<meta http-equiv="Content-Language" content="de">
<
style fprolloverstyle>A:hover {colorredfont-weightbold}
</
style>
<
body background="http://cs-rockers.de/background-1.jpg" bgproperties="fixed">

<
p align="center">
<
img border="0" src="http://cs-rockers.de/forum/styles/vphpbb3/imageset/site_logo.png" width="995" height="119"></p>
<
p align="left"><b>/TS2 oder TS2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit werdet ihr in TS²Server umgeleitet.</b></p>
<
p align="left"><b>/cam oder /camera&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit könnt ihr eure sicht wechseln</b></p>
<
p align="left"><b>blackjack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit könnt ihr Blackjack spielen</b></p>
<
p align="left"><b>/poker oder poker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit könnt ihr Poker spielen</b></p>
<
p align="left"><b>/hats&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit könnt ihr euch so genannte Hüte aussuchen</b></p>
<
p align="left"><b>/quesion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit könnt ihr Quiz starten und auf Fragen antworten und für jede Antwort 
2000 
gewinnen</b></p>
<
p align="left"><b>tetris&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
damit könnt ihr das alte gute Spiel &quot;TETRIS&quotspielen.</b></p

here ma command.txt

iNspiratioN 03-13-2009 11:50

Re: Colored TXT
 
you need to add it in CSTRIKE folder.

One 03-13-2009 11:54

Re: Colored TXT
 
Quote:

Originally Posted by iNspiratioN (Post 779718)
you need to add it in CSTRIKE folder.

hihi i 4get it :-D ty

iNspiratioN 03-13-2009 11:58

Re: Colored TXT
 
no prob :)

One 03-13-2009 12:16

Re: Colored TXT
 
ok i changed my idea & maked this to :

PHP Code:

#include <amxmodx>
#include <colorchat>

#define PLUGIN "Commands Helper"
#define VERSION "1.0"
#define AUTHOR "One"
new ad_time

public plugin_init()
{
    
ad_time register_cvar("ads_time","120");
    
set_task(float(get_pcvar_num(ad_time)), "ads");
}
public 
ads()
{
    switch(
random_num(1,24))
    {
        case 
1//Red
        
{
            
ColorChat(0RED"Schreib ts2 um in unser TS-Server umgeleitet zu werden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
2//Green
        
{
            
ColorChat(0GREEN"Schreib ts2 um in unser TS-Server umgeleitet zu werden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
3//Blue
        
{
            
ColorChat(0BLUE"Schreib ts2 um in unser TS-Server umgeleitet zu werden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
4//Grey
        
{
            
ColorChat(0GREY"Schreib ts2 um in unser TS-Server umgeleitet zu werden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
    case 
5//Red
        
{
            
ColorChat(0RED"Schreibe /cam um deine sicht zu wechseln.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
6//Green
        
{
            
ColorChat(0GREEN"Schreibe /cam um deine sicht zu wechseln.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
7//Blue
        
{
            
ColorChat(0BLUE"Schreibe /cam um deine sicht zu wechseln.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
8//Grey
        
{
            
ColorChat(0GREY"Schreibe /cam um deine sicht zu wechseln.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        case 
9//Red
        
{
            
ColorChat(0RED"Schreibe blackjack um Blackjack zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
10//Green
        
{
            
ColorChat(0GREEN"Schreibe blackjack um Blackjack zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
11//Blue
        
{
            
ColorChat(0BLUE"Schreibe blackjack um Blackjack zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
12//Grey
        
{
            
ColorChat(0GREY"Schreibe blackjack um Blackjack zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
    case 
13//Red
        
{
            
ColorChat(0RED"Schreibe poker um Poker zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
14//Green
        
{
            
ColorChat(0GREEN"Schreibe poker um Poker zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
15//Blue
        
{
            
ColorChat(0BLUE"Schreibe poker um Poker zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
16//Grey
        
{
            
ColorChat(0GREY"Schreibe poker um Poker zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        
    case 
17//Red
        
{
            
ColorChat(0RED"Schreibe /hats um dich zu verkleiden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
18//Green
        
{
            
ColorChat(0GREEN"Schreibe /hats um dich zu verkleiden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
19//Blue
        
{
            
ColorChat(0BLUE"Schreibe /hats um dich zu verkleiden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
20//Grey
        
{
            
ColorChat(0GREY"Schreibe /hats um dich zu verkleiden.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
    case 
21//Red
        
{
            
ColorChat(0RED"Schreibe /quiz um an unserem quiz teilzunehmen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
22//Green
        
{
            
ColorChat(0GREEN"Schreibe /quiz um an unserem quiz teilzunehmen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
23//Blue
        
{
            
ColorChat(0BLUE"Schreibe /quiz um an unserem quiz teilzunehmen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
24//Grey
        
{
            
ColorChat(0GREY"Schreibe /quiz um an unserem quiz teilzunehmen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
    case 
21//Red
        
{
            
ColorChat(0RED"Schreibe tetris um Tetris zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
22//Green
        
{
            
ColorChat(0GREEN"Schreibe tetris um Tetris zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
23//Blue
        
{
            
ColorChat(0BLUE"Schreibe tetris um Tetris zu spielen.");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
        }
        case 
24//Grey
        
{
            
ColorChat(0GREY"Schreibe tetris um Tetris zu spielen..");
            
set_task(float(get_pcvar_num(ad_time)), "ads");
    }


but error on line 57 :

PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Warning
Loose indentation on line 57
Error
Invalid statementnot in switch on line 57
Warning
Expression has no effect on line 57
Error
Expected token";"but found ":" on line 57
Error
Invalid expressionassumed zero on line 57
Error
Too many error messages on one line on line 57

Compilation aborted
.
4 Errors.
Could not locate output file C:\Dokumente und Einstellungen\One\Desktop\aaaaa\command_helper.amx (compile failed). 

line 57 : case 9: //Red


All times are GMT -4. The time now is 09:02.

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