AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Color change in every 3 sec (https://forums.alliedmods.net/showthread.php?t=56553)

vl@d 06-16-2007 04:05

Color change in every 3 sec
 
Can anyone give me some explication about how to change the color of the text every 3-5 sec.
I mean con_color for the client.
Can anyone tell me. :)
I tried to make a plugin but i faild. :(

regalis 06-16-2007 04:18

Re: Color change in every 3 sec
 
set_user_info(id, "con_color", "R G B")

greetz regalis

Alka 06-16-2007 04:20

Re: Color change in every 3 sec
 
And make a task!
Code:

set_task(.....
:wink:

vl@d 06-16-2007 04:59

Re: Color change in every 3 sec
 
damn not working. :((
the color is not changing.
Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("color_change", "1");
    register_concmd("color","color_change",ADMIN_ALL,"color change")
}

public color_change(id){
   
    set_task(0.0,"color1")
    set_task(3.0,"color2")

    return PLUGIN_HANDLED
}

public color1(id) {
    set_user_info(id,"con_color","255 24 30")
}

public color2(id){
    set_user_info(id,"con_color","240 240 240")
}


Alka 06-16-2007 05:15

Re: Color change in every 3 sec
 
=>>
Code:

#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR)
 register_concmd("amx_color","change_color")
}
 
public change_color()
{
 set_task(3.0,"set_color",_,_,_,"b")
}
 
public set_color()
{
 new players[32], num
 get_players(players, num)
 
 new player
 for(new i = 0; i < num; i++)
 {
  player = players[i]
 
  client_cmd(player,"con_color %d %d %d",random(256),random(256),random(256))
 }
}

Type amx_color and color of chat for all players will change in random colors! Interval:3 sec.

vl@d 06-16-2007 05:22

Re: Color change in every 3 sec
 
it works.
thx very much. :D

Edit: it works ir changes the color but i saw only 3 colors in total. :|


All times are GMT -4. The time now is 10:41.

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