AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Color message help (https://forums.alliedmods.net/showthread.php?t=139965)

dreamedward 10-07-2010 10:45

Color message help
 
Can someone give me a code for ZP for color messages?I mean i have custom classes like Climb Zombie, Flame Zombie and when you became a Flame zombie to show you in the chat [Ludacris-Zombie] Your ability is to throw Flame at people. Just press E.I would like to enter on my other custom zombie classes a code that comes up in the chat when they become the special class zombie.I hope you've understood me right.
Thanks in advance! :)

SaM.ThE.MaN 10-07-2010 10:57

Re: Color message help
 
This is a ChatColor stock .. Once a player becomes a special class zombie ... add the ChatColor below your code of player becoming a special class zombie .

Ex:
if(player == Flame Zombie)
ChatColor(id, !g[Ludacris-Zombie] !y Your ability is to throw !gFlame !yat people. Just press !gE !y.

and aT THE END OF YOUR SCRIPT ADD THE STOCK



PHP Code:

new g_iMsgSayText

ChatColor
(id, !g[Ludacris-Zombie] !y Your ability is to throw !gFlame !yat peopleJust press !gE !y.

//I Use this stock for all my plugins that I want color chat
// !g is for Green
// !t is for TeamColor
// !y is for Yellow (Normal Color)
stock ChatColor(const id, const input[], any:...) { 
    
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLE,g_iMsgSayText,_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }



dreamedward 10-07-2010 11:05

Re: Color message help
 
I want to add it on this plugin how will this happen?
PHP Code:

/*
Wallclimb v1.0f by Python1320
Plagued Version 0.22 by Dabbi
Allows Poison Zombie to Climb Walls in Zombie Plague [3.62]
CVARS: zp_wallclimb 0 = Off / 1 = Hold USE / 2 = Hold JUMP and DUCK  (Default 1)
 zp_wallclimb_nemesis 0 = Disable wallclimb during nemesis round. / 1 = Enable (Default 1)
 zp_wallclimb_survivor 0 = Disable wallclimb during survivor round. / 1 = Enable (Default 0)
 
Changes:
 0.22
  Made the function wallclimb return a value.
  Put plugin version to a cvar.
 0.21
  Added cvars to enable disable wallclimb durin survivor/nemesis round
 0.2
  Added cvar to enable / disable Walllclimb Plugin
 0.1
  First release.
*/
#include <amxmodx>
// #include <engine>
#include <fakemeta>
#include <cstrike>
#include <zombieplague.inc>
//#include <fakemeta_util>
#define STR_T           33
// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button) 
/* stock fm_get_user_button(index)
 return pev(index, pev_button) */
#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
 return pev(index, pev_flags) */
stock fm_set_user_velocity(entity, const Float:vector[3]) {
 
set_pev(entitypev_velocityvector);
 return 
1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33]
new 
Float:g_wallorigin[32][3]
new 
cvar_zp_wallclimbcvar_zp_wallclimb_nemesiscvar_zp_wallclimb_survivor
new g_zclass_climb
// Climb Zombie Atributes
new const zclass_name[] = { "Climbing Zombie" // name
new const zclass_info[] = { "Can climb on walls" // description
new const zclass_model[] = { "sprzmrbk" // model
new const zclass_clawmodel[] = { "v_sprzmrbkhn.mdl" // claw model
const zclass_health 1750 // health
const zclass_speed 270 // speed
const Float:zclass_gravity 0.8 // gravity
const Float:zclass_knockback 1.5 // knockback
public plugin_init() 
{
 
register_plugin("[ZP] Wallclimb ""1.0""WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
 
register_forward(FM_Touch,   "fwd_touch")
 
register_forward(FM_PlayerPreThink,  "fwd_playerprethink")
 
//register_forward(FM_PlayerPostThink,  "fwd_playerpostthink")
 
register_event("DeathMsg","EventDeathMsg","a")
 
//register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
 
cvar_zp_wallclimb register_cvar("zp_wallclimb""1")
 
cvar_zp_wallclimb_survivor register_cvar("zp_wallclimb_survivor""0")
 
cvar_zp_wallclimb_nemesis register_cvar("zp_wallclimb_nemesis""1")
 
}
public 
plugin_precache()
{
 
g_zclass_climb zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}
public 
EventDeathMsg() 
{
 new 
id read_data(2)
 
g_WallClimb[id] = true
 
return PLUGIN_HANDLED
}
public 
client_connect(id) {
 
g_WallClimb[id] = true 
}
public 
fwd_touch(idworld)
{
 if(!
is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
  return 
FMRES_IGNORED
 
new player STR_T
 
if (!player)
  return 
FMRES_IGNORED
  
 
new classname[STR_T]
 
pev(worldpev_classnameclassname, (STR_T))
 
 if(
equal(classname"worldspawn") || equal(classname"func_wall") || equal(classname"func_breakable"))
  
pev(idpev_origing_wallorigin[id])
 return 
FMRES_IGNORED
}
public 
wallclimb(idbutton)
{
 static 
Float:origin[3]
 
pev(idpev_originorigin)
 if(
get_distance_f(origing_wallorigin[id]) > 25.0)
  return 
FMRES_IGNORED  // if not near wall
 
 
if(fm_get_entity_flags(id) & FL_ONGROUND)
  return 
FMRES_IGNORED
  
 
if(button IN_FORWARD)
 {
  static 
Float:velocity[3]
  
velocity_by_aim(id120velocity)
  
fm_set_user_velocity(idvelocity)
 }
 else if(
button IN_BACK)
 {
  static 
Float:velocity[3]
  
velocity_by_aim(id, -120velocity)
  
fm_set_user_velocity(idvelocity)
 }
 return 
FMRES_IGNORED

public 
fwd_playerprethink(id
{
 if(!
g_WallClimb[id] || !zp_get_user_zombie(id)) 
  return 
FMRES_IGNORED
  
 
if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0)
  return 
FMRES_IGNORED
  
 
if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
  return 
FMRES_IGNORED
 
 
new button fm_get_user_button(id)
 
 if((
get_pcvar_num(cvar_zp_wallclimb) == 1) && (button IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb
 
wallclimb(idbutton)
 else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb
 
wallclimb(idbutton)
 return 
FMRES_IGNORED



SaM.ThE.MaN 10-07-2010 11:19

Re: Color message help
 
Try this

PHP Code:

/*
Wallclimb v1.0f by Python1320
Plagued Version 0.22 by Dabbi
Allows Poison Zombie to Climb Walls in Zombie Plague [3.62]
CVARS: zp_wallclimb 0 = Off / 1 = Hold USE / 2 = Hold JUMP and DUCK  (Default 1)
 zp_wallclimb_nemesis 0 = Disable wallclimb during nemesis round. / 1 = Enable (Default 1)
 zp_wallclimb_survivor 0 = Disable wallclimb during survivor round. / 1 = Enable (Default 0)
 
Changes:
 0.22
  Made the function wallclimb return a value.
  Put plugin version to a cvar.
 0.21
  Added cvars to enable disable wallclimb durin survivor/nemesis round
 0.2
  Added cvar to enable / disable Walllclimb Plugin
 0.1
  First release.
*/
#include <amxmodx>
// #include <engine>
#include <fakemeta>
#include <cstrike>
#include <zombieplague.inc>
//#include <fakemeta_util>
#define STR_T           33
// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button) 
/* stock fm_get_user_button(index)
 return pev(index, pev_button) */
#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
 return pev(index, pev_flags) */
stock fm_set_user_velocity(entity, const Float:vector[3]) {
 
set_pev(entitypev_velocityvector);
 return 
1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33]
new 
Float:g_wallorigin[32][3]
new 
cvar_zp_wallclimbcvar_zp_wallclimb_nemesiscvar_zp_wallclimb_survivor
new g_iMsgSayText
new g_zclass_climb
// Climb Zombie Atributes
new const zclass_name[] = { "Climbing Zombie" // name
new const zclass_info[] = { "Can climb on walls" // description
new const zclass_model[] = { "sprzmrbk" // model
new const zclass_clawmodel[] = { "v_sprzmrbkhn.mdl" // claw model
const zclass_health 1750 // health
const zclass_speed 270 // speed
const Float:zclass_gravity 0.8 // gravity
const Float:zclass_knockback 1.5 // knockback
public plugin_init() 
{
 
register_plugin("[ZP] Wallclimb ""1.0""WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
 
register_forward(FM_Touch,   "fwd_touch")
 
register_forward(FM_PlayerPreThink,  "fwd_playerprethink")
 
//register_forward(FM_PlayerPostThink,  "fwd_playerpostthink")
 
register_event("DeathMsg","EventDeathMsg","a")
 
//register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
 
cvar_zp_wallclimb register_cvar("zp_wallclimb""1")
 
cvar_zp_wallclimb_survivor register_cvar("zp_wallclimb_survivor""0")
 
cvar_zp_wallclimb_nemesis register_cvar("zp_wallclimb_nemesis""1")
 
}
public 
plugin_precache()
{
 
g_zclass_climb zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}
public 
EventDeathMsg() 
{
 new 
id read_data(2)
 
g_WallClimb[id] = true
 
return PLUGIN_HANDLED
}
public 
client_connect(id) {
 
g_WallClimb[id] = true 
}
public 
fwd_touch(idworld)
{
 if(!
is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
  return 
FMRES_IGNORED
 
new player STR_T
 
if (!player)
  return 
FMRES_IGNORED
  
 
new classname[STR_T]
 
pev(worldpev_classnameclassname, (STR_T))
 
 if(
equal(classname"worldspawn") || equal(classname"func_wall") || equal(classname"func_breakable"))
  
pev(idpev_origing_wallorigin[id])
 return 
FMRES_IGNORED
}
public 
wallclimb(idbutton)
{
 static 
Float:origin[3]
 
pev(idpev_originorigin)
 if(
get_distance_f(origing_wallorigin[id]) > 25.0)
  return 
FMRES_IGNORED  // if not near wall
 
 
if(fm_get_entity_flags(id) & FL_ONGROUND)
  return 
FMRES_IGNORED
  
 
if(button IN_FORWARD)
 {
  static 
Float:velocity[3]
  
velocity_by_aim(id120velocity)
  
fm_set_user_velocity(idvelocity)
 }
 else if(
button IN_BACK)
 {
  static 
Float:velocity[3]
  
velocity_by_aim(id, -120velocity)
  
fm_set_user_velocity(idvelocity)
 }
 return 
FMRES_IGNORED

public 
fwd_playerprethink(id
{
 if(!
g_WallClimb[id] || !zp_get_user_zombie(id)) 
  return 
FMRES_IGNORED
  
 
if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0)
  return 
FMRES_IGNORED
  
 
if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
ChatColor(id,ChatColor(id, !g[Ludacris-Zombie] !y Your ability is to throw !gFlame !yat peopleJust press !gE !y.)
  return 
FMRES_IGNORED
 
 
new button fm_get_user_button(id)
 
 if((
get_pcvar_num(cvar_zp_wallclimb) == 1) && (button IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb
 
wallclimb(idbutton)
 else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb
 
wallclimb(idbutton)
 return 
FMRES_IGNORED


/* Stock */
stock ChatColor(const id, const input[], any:...) 

    
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
    for (new 
0counti++)
    {
        if (
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLE,g_iMsgSayText,_players[i])
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
    }
}



dreamedward 10-07-2010 11:25

Re: Color message help
 
Nope, gives me errors.

SaM.ThE.MaN 10-07-2010 11:33

Re: Color message help
 
can you show me the errors?

dreamedward 10-07-2010 11:58

Re: Color message help
 
1 Attachment(s)
here

SaM.ThE.MaN 10-07-2010 12:10

Re: Color message help
 
just copy and paste the errors , the picture u posted isnt clear at all

dreamedward 10-07-2010 12:26

Re: Color message help
 
error 017: underfind symbol "g"
error 217: loose indentation
error 017: underfind symbol "Ludacris"
error 017: underfind symbol "y"
error 107: too many error messages on one line

SaM.ThE.MaN 10-07-2010 12:59

Re: Color message help
 
try this ... I HOPE IT WORKS
PHP Code:

/* 
Wallclimb v1.0f by Python1320 
Plagued Version 0.22 by Dabbi 
Allows Poison Zombie to Climb Walls in Zombie Plague [3.62] 
CVARS: zp_wallclimb 0 = Off / 1 = Hold USE / 2 = Hold JUMP and DUCK  (Default 1) 
 zp_wallclimb_nemesis 0 = Disable wallclimb during nemesis round. / 1 = Enable (Default 1) 
 zp_wallclimb_survivor 0 = Disable wallclimb during survivor round. / 1 = Enable (Default 0) 
  
Changes: 
 0.22 
  Made the function wallclimb return a value. 
  Put plugin version to a cvar. 
 0.21 
  Added cvars to enable disable wallclimb durin survivor/nemesis round 
 0.2 
  Added cvar to enable / disable Walllclimb Plugin 
 0.1 
  First release. 
*/ 
#include <amxmodx> 
// #include <engine> 
#include <fakemeta> 
#include <cstrike> 
#include <hamsandwich>
#include <zombieplague.inc> 
//#include <fakemeta_util> 
#define STR_T           33 
// Stuff taken from fakemeta_util 
#define fm_get_user_button(%1) pev(%1, pev_button)  
/* stock fm_get_user_button(index) 
 return pev(index, pev_button) */ 
#define fm_get_entity_flags(%1) pev(%1, pev_flags) 
/* stock fm_get_entity_flags(index) 
 return pev(index, pev_flags) */ 
stock fm_set_user_velocity(entity, const Float:vector[3]) { 
 
set_pev(entitypev_velocityvector); 
 return 
1

//End of stuff from fakemeta_util 
//new STR_T[32] 
new bool:g_WallClimb[33
new 
Float:g_wallorigin[32][3
new 
cvar_zp_wallclimbcvar_zp_wallclimb_nemesiscvar_zp_wallclimb_survivor 
new g_iMsgSayText 
new g_zclass_climb 
// Climb Zombie Atributes 
new const zclass_name[] = { "Climbing Zombie" // name 
new const zclass_info[] = { "Can climb on walls" // description 
new const zclass_model[] = { "sprzmrbk" // model 
new const zclass_clawmodel[] = { "v_sprzmrbkhn.mdl" // claw model 
const zclass_health 1750 // health 
const zclass_speed 270 // speed 
const Float:zclass_gravity 0.8 // gravity 
const Float:zclass_knockback 1.5 // knockback 
public plugin_init()  

 
register_plugin("[ZP] Wallclimb ""1.0""WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi"
 
register_forward(FM_Touch,   "fwd_touch"
 
register_forward(FM_PlayerPreThink,  "fwd_playerprethink")
 
RegisterHam(Ham_Spawn"player""Zombie"1)
 
//register_forward(FM_PlayerPostThink,  "fwd_playerpostthink") 
 
register_event("DeathMsg","EventDeathMsg","a"
 
//register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY) 
 
cvar_zp_wallclimb register_cvar("zp_wallclimb""1"
 
cvar_zp_wallclimb_survivor register_cvar("zp_wallclimb_survivor""0"
 
cvar_zp_wallclimb_nemesis register_cvar("zp_wallclimb_nemesis""1"
  

public 
plugin_precache() 

 
g_zclass_climb zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback

public 
EventDeathMsg()  

 new 
id read_data(2
 
g_WallClimb[id] = true 
 
return PLUGIN_HANDLED 

public 
client_connect(id) { 
 
g_WallClimb[id] = true  

public 
fwd_touch(idworld

 if(!
is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id)) 
  return 
FMRES_IGNORED 
 
new player STR_T 
 
if (!player
  return 
FMRES_IGNORED 
   
 
new classname[STR_T
 
pev(worldpev_classnameclassname, (STR_T)) 
  
 if(
equal(classname"worldspawn") || equal(classname"func_wall") || equal(classname"func_breakable")) 
  
pev(idpev_origing_wallorigin[id]) 
 return 
FMRES_IGNORED 

public 
wallclimb(idbutton

 static 
Float:origin[3
 
pev(idpev_originorigin
 if(
get_distance_f(origing_wallorigin[id]) > 25.0
  return 
FMRES_IGNORED  // if not near wall 
  
 
if(fm_get_entity_flags(id) & FL_ONGROUND
  return 
FMRES_IGNORED 
   
 
if(button IN_FORWARD
 { 
  static 
Float:velocity[3
  
velocity_by_aim(id120velocity
  
fm_set_user_velocity(idvelocity
 } 
 else if(
button IN_BACK
 { 
  static 
Float:velocity[3
  
velocity_by_aim(id, -120velocity
  
fm_set_user_velocity(idvelocity
 } 
 return 
FMRES_IGNORED 
}  
public 
fwd_playerprethink(id)  

 if(!
g_WallClimb[id] || !zp_get_user_zombie(id))  
  return 
FMRES_IGNORED 
   
 
if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0
  return 
FMRES_IGNORED 
   
 
if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
 return 
FMRES_IGNORED
 
 
 
new button fm_get_user_button(id

 if((
get_pcvar_num(cvar_zp_wallclimb) == 1) && (button IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Use button = climb 
 
wallclimb(idbutton
 else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) //Jump + Duck = climb 
 
wallclimb(idbutton
 return 
FMRES_IGNORED 
}

public 
Zombie(zp_wallclimb_nemesis)
{
    if(
zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
          
ChatColor(zp_wallclimb_nemesis"!g[Ludacris-Zombie] !y Your ability is to throw !gFlame !yat people. Just press !gE !y.")
}

/* Stock */ 
stock ChatColor(const id, const input[], any:...)  
{  
     
    new 
count 1players[32
    static 
msg[191
    
vformat(msg190input3
     
    
replace_all(msg190"!g""^4"
    
replace_all(msg190"!y""^1"
    
replace_all(msg190"!t""^3"
     
    if (
idplayers[0] = id; else get_players(playerscount"ch"
    { 
    for (new 
0counti++) 
    { 
        if (
is_user_connected(players[i])) 
        { 
            
message_begin(MSG_ONE_UNRELIABLE,g_iMsgSayText,_players[i]) 
            
write_byte(players[i]); 
            
write_string(msg); 
            
message_end(); 
        } 
    } 





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

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