Raised This Month: $ Target: $400
 0% 

set_task print color chat


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FLAiTE
Member
Join Date: Aug 2008
Old 12-24-2014 , 10:15   set_task print color chat
Reply With Quote #1

Hi. I'm new to AMXX coding, and i'd have a simple question:

I'm using AMXX Beta v1.8.3+, and i'd like to create my own plugin that prints chat messages.
so far, i did this:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Simple Messages"
#define VERSION "1.0"
#define AUTHOR "FLAiTE"

public plugin_init() 
{
    
set_task(10.0,  "m1"___"b"0);
    
set_task(30.0,  "m2"___"b"0);
    
set_task(50.0,  "m3"___"b"0);
    
set_task(70.0,  "m4"___"b"0);
    
set_task(90.0,  "m5"___"b"0);
}

public 
m1(id)
{
    
client_print_color(0print_team_red"^1* ^3RED_message");
}

public 
m2(id)
{
    
client_print_color(0print_team_blue"^1* ^3BLUE_message");
}

public 
m3(id)
{
    
client_print_color(0print_team_grey"^1* ^3GREY_message");
}

public 
m4(id)
{
    
client_print_color(0print_team_default"^1* ^4green_message");
}

public 
m5(id)
{
    
client_print_color(0print_team_default"^1* yellow_message");

even if it compiles without errors, the plugin does not display the messages the way i want.
for example, the first time it prints:
* RED_message
the second time it prins:
* RED_message
* BLUE_message
third time:
* RED_message
etc.

I mean...it's working but not the way i want it to.
My purpose is to print multiple messages, at different time intervals. To be more specific:
* message 1
(60 seconds later)
* message 2
(30 seconds later)
* message 3
(45 seconds later)
* message 4
etc.

also, after all messages are finished, i want it to restart with * message 1.
It is imperative that the messages have different colors, else i could just modify this plugin, and print them all (for CT/T/SPEC the SAME color) RED, GREY or BLUE, depending on my choice.

so, can anyone help me?
thanks!
FLAiTE is offline
 



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:18.


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