/**
* Bu eklentinin geli?tirilmi? hali Yek'-ta'ya aittir.
* Original plugin; https://forums.alliedmods.net/showthread.php?t=56825?t=56825
* Edited for steam tag by Yek'-ta
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define VERSION "Yek'-ta"
native csd_checkuserac(id)
new COLCHAR[3][2] = { "^x03", "^x04", "^x01" }
new p_namecol
new alv_sndr, alv_str2[26], alv_str4[101]
new msg[200]
#define cm(%0) ( sizeof(%0) - 1 )
public col_changer( msg_id, msg_dest, rcvr )
{
new str2[26]
get_msg_arg_string( 2, str2, 25 )
if( equal( str2, "#Cstrike_Chat", 13 ) )
{
new str3[22]
get_msg_arg_string( 3, str3, 21 )
if( !strlen( str3 ) )
{
new str4[101]
get_msg_arg_string( 4, str4, 100 )
new sndr = get_msg_arg_int( 1 )
new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
new sndr_team = get_user_team( sndr )
new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
if( !same_as_last )
{
if( !( is_team_msg && ( is_sndr_spec || is_team_msg) ) )
{
new flags[5], team[10]
if( is_user_alive( sndr ) ) flags = "bc"
else flags = "ac"
if( is_team_msg )
{
add( flags[strlen( flags )], 4, "e" )
if( sndr_team == 1 ) team = "TERRORIST"
else team = "CT"
}
new players[32], num
get_players( players, num, flags, team )
if( get_user_flags( sndr ) & ADMIN_RESERVATION)
buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )
else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, str4 )
for( new i=0; i < num; i++ )
{
if(is_user_alive(players[i]) && get_user_flags( players[i] ) & ADMIN_RESERVATION || !is_user_alive(players[i])){
message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
write_byte( sndr )
write_string( msg )
message_end()
}
}
}
alv_sndr = sndr
alv_str2 = str2
alv_str4 = str4
if( task_exists( 411 ) ) remove_task( 411 )
set_task( 0.1, "task_clear_antiloop_vars", 411 )
}
if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4 )
if(!(str4[0] == '.' || str4[0] == '/' || str4[0] == '!')){
set_msg_arg_string( 2, msg )
set_msg_arg_string( 4, "" )
}
else {
return PLUGIN_HANDLED;
}
}
}
return PLUGIN_CONTINUE
}
public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, str4[ ] )
{
new sndr_name[33]
get_user_name( sndr, sndr_name, 32 )
new prefix[32] = "^x01"
new flags = get_user_flags(sndr);
new alive = is_user_alive(sndr);
if(alive){
if(!(get_user_flags(sndr) & ADMIN_USER)){
if(flags & ADMIN_IMMUNITY){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x04[Steam+ Kurucu] ^x01"
}
else {
prefix = "^x04[Steam Kurucu] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x04[Kurucu] ^x01"
}
}
else if(flags & ADMIN_LEVEL_H){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x04[Steam+ Captan] ^x01"
}
else {
prefix = "^x04[Steam Captan] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x04[Captan] ^x01"
}
}
else if(flags & ADMIN_RCON){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x04[Steam+ Yonetim] ^x01"
}
else {
prefix = "^x04[Steam Yonetim] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x04[Yonetim] ^x01"
}
}
else if(flags & ADMIN_LEVEL_G){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x04[Steam+ Admin] ^x01"
}
else {
prefix = "^x04[Steam Admin] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x04[Admin] ^x01"
}
}
else if(flags & ADMIN_LEVEL_F){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x04[Steam+ Clan Oyuncusu] ^x01"
}
else {
prefix = "^x04[Steam Clan Oyuncusu] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x04[C.Oyuncusu] ^x01"
}
}
}
else {
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x04[Steam+] ^x01"
}
else {
prefix = "^x04[Steam] ^x01"
}
}
else{
prefix = "^x01"
}
}
}
else {
if(!(get_user_flags(sndr) & ADMIN_USER)){
if(flags & ADMIN_IMMUNITY){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x01(OLU)^x04[Steam+ Kurucu] ^x01"
}
else {
prefix = "^x01(OLU)^x04[Steam Kurucu] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x01(OLU)^x04[Kurucu] ^x01"
}
}
else if(flags & ADMIN_LEVEL_H){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x01(OLU)^x04[Steam+ Captan] ^x01"
}
else {
prefix = "^x01(OLU)^x04[Steam Captan] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x01(OLU)^x04[Captan] ^x01"
}
}
else if(flags & ADMIN_RCON){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x01(OLU)^x04[Steam+ Yonetim] ^x01"
}
else {
prefix = "^x01(OLU)^x04[Steam Yonetim] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x01(OLU)^x04[Yonetim] ^x01"
}
}
else if(flags & ADMIN_LEVEL_G){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x01(OLU)^x04[Steam+ Admin] ^x01"
}
else {
prefix = "^x01(OLU)^x04[Steam Admin] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x01(OLU)^x04[Admin] ^x01"
}
}
else if(flags & ADMIN_LEVEL_F){
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x01(OLU)^x04[Steam+ Clan Oyuncusu] ^x01"
}
else {
prefix = "^x01(OLU)^x04[Steam Clan Oyuncusu] ^x01"
}
}
else if(!is_user_steam(sndr)){
prefix = "^x01(OLU)^x04[C.Oyuncusu] ^x01"
}
}
}
else {
if(is_user_steam(sndr)){
if(csd_checkuserac(sndr)){
prefix = "^x01(OLU)^x04[Steam+] ^x01"
}
else {
prefix = "^x01(OLU)^x04[Steam] ^x01"
}
}
else{
prefix = "^x01(OLU)^x01"
}
}
}
if( is_sndr_spec ) add( prefix[strlen(prefix)-1], 29, "¤" )
else if( !is_user_alive( sndr ) ) add( prefix[strlen(prefix)-1], 29, "×" )
if( is_team_msg )
{
if( is_sndr_spec ) prefix = "^x01(Spec) "
else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "(TE)" )
else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "(CT)" )
}
if(is_user_admin(sndr)){
format( msg, 199, "%s%s%s : ^x04%s",\
strlen( prefix ) > 1 ? prefix : "",\
COLCHAR[namecol], sndr_name, str4 )
}
else{
format( msg, 199, "%s%s%s : ^x01%s",\
strlen( prefix ) > 1 ? prefix : "",\
COLCHAR[namecol], sndr_name, str4 )
}
return PLUGIN_HANDLED
}
public task_clear_antiloop_vars( )
{
alv_sndr = 0
alv_str2 = ""
alv_str4 = ""
return PLUGIN_HANDLED
}
public plugin_init( )
{
register_plugin("SteamCHAT",VERSION,"Ian Cammarata") //Edited Yek'-ta
register_cvar("R-STEAM",VERSION,FCVAR_SERVER)
p_namecol = register_cvar( "csm_namecolor", "0" )
register_message( get_user_msgid("SayText"), "col_changer" )
}
stock bool:is_user_steam(id)
{
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id);
server_exec();
return (get_pcvar_num(dp_pointer) == 2) ? true : false;
}
new szAuthid[34];
get_user_authid(id, szAuthid, charsmax(szAuthid));
return (containi(szAuthid, "LAN") < 0);
}