Raised This Month: $ Target: $400
 0% 

Changing the text color to green


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akaddict
Junior Member
Join Date: Mar 2007
Old 05-01-2007 , 20:52   Changing the text color to green
Reply With Quote #1

I need help changing the color of the text when im in my server after a couple seconds it would say [AMX] Bunnyhopping is enabled on this server. Please hold down jump. [Ect]. I tried everything =[ im new at this. Any help appreciated. Thank you


Quote:
/*
*
* Author: Cheesy Peteza
* Date: 22-Apr-2004 (updated 2-March-2005)
*
*
* Description: Enable bunny hopping in Counter-Strike.
*
* Cvars:
* bh_enabled 1 to enable this plugin, 0 to disable.
* bh_autojump If set to 1 players just need to hold down jump to bunny hop (no skill required)
* bh_showusage If set to 1 it will inform joining players that bunny hopping has been enabled
* and how to use it if bh_autojump enabled.
*
* Requirements: AMXModX 0.16 or greater
*
*
*/
#include <amxmodx>
#include <engine>
#define FL_WATERJUMP (1<<11) // player jumping out of water
#define FL_ONGROUND (1<<9) // At rest / on the ground
public plugin_init() {
register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")
register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
register_cvar("bh_enabled", "1")
register_cvar("bh_autojump", "1")
register_cvar("bh_showusage", "1")
}
public client_PreThink(id) {
if (!get_cvar_num("bh_enabled"))
return PLUGIN_CONTINUE
entity_set_float(id, EV_FL_fuser2, 0.0) // Disable slow down after jumping
if (!get_cvar_num("bh_autojump"))
return PLUGIN_CONTINUE
// Code from CBasePlayer::Jump (player.cpp) Make a player jump automatically
if (entity_get_int(id, EV_INT_button) & 2) { // If holding jump
new flags = entity_get_int(id, EV_INT_flags)
if (flags & FL_WATERJUMP)
return PLUGIN_CONTINUE
if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
return PLUGIN_CONTINUE
if ( !(flags & FL_ONGROUND) )
return PLUGIN_CONTINUE
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
velocity[2] += 250.0
entity_set_vector(id, EV_VEC_velocity, velocity)
entity_set_int(id, EV_INT_gaitsequence, 6) // Play the Jump Animation
}
return PLUGIN_CONTINUE
}
public client_authorized(id)
set_task(30.0, "showUsage", id)
public showUsage(id) {
if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
return PLUGIN_HANDLED
if ( !get_cvar_num("bh_autojump") ) {
client_print(id, print_chat, "[AMX] Bunny hopping is enabled on this server. You will not slow down after jumping.")
} else {
client_print(id, print_chat, "[AMX] Auto bunny hopping is enabled on this server. Just hold down jump to bunny hop.")
}
return PLUGIN_HANDLED
}
akaddict is offline
Defillbert
AMX Mod X Donor
Join Date: Aug 2006
Old 05-01-2007 , 20:56   Re: Changing the text color to green
Reply With Quote #2

PHP Code:
set_hudmessage(02550, -1.00.5106.012.0)
show_hudmessage(id"[AMXX] Bunnyhoping is blahblahblah..."
Would be a green hud message, im not sure how to change chat colors however.
Defillbert is offline
akaddict
Junior Member
Join Date: Mar 2007
Old 05-01-2007 , 21:01   Re: Changing the text color to green
Reply With Quote #3

yeah i dont know how to input it. i just tried it says failed to be compiled. >:[
akaddict is offline
Defillbert
AMX Mod X Donor
Join Date: Aug 2006
Old 05-01-2007 , 21:26   Re: Changing the text color to green
Reply With Quote #4

Quote:
Originally Posted by Defillbert View Post
PHP Code:
set_hudmessage(02550, -1.00.5106.012.0)
show_hudmessage(id"[AMXX] Bunnyhoping is blahblahblah..."
Would be a green hud message, im not sure how to change chat colors however.
PHP Code:
/*
*
* Author: Cheesy Peteza
* Date: 22-Apr-2004 (updated 2-March-2005)
*
*
* Description: Enable bunny hopping in Counter-Strike.
*
* Cvars:
* bh_enabled 1 to enable this plugin, 0 to disable.
* bh_autojump If set to 1 players just need to hold down jump to bunny hop (no skill required)
* bh_showusage If set to 1 it will inform joining players that bunny hopping has been enabled
* and how to use it if bh_autojump enabled.
*
* Requirements: AMXModX 0.16 or greater
*
*
*/
#include <amxmodx>
#include <engine>
#define FL_WATERJUMP (1<<11) // player jumping out of water
#define FL_ONGROUND (1<<9) // At rest / on the ground
public plugin_init() {
register_plugin("Super Bunny Hopper""1.2""Cheesy Peteza")
register_cvar("sbhopper_version""1.2"FCVAR_SERVER)
register_cvar("bh_enabled""1")
register_cvar("bh_autojump""1")
register_cvar("bh_showusage""1")
}
public 
client_PreThink(id) {
if (!
get_cvar_num("bh_enabled"))
return 
PLUGIN_CONTINUE
entity_set_float
(idEV_FL_fuser20.0// Disable slow down after jumping
if (!get_cvar_num("bh_autojump"))
return 
PLUGIN_CONTINUE
// Code from CBasePlayer::Jump (player.cpp) Make a player jump automatically
if (entity_get_int(idEV_INT_button) & 2) { // If holding jump
new flags entity_get_int(idEV_INT_flags)
if (
flags FL_WATERJUMP)
return 
PLUGIN_CONTINUE
if ( entity_get_int(idEV_INT_waterlevel) >= )
return 
PLUGIN_CONTINUE
if ( !(flags FL_ONGROUND) )
return 
PLUGIN_CONTINUE
new Float:velocity[3]
entity_get_vector(idEV_VEC_velocityvelocity)
velocity[2] += 250.0
entity_set_vector
(idEV_VEC_velocityvelocity)
entity_set_int(idEV_INT_gaitsequence6// Play the Jump Animation
}
return 
PLUGIN_CONTINUE
}
public 
client_authorized(id)
set_task(30.0"showUsage"id)
public 
showUsage(id) {
if ( !
get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
return 
PLUGIN_HANDLED
if ( !get_cvar_num("bh_autojump") ) {
set_hudmessage(02550, -1.00.5106.012.0)
show_hudmessage(id"[AMXX] Bunnyhoping is blahblahblah...")
} else {
 
set_hudmessage(02550, -1.00.5106.012.0)
show_hudmessage(id"[AMXX] Bunnyhoping is blahblahblah...")
}
return 
PLUGIN_HANDLED

Change
show_hudmessage(id, "[AMXX] Bunnyhoping is blahblahblah...")
to whatever, without deleting the quotes.
Defillbert is offline
akaddict
Junior Member
Join Date: Mar 2007
Old 05-01-2007 , 22:11   Re: Changing the text color to green
Reply With Quote #5

Thanks, well is there anyway you could change the chat color instead of putting a hud message in there?

but this is fine if you dont know how to thanks !!!!
akaddict is offline
Defillbert
AMX Mod X Donor
Join Date: Aug 2006
Old 05-01-2007 , 22:21   Re: Changing the text color to green
Reply With Quote #6

I myself do not know of a way to change chat message colors, but try asking around.
Defillbert is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 05-01-2007 , 22:28   Re: Changing the text color to green
Reply With Quote #7

There's a tutorial:
http://forums.alliedmods.net/showthread.php?t=45753
__________________
Oh yeah

Last edited by Drak; 05-01-2007 at 22:30.
Drak is offline
Send a message via MSN to Drak
Reply


Thread Tools
Display Modes

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 06:46.


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