Country Chat natuke problemm

Vaata eelmist teemat Vaata järgmist teemat Go down

Heaven123
Heaven123
Juunior
Liitus : 16/01/2014
Postitusi : 11

PostitamineHeaven123 18.01.14 15:35

tere , mida ma peaksin muutma selle plugin country  chat et  ta ei näidanud /me /admin /hp /sms ja jne !
vip.ee serveris kui kirjutad /me /admin /sms /hp ja jne ei näita jututuba
kuidas ma saan nii teha
tänud ette.
screenshots ka on
Country Chat natuke problemm Cs_office0000
Country Chat natuke problemm Cs_office0001
Country Chat natuke problemm Cs_office0002
Country Chat natuke problemm Cs_office0003

see mu sma fail country chat


Kood:
#include <amxmodx>
#include <geoip>

// Uncomment this if you want enable antiflood system (by AMXx team)
//#define ANTIFLOOD

new const g_szTeamNames[ ][ ] = {
"Unassigned",
"Terrorist",
"Counter-Terrorist",
"Spectator"
};

new g_szGayChars[ ][ ] = {
"",
"",
"",
""
}

new bool:g_bIsConnected[ 33 ];
new g_szCountyCode[ 33 ][ 5 ];
new g_iMsgSayText;
new g_iMaxplayers;

#if defined ANTIFLOOD
new Float:g_flLastMsg[ 33 ];
new Float:g_flFlooding[ 33 ];
new g_iFloodCount[ 33 ];
#endif

public plugin_init() {
register_plugin( "Country Chat", "1.0", "Exolent / xPaw" );

#if defined ANTIFLOOD
 register_dictionary( "antiflood.txt" );
#endif

register_clcmd( "say",  "CmdSay" );
register_clcmd( "say_team", "CmdTeamSay" );

g_iMsgSayText = get_user_msgid( "SayText" );
g_iMaxplayers = get_maxplayers( );
}

public client_putinserver( id ) {
new szIP[ 64 ], szCode[ 3 ];
get_user_ip( id, szIP, 63, 1 );

if( !geoip_code2_ex( szIP, szCode ) ) {
 szCode[0] = '-';
 szCode[1] = '-';
}

g_szCountyCode[id][0] = szCode[0];
g_szCountyCode[id][1] = szCode[1];

#if defined ANTIFLOOD
 g_iFloodCount[ id ] = 0;
#endif

if( !is_user_bot( id ) ) // Who cares about bots
 g_bIsConnected[id] = true;
}

public client_disconnect( id ) {
g_bIsConnected[id] = false;
}

public CmdSay( id ) {
#if defined ANTIFLOOD
 if( CheckFlood( id ) )
  return PLUGIN_HANDLED;
#endif

new szText[ 192 ];
read_args( szText, 191 );
remove_quotes( szText );

if( !IsValidMessage( szText ) )
 return PLUGIN_HANDLED;

static i;
for( i = 0; i < sizeof g_szGayChars; i++ )
 if( contain( szText, g_szGayChars[ i ] ) )
  replace_all( szText, 191, g_szGayChars[ i ], "" );

replace_all( szText, 191, "%s", "%%s" );

new szName[ 32 ], szTag[ 8 ], szMessage[ 192 ];
get_user_name( id, szName, 31 );

if( !is_user_alive( id ) )
 copy( szTag, 7, "*DEAD* " );
if( get_user_team( id ) == 3 && !is_user_alive( id ) )
 copy( szTag, 7, "*SPEC* " );

if (get_user_flags(id) & ADMIN_RCON) {
 formatex( szMessage, 191, "^4[%s]^1 %s^3%s^1:^4 %s", g_szCountyCode[ id ], szTag, szName, szText );
} else if (get_user_flags(id) & ADMIN_LEVEL_F) {
 formatex( szMessage, 191, "^4[^3%s^4]^1 %s^3%s^1:^4 %s", g_szCountyCode[ id ], szTag, szName, szText );
} else if (get_user_flags(id) & ADMIN_CHAT) {
 formatex( szMessage, 191, "^3[%s]^1 %s^3%s^1:^4 %s", g_szCountyCode[ id ], szTag, szName, szText );
} else {
 formatex( szMessage, 191, "^3[%s]^1 %s^3%s^1: %s", g_szCountyCode[ id ], szTag, szName, szText );
}

for( i = 1; i <= g_iMaxplayers; i++ ) {
 if( g_bIsConnected[ i ] ) {
  message_begin( MSG_ONE_UNRELIABLE, g_iMsgSayText, _, i );
  write_byte( id );
  write_string( szMessage );
  message_end( );
 }
}

log_to_file("chatlog.txt", "[%s] %s %s: %s", g_szCountyCode[ id ], szTag, szName, szText)

return PLUGIN_HANDLED_MAIN;
}

public CmdTeamSay( id ) {
#if defined ANTIFLOOD
 if( CheckFlood( id ) )
  return PLUGIN_HANDLED;
#endif

new szText[ 192 ];
read_args( szText, 191 );
remove_quotes( szText );

if( !IsValidMessage( szText ) )
 return PLUGIN_HANDLED;

static i;
for( i = 0; i < sizeof g_szGayChars; i++ )
 if( contain( szText, g_szGayChars[ i ] ) )
  replace_all( szText, 191, g_szGayChars[ i ], "" );

replace_all( szText, 191, "%s", "%%s" );

new szName[ 32 ], szTag[ 8 ], szMessage[ 192 ];
new iTeam = get_user_team( id );
get_user_name( id, szName, 31 );

if( iTeam != 3 && !is_user_alive( id ) )
 copy( szTag, 7, "*DEAD* " );

if (get_user_flags(id) & ADMIN_RCON) {
 formatex( szMessage, 191, "^4[%s]^1 %s(%s)^3 %s^1:^x04 %s", g_szCountyCode[ id ], szTag, g_szTeamNames[ iTeam ], szName, szText );
} else if (get_user_flags(id) & ADMIN_LEVEL_F) {
 formatex( szMessage, 191, "^4[^3%s^4]^1 %s(%s)^3 %s^1:^x04 %s", g_szCountyCode[ id ], szTag, g_szTeamNames[ iTeam ], szName, szText );
} else if (get_user_flags(id) & ADMIN_CHAT) {
 formatex( szMessage, 191, "^3[%s]^1 %s(%s)^3 %s^1:^x04 %s", g_szCountyCode[ id ], szTag, g_szTeamNames[ iTeam ], szName, szText );
} else {
 formatex( szMessage, 191, "^3[%s]^1 %s(%s)^3 %s^1: %s", g_szCountyCode[ id ], szTag, g_szTeamNames[ iTeam ], szName, szText );
}

for( i = 1; i <= g_iMaxplayers; i++ ) {
 if( g_bIsConnected[ i ] ) {
  if( get_user_team( i ) == iTeam || get_user_flags( i ) & ADMIN_CHAT ) {
   message_begin( MSG_ONE_UNRELIABLE, g_iMsgSayText, _, i );
   write_byte( id );
   write_string( szMessage );
   message_end( );
  }
 }
}

log_to_file("chatlog.txt", "[%s] %s(%s) %s: %s", g_szCountyCode[ id ], szTag, g_szTeamNames[ iTeam ], szName, szText)

return PLUGIN_HANDLED_MAIN;
}
#if defined ANTIFLOOD
public CheckFlood( id ) {
 new Float:flGametime = get_gametime( );

 if( g_flLastMsg[ id ] + 0.25 > flGametime )
  return true;

 g_flLastMsg[ id ] = flGametime;

 if( g_flFlooding[ id ] > flGametime ) {
  if( g_iFloodCount[ id ] >= 3 ) {
   client_print( id, print_notify, "** %L **", id, "STOP_FLOOD" );
   client_print( id, print_center, "** %L **", id, "STOP_FLOOD" );

   g_flFlooding[ id ] = flGametime + 3.75;

   return true;
  }

  g_iFloodCount[ id ]++;
 }
 else if( g_iFloodCount[ id ] )
  g_iFloodCount[ id ]--;

 g_flFlooding[ id ] = flGametime + 0.75;

 return false;
}
#endif
bool:IsValidMessage( const szText[] ) {
new iLen = strlen( szText );
if( !iLen ) return false;

for( new i = 0; i < iLen; i++ )
 if( szText[ i ] != ' ' && szText[ i ] != '%' )
  return true;

return false;
}
Tonight
Tonight

Country Chat natuke problemm Vetera11
Liitus : 19/02/2012
Postitusi : 17983

PostitamineTonight 18.01.14 15:39

Vaata eelmist teemat Vaata järgmist teemat Tagasi üles

Soovid vestluses osaleda?

Selleks logi sisse või tee endale kasutaja.

Liitu foorumiga

Tee endale kasutaja ning osale aruteludes.


Tee uus kasutaja

Logi sisse

Omad foorumis juba kasutajat? Logi sisse.


Logi sisse

 
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele