i got this as first from user:
Код за потвърждение: Избери целия код
#include <amxmodx>
static const WHITELIST[][] =
{
"37.59.43.196:27018"
}
#define MAX_NUMBERS 5
public plugin_init(){
register_plugin("Max Number in Name&Chat", "1.1", "OciXCrom")
register_clcmd("say", "OnSay")
register_clcmd("say_team", "OnSay")
}
public OnSay(id){
static szArgs[195]
read_args(szArgs, charsmax(szArgs))
return has_advertisement(szArgs) ? PLUGIN_HANDLED : PLUGIN_CONTINUE
}
public client_authorized(id){
new szName[33]
get_user_name(id, szName, charsmax(szName))
if(!has_whitelisted(szName)&&has_advertisement(szName)) set_user_info(id, "name", "37.59.43.196:27018")
}
bool:has_advertisement(const szString[]){
static iCount, i
iCount = 0
i=0
for(i; i < strlen(szString); i++) if(isdigit(szString[i])) iCount++
return iCount >= MAX_NUMBERS?true:false
}
bool:has_whitelisted(const szString[]){
for(new i; i < sizeof(WHITELIST); i++) if(equali(szString, WHITELIST[i])) return true
return false
}
Warning: Expression has no effect on line 32
is this an problem?
Nop still the self problem... i used 185.119.89.103:27015 and didnt got renamend.
>Then i got this here:
Код за потвърждение: Избери целия код
#include <amxmodx>
#define REGEX
#if defined REGEX
#include <regex>
new const MY_RPHRASE[]="(?:\d.*){9,}"
new ret, error[128]//,Regex:re
#else
const MAX_NUMBERS = 5
new const symbol[10] =
{
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'
}
new UserSymb[33]
#endif
static const WHITELIST[][] =
{
"37.59.43.196:27018"
}
public plugin_init(){
register_plugin("Max Number in Name&Chat", "1.1", "OciXCrom")
register_clcmd("say", "OnSay")
register_clcmd("say_team", "OnSay")
}
public OnSay(id){
new says[195]
read_args( says, charsmax(says) )
#if !defined REGEX
if(has_advertisement(id,says))
#else
if(has_advertisement(says))
#endif
if(!has_whitelisted(says)) return
}
public client_authorized(id){
new szName[33]
get_user_info(id, "name", szName, charsmax(szName))
if(!has_whitelisted(szName))
#if !defined REGEX
if(has_advertisement(id,szName))
#else
if(has_advertisement(szName))
#endif
set_user_info(id, "name", "37.59.43.196:27018")
}
#if !defined REGEX
bool:has_advertisement(id,szString[]){
#else
bool:has_advertisement(szString[]){
#endif
#if !defined REGEX
new i, j
for( i = 0; i < sizeof szString; i++ ){
for( j = 0; j < sizeof symbol; j++ ){
if( szString[i] == symbol[j] ) UserSymb[id]++
else UserSymb[id]=0
}
}
return UserSymb[id] >= MAX_NUMBERS?true:false
#else
return (regex_match(szString,MY_RPHRASE,ret,error,charsmax(error)))?true:false
#endif
}
bool:has_whitelisted(const szString[]){
for(new i; i < sizeof(WHITELIST); i++) if(equali(szString, WHITELIST[i])) return true
return false
}
Nop, this dont work too.............
I am using 1.8.3-Re
Код за потвърждение: Избери целия код
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 3] LocalizeBug Fix RUN - localizebugfix_mm_i386.so v2.4 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] YaPB RUN - yapb.so v2.92 ini Chlvl ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[ 8] SQLite RUN - sqlite_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[ 9] Fun RUN - fun_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[10] Engine RUN - engine_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[12] GeoIP RUN - geoip_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[14] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl2 ANY ANY
[16] SxGeo RUN - sxgeo_amxx_i386.so v2.2 pl2 ANY Never
[17] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl2 ANY ANY
Код за потвърждение: Избери целия код
mysql
sqlite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Put third party modules below here. ;;
;; You can just list their names, without the _amxx ;;
;; or file extension. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; These modules will be auto-detected and loaded ;;
;; as needed. You do not need to enable them here ;;
;; unless you have problems. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fun
engine
fakemeta
sockets
geoip
regex
nvault
cstrike
csx
hamsandwich
sxgeo
hackdetector
ANY IDEA?