Jump to content

[Modificare Plugin] - Color Chat Admin


BigFoot

Recommended Posts

Modelul este :Classic


 


Nume : Color_Chat_Admin


Versiune :1.1.1


Descriere detaliata : As dorii ca sa mi se modifice pluginul in asa fel incat chatul sa fie color doar atunci cand se scrie in chatul adminilor (amx_chat sau u@ ... ) ,mai exact cand cineva va scrie in chatul adminilor,numele celui care a scris sa fie cu verde si restul sa fie scris normal ,de ex:


DEAD* BigFoot =))) : Alin wall


Sper ca ati inteles ce am vrut sa va arat


Va dau eu pluginul: http://www.girlshare.ro/31832799.9


Link to comment
Share on other sites

Poftim :D

 

 

 

 

/* * * * * * * * * * * * * * * * * * * * * * * *

 *   Admin_chatcolor, by Dozer (AMX Mod X)  *
 *                                             *
 *      Special thanks to Damaged Soul         *
 * - not just for helping me when I needed it, *
 *    but for putting up with all my shit ^_^  *
 *                                             *
 *************I hate asterisks.*****************
 *                                             *
 *           © Copyright 2015               *
 * This file is provided as is (no warranties) *
 * * * * * * * * * * * * * * * * * * * * * * * */
 
//Use !T for team-color (sorry, can't use red when on CT, and vice-versa)
//!G for green, and !W for normal (it's more of a tan than a white...)
 
 
//Includes
#include <amxmodx>
#include <cstrike>
 
//Defines
#if defined ACCESS_LEVEL
#undef ACCESS_LEVEL
#endif
//#define ACCESS_LEVEL ADMIN_CHAT //UNCOMMENT THIS LINE to allow only admins (with ADMIN_CHAT) to use colors
 
//Messages
new gmsgSayText
 
//Globals
 
 
//Initialization
public plugin_init()
{
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "CatchSay")
register_clcmd("say_team", "CatchSay")
register_plugin("Admin Chat Color","1.0","Dozer")
return PLUGIN_CONTINUE
}
 
//Functions
public CatchSay(id)
{
#if defined ACCESS_LEVEL
if( !(get_user_flags(id)&ACCESS_LEVEL) ) return PLUGIN_CONTINUE
#endif
 
new message[129]
read_argv(1,message,128)
 
if ( containi(message,"!t")==-1 &&
    containi(message,"!w")==-1 &&
    containi(message,"!g")==-1 )
{
return PLUGIN_CONTINUE
}
 
new szCommand[9]
read_argv(0,szCommand,8)
 
new CsTeams:team = cs_get_user_team(id)
new isAlive = is_user_alive(id)
 
new playerList[32]//players to send message to
new playerCount
 
new message_to_send[129] = "^x01"
 
new szFlags[4] = ""
if(isAlive){
add(szFlags,3,"a")//Only alive players
} else {
add(szFlags,3,"b")//Only dead players
add(message_to_send,128,"*DEAD*")
}
add(szFlags,3,"c")//skip bots
 
if(equal(szCommand,"say_team")) {
add(szFlags,3,"e")//Match with passed teamname
if(team==CS_TEAM_T){
get_players(playerList,playerCount,szFlags,"TERRORIST")
add(message_to_send,128,"(Terrorist) ^x03")
} else if(team==CS_TEAM_CT) {
get_players(playerList,playerCount,szFlags,"CT")
add(message_to_send,128,"(Counter-terrorist) ^x03")
} else { //assume Spectator
get_players(playerList,playerCount,szFlags,"SPECTATOR")
add(message_to_send,128,"(Spectator) ^x03")
}
} else { //assume "say"
get_players(playerList,playerCount,szFlags)
if(isAlive)
{
add(message_to_send,128,"^x03")
} else {
add(message_to_send,128," ^x03")
}
}
 
new username[129]
get_user_name(id,username,128)
add(message_to_send,128,username)
add(message_to_send,128,"^x01 :  ")
 
add( message_to_send,128,message,(128-strlen(message_to_send)) )
 
while(containi(message_to_send,"!t") != -1)
{
replace(message_to_send,128,"!T","^x03")
replace(message_to_send,128,"!t","^x03")
}
while(containi(message_to_send,"!g") != -1)
{
replace(message_to_send,128,"!G","^x04")
replace(message_to_send,128,"!g","^x04")
}
while(containi(message_to_send,"!w") != -1)
{
replace(message_to_send,128,"!W","^x01")
replace(message_to_send,128,"!w","^x01")
}
 
 
for(new i=0; i<playerCount; i++)
{
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, playerList)
write_byte(playerList)
write_string(message_to_send)
message_end()
}
 
return PLUGIN_HANDLED
}

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...