CSO-SwearReplacement [ Mai multe plugin-uri intrunu ]

In jos

descarca CSO-SwearReplacement [ Mai multe plugin-uri intrunu ]

Mesaj Scris de CelRau la data de Sam Noi 26, 2016 11:05 am

Descriere: Acest plugin va ajuta sa scapati de copii care va fac reclama pe server.
Acest plugin contine 3 anti-reclama.
- I - In fisierul swearwords.ini adaugati cuvintele interzise , de exemplu:

Cod:
:27015
.ro

- I - In fisierul replacements.ini adaugati inlocuitoru cuvintelor interzise , puteti adauga mai multe replici , v-am adaugat eu cateva de exemplu:

Cod:
Adauga server-ul la favorite , IP: 89.40.233.xxx:27015
Daca doresti admin intra pe www.extreamcs.com/forum si depune o cerere de admin.

- II - In al doilea plugin schimba numele daca contine reclame gen furien.extreamcs.com , cs.extreamcs etc.
Pentru a modifica intrati in sma si cautati linia 37 si modificati dupa bunu plac , de exemplu:
Cod:
   "cs.",
   "street",
   "newlife"
Nick-ul pe care il va avea jucatorul il setati dumneavoastra din .sma , in linia 19 .
Cand adaugati mai multe reclame si ati ajuns la ultima linie sa nu puneti "," , astfel va aparea eroare la compilare.

- III - In al treilea plugin blocarea nick-urilor scurte , cei cu numele scurt "n" caractere ( modificati in cvar , il aveti mai jos ) vor primi kick.

Credite:
Askhanar - Ii multumesc pentru plugin-ul cu schimbarea nick-ului.
P.Of.Pw - Ii multumesc pentru plugin-ul cu blocarea nick-urilor scurte.
kaboomkazoom - Ii multumesc pentru plugin-ul swear-Replacement.

In curand voi adauga un fisier .cfg de acolo activati/dezactivezi diferite plugin-uri/comenzi/caractere din el.



Descarcare: Link!

Nume: CSO-SwearReplecement
Versiune: v1.1
Link oficial:

Instalare:
1. Fisierul CSO-SwearReplacement.sma il puneti in addons/amxmodx/scripting
2. Fisierul CSO-SwearReplacement.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
CSO-SwearReplacement.amxx
4. Fisierul replacements.ini il puneti in addons/amxmodx/configs
5. Fisierul swearwords.ini il puneti in addons/amxmodx/configs

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
    amx_lenght_name "3". -Minimul de caractere care poate sa-l aiba jucatorul


Comenzi administrative (Pentru a avea acces , trebuie sa aveti flagul "a" ):
    amx_addreplacement < replacement line to add >
      amx_addswear < swear word to add >


Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- amxmodx
- fakemeta
- amxmisc

Spoiler:
/* ----------------------------------------
Anti-Reclama V1.3

(c) CsOutStanding.Com
Plugin Creator: Askhanar , P.Of.Pw & kaboomkazoom
Adaugare functii+unire : Fantasy
Creat pentru server-ul : FuRy.CsOutStanding.Com
--------------------------------------- */

#include <amxmodx>
#include <fakemeta>
#include <amxmisc>

/* __________________________________________________________
Constants
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */

#define PLUGIN "Anti-Reclama [ http://wWw.CsOutStanding.CoM ]"
#define VERSION "1.3"

#define TASK_NAME 06091993
#define MAX_WORDS 150
#define MAX_REPLACE 50

// global variables for storing the swear list and replace list and their respective number of lines
new g_swearWords[MAX_WORDS][20]
new g_replaceLines[MAX_REPLACE][192]
new g_swearNum
new g_replaceNum
new cvar_lenght

new const g_szDefaultName[ ] = "FcS.CsOutStanding.Com";

new g_szRestrictedThings[ ][ ] =
{
"cs.",
"street",
"newlife",
"csblackdevil",
"<Warrior> Player",
"gametracker",
"`",
"~"
}

/* __________________________________________________________
Init
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar , P.Of.Pw & kaboomkazoom" );

register_forward( FM_ClientUserInfoChanged, "fwdClientUserInfoChanged" );
// Add your code here...

register_clcmd ( "say", "swearcheck" )
register_clcmd ( "say_team", "swearcheck" )
register_concmd ( "amx_addswear", "add_swear", ADMIN_LEVEL_A , "< swear word to add >" )
register_concmd ( "amx_addreplacement", "add_replacement", ADMIN_LEVEL_A , "< replacement line to add >" )
readList()
cvar_lenght = register_cvar( "amx_lenght_name", "3" )
}
/* __________________________________________________________
putinserver
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public client_putinserver( id )
{
if( is_user_bot( id ) || is_user_hltv( id ) )
return;

if( !task_exists( id + TASK_NAME ) )
set_task( 1.5, "TaskCheckName", id + TASK_NAME );

}
/* __________________________________________________________
fwdClientUserInfoChanged
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public fwdClientUserInfoChanged( id, szInfoKey )
{

if ( is_user_connected( id ) )
return FMRES_IGNORED;


static szNewName[ 32 ];
static szCurrentName[ 32 ];

get_user_name( id, szCurrentName, sizeof ( szCurrentName ) -1 );
engfunc( EngFunc_InfoKeyValue, szInfoKey, "name", szNewName, sizeof ( szNewName ) - 1 );

if( equal( szNewName, szCurrentName ) )
return FMRES_IGNORED;

for( new i = 0; i < sizeof ( g_szRestrictedThings ); i++ )
if( containi( szNewName, g_szRestrictedThings[ i ] ) != -1 )
engfunc( EngFunc_SetClientKeyValue, id, szInfoKey, "name", g_szDefaultName );

return FMRES_SUPERCEDE;
}
/* __________________________________________________________
TaskCheckName
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public TaskCheckName( id )
{
id -= TASK_NAME;
if( !is_user_connected( id ) )
return;

new szName[ 32 ];
get_user_name( id, szName, sizeof ( szName ) -1 );

for( new i = 0; i < sizeof ( g_szRestrictedThings ); i++ )
{
if( containi( szName, g_szRestrictedThings[ i ] ) != -1 )
{

//client_cmd( id, "name ^"%s^"", g_szDefaultName );
set_user_info( id, "name", g_szDefaultName );

}
}
}

readList()
{
new Configsdir[64]
new swear_file[64], replace_file[64]
get_configsdir( Configsdir, 63 )
format(swear_file, 63, "%s/swearwords.ini", Configsdir )
format(replace_file, 63, "%s/replacements.ini", Configsdir )

if ( !file_exists(swear_file) )
{
server_print ( "==========================================================" )
server_print ( "[Anti-Reclama] Swear Replacemen] %s nu a fost gasit(a)", swear_file )
server_print ( "==========================================================" )
return
}

if ( !file_exists(replace_file) )
{
server_print ( "==========================================================" )
server_print ( "[Anti-Reclama] Swear Replacemen] %s nu a fost gasit(a)", replace_file )
server_print ( "==========================================================" )
return
}

new len, i=0
while( i < MAX_WORDS && read_file( swear_file, i , g_swearWords[g_swearNum], 19, len ) )
{
i++
if( g_swearWords[g_swearNum][0] == ';' || len == 0 )
continue
g_swearNum++
}

i=0
while( i < MAX_REPLACE && read_file( replace_file, i , g_replaceLines[g_replaceNum], 191, len ) )
{
i++
if( g_replaceLines[g_replaceNum][0] == ';' || len == 0 )
continue
g_replaceNum++
}

server_print ( "======================================================" )
server_print ( "[Anti-Reclama] Swear Replacemen] Au fost incarcate %d cuvinte interzise", g_swearNum )
server_print ( "[Anti-Reclama] Swear Replacemen] Au fost incarcate %d inlocuiri", g_replaceNum )
server_print ( "======================================================" )

}

/* __________________________________________________________
swearcheck
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public swearcheck(id)
{
if ( (get_user_flags(id)&ADMIN_LEVEL_A) || !id )
return PLUGIN_CONTINUE

new said[192]
read_args ( said, 191 )

string_cleaner ( said )

new i = 0
while ( i < g_swearNum )
{
if ( containi ( said, g_swearWords[i++] ) != -1 )
{
new j, playercount, players[32], user_name[32], random_replace = random ( g_replaceNum )
get_user_name ( id, user_name, 31 )
get_players ( players, playercount, "c" )

for ( j = 0 ; j < playercount ; j++)
{
if ( get_user_flags(players[j])&ADMIN_LEVEL_A )
client_print( players[j], print_chat, "[Anti-Reclama] Swear Replacemen] %s : %s",user_name, said )
}

copy ( said, 191, g_replaceLines[random_replace] )
new cmd[10]
read_argv ( 0, cmd, 9)
engclient_cmd ( id ,cmd ,said )

return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}

/* __________________________________________________________
add_swear
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public add_swear(id)
{
if ( ( !(get_user_flags(id)&ADMIN_LEVEL_A) && id ) )
{
client_print ( id, print_console, "[Anti-Reclama] Swear Replacemen] Accesul interzis" )
return PLUGIN_HANDLED
}

if ( read_argc() == 1 )
{
client_print ( id, print_console, "[Anti-Reclama] Swear Replacemen] Fara argumente!!" )
return PLUGIN_HANDLED
}

new Configsdir[64]
new swear_file[64]
get_configsdir( Configsdir, 63 )
format ( swear_file, 63, "%s/swearwords.ini", Configsdir )

read_args ( g_swearWords[g_swearNum], 19 )
write_file( swear_file, "" )
write_file( swear_file, g_swearWords[g_swearNum] )
g_swearNum++

id ? client_print ( id, print_console, "[Anti-Reclama] Swear Replacemen] Cuvant interzis adaugat in lista" ) : server_print ( "[Anti-Reclama] Swear Replacemen] Cuvant interzis adugat la lista" )

return PLUGIN_HANDLED
}

/* __________________________________________________________
add_replacement
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public add_replacement(id)
{
if ( ( !(get_user_flags(id)&ADMIN_LEVEL_A) && id ) )
{
client_print ( id, print_console, "[Anti-Reclama] Swear Replacemen] Accesul interzis" )
return PLUGIN_HANDLED
}

if ( read_argc() == 1 )
{
client_print ( id, print_console, "[Anti-Reclama] Swear Replacemen] Fara Argumente" )
return PLUGIN_HANDLED
}

new Configsdir[64]
new replace_file[64]
get_configsdir( Configsdir, 63 )
format ( replace_file, 63, "%s/replacements.ini", Configsdir )

read_args ( g_replaceLines[g_replaceNum], 191 )
write_file( replace_file, "" )
write_file( replace_file, g_replaceLines[g_replaceNum] )
g_replaceNum++

id ? client_print ( id, print_console, "[Anti-Reclama] Swear Replacemen] Replacement Line added to List" ) : server_print ( "[Anti-Reclama] Swear Replacemen] Replacement Line added to file" )

return PLUGIN_HANDLED
}

/* __________________________________________________________
client_infochanged(
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public client_infochanged( id )
{
new newname[ 32 ], oldname[ 32 ]
get_user_info( id, "name", newname, 31 )
get_user_name( id, oldname, 31 )

if( equali( newname, oldname ) )
return PLUGIN_CONTINUE

set_task( 1.0, "client_connect", id )

return PLUGIN_CONTINUE
}

/* __________________________________________________________
client_connect
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public client_connect( id )
{
new name[ 32 ]
get_user_name( id, name, 31 )

if( strlen( name ) < get_pcvar_num( cvar_lenght ) )
{
server_cmd( "kick #%d ^"Numele tau este prea mic.^"", get_user_userid( id ) )
}
}

/* __________________________________________________________
string_cleaner
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|| */
public string_cleaner( str[] )
{
new i, len = strlen ( str )
while ( contain ( str, " " ) != -1 )
replace ( str, len, " ", "" )

len = strlen ( str )
while ( contain ( str, "|<" ) != -1 )
replace ( str, len, "|<", "k" )

len = strlen ( str )
while ( contain ( str, "|>" ) != -1 )
replace ( str, len, "|>", "p" )

len = strlen ( str )
while ( contain ( str, "()" ) != -1 )
replace ( str, len, "()", "o" )

len = strlen ( str )
while ( contain ( str, "[]" ) != -1 )
replace ( str, len, "[]", "o" )

len = strlen ( str )
while ( contain ( str, "{}" ) != -1 )
replace ( str, len, "{}", "o" )

len = strlen ( str )
for ( i = 0 ; i < len ; i++ )
{
if ( str[i] == '@' )
str[i] = 'a'

if ( str[i] == '$' )
str[i] = 's'

if ( str[i] == '0' )
str[i] = 'o'

if ( str[i] == '7' )
str[i] = 't'

if ( str[i] == '3' )
str[i] = 'e'

if ( str[i] == '5' )
str[i] = 's'

if ( str[i] == '<' )
str[i] = 'c'

if ( str[i] == '3' )
str[i] = 'e'

}
}
avatar
CelRau
Registered user
Registered user

Mesaje : 184
Data de inscriere : 26/11/2016

Sus In jos

Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum