Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Usunięcie z sma niepotrzebnej części kodu


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
2 odpowiedzi w tym temacie

#1 stiVwoW

    Pomocny

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:65
Offline

Napisano 21.05.2016 12:54

Witam, w internecie znalazłem plugin który ma na zadaniu sprawdzenie czy u gracza nie ma niedozwolonych plików

działa to w 100% ale kod ma dodatkowo sprawdzanie cwarów: "rate", "bottomcolor",  "topcolor", "name". Wersje cs non-steam mają niepoprawne ustawienia w config.cfg. Przykładowo wyrzuca gracza za złe ustawienia rate 20000, a poprawna wartość jest 25000.

Chciałbym prosić o usunięcie z kodu sprawdzania cwarów, by plugin sprawdzał tylko i wyłącznie pliki.

 

[ spoiler ] 

#include <amxmodx>
#include <fakemeta>
#include <ColorChat>

#define PLUGIN "ANTI PROTECTOR`S"
#define VERSION "1.0"
#define AUTHOR "raizo"

#define LOG_FILE "addons/amxmodx/logs/PROTECTOR.log"

#define get_bit(%1,%2) ( %1 & 1 << ( %2 & 31 ) )
#define set_bit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define clear_bit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

new const check_cvar[][] =
{
"rate",
"bottomcolor",
"topcolor",
"name"
}

static const szProtector[][] =
{
"../protector.asi",
"../CTShield.asi",
"../CTShield.dll",
"../CSXGuard.dll"
}
#define NAME "name"

public forward_client_userinfochanged(id, buffer) {

static oldname[32], newname[32]
get_user_name(id, oldname, sizeof oldname - 1)
engfunc(EngFunc_InfoKeyValue, buffer, NAME, newname, sizeof newname - 1)
if (equal(newname, oldname))
return FMRES_IGNORED

return FMRES_SUPERCEDE
}

new name[33][33];
new ip[33][26];

new strcheck[33][4][32]
new check_num[33];
new g_CheckShield

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_ClientUserInfoChanged, "forward_client_userinfochanged")

//new ip[32]
//get_user_ip(0,ip,31)
//if(!equali(ip,"93.191.11.210:27057"))
// set_fail_state("MSG ERROR BIt '0x3HJeKmZZ'")
// Add your code here...
}
public client_putinserver(id)
{
set_bit(g_CheckShield, id)

get_user_name(id,name[id],32)
get_user_ip(id,ip[id],25, 1)

if(!is_user_steam(id) && !is_user_hltv(id) && !is_user_bot(id))
set_task(random_float(5.0,10.0),"CheckShield",id+1125)

}
public client_disconnect(id)
{
if(task_exists(id+1125))
remove_task(id+1125)
if(task_exists(id+4441))
remove_task(id+4441)
}
public CheckShield(id)
{
id-=1125

if(!is_user_connected(id))
{
remove_task(id +1125)
return PLUGIN_CONTINUE;
}

if(get_bit(g_CheckShield, id))
{
check_num[id] = random(2555)
clear_bit(g_CheckShield,id)
for(new j= 0;j<sizeof(check_cvar);j++)
{
get_user_info(id,check_cvar[j],strcheck[id][j],31)
client_cmd(id,"%s %i",check_cvar[j],check_num[id])
}
set_task(0.2,"CheckShield",id +1125)
}
else
{
static strs[32]

for(new i = 0;i<sizeof(check_cvar);i++)
{

get_user_info(id,check_cvar[i],strs,31)

if((equal(strcheck[id][i],strs) && !equal(check_cvar[i],"name")) || (equal("name",strs) && equal(check_cvar[i],"name")))
{

log_to_file(LOG_FILE,"[PROTECTOR] DETECT '%s' [%s] | Reason : %s %s [%d]",name[id],ip[id], check_cvar[i], strs, check_num[id])

if(equal(check_cvar[i],"name"))
client_cmd(id,"name ^"%s^"",name[id])
else
client_cmd(id,"%s ^"%s^"",check_cvar[i],strcheck[id][i])

set_task(0.5,"KickCommand",id +4441)

break;
}
else if(equal(check_cvar[i],"name"))
client_cmd(id,"name ^"%s^"",name[id])
else
client_cmd(id,"%s ^"%s^"",check_cvar[i],strcheck[id][i])

}
}

return PLUGIN_CONTINUE;
}
public KickCommand(id)
{
id-=4441;

for(new iPlayer = 1;iPlayer<=get_playersnum();iPlayer++)
{
if(!is_user_connected(iPlayer)) continue;

if(iPlayer != id)
ColorChat(iPlayer,RED,"^4&KNIFE PROTECTION : ^1‚ DETECTED WITH CT-SHIELD PLAYER '^4%s^1' (^3%s^1)",name[id],ip[id])
}
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
client_cmd(id,"echo ^"[KNIFE]IP: %s | %s^"",name[id],ip[id])
client_cmd(id,"echo ^"[KNIFE] PROTECTOR DETECTOR BY RAIZO^"")
client_cmd(id,"echo ^"[KNIFE] VIOLATION BY %s^"",name[id],ip[id])
client_cmd(id,"echo ^"[KNIFE] REMOVE THE TABS BELLOW^"")
for(new i = 0; i < sizeof(szProtector);i++)
client_cmd(id,"echo ^"& ^"%s^"^"",szProtector[i])
client_cmd(id,"echo ^"[KNIFE] CONTACT ME ON STEAM : [ raizo99 ]^"")
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
server_cmd("wait;wait;wait;kick #%d ^"CT-SHIELD DETECTED, PLEASE CONTACT ME ON YAHOO MESSENGER FOR MORE INFORMATION Y|M : kniferaizo@yahoo.com ^"",get_user_userid(id))
}
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
}
return false
}

[ /spoiler]

 


Użytkownik stiVwoW edytował ten post 21.05.2016 12:59

  • +
  • -
  • 0

#2 Zymlok

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:49
  • Imię:Szymon
  • Lokalizacja:Daaleko
Offline

Napisano 22.05.2016 11:55

#include <amxmodx>
#include <fakemeta>
#include <ColorChat>

#define PLUGIN "ANTI PROTECTOR`S"
#define VERSION "1.0"
#define AUTHOR "raizo"

#define LOG_FILE "addons/amxmodx/logs/PROTECTOR.log"

#define get_bit(%1,%2) ( %1 & 1 << ( %2 & 31 ) )
#define set_bit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define clear_bit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

static const szProtector[][] =
{
"../protector.asi",
"../CTShield.asi",
"../CTShield.dll",
"../CSXGuard.dll"
}
#define NAME "name"

public forward_client_userinfochanged(id, buffer) {

static oldname[32], newname[32]
get_user_name(id, oldname, sizeof oldname - 1)
engfunc(EngFunc_InfoKeyValue, buffer, NAME, newname, sizeof newname - 1)
if (equal(newname, oldname))
return FMRES_IGNORED

return FMRES_SUPERCEDE
}

new name[33][33];
new ip[33][26];

new strcheck[33][4][32]
new check_num[33];
new g_CheckShield

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_ClientUserInfoChanged, "forward_client_userinfochanged")

//new ip[32]
//get_user_ip(0,ip,31)
//if(!equali(ip,"93.191.11.210:27057"))
// set_fail_state("MSG ERROR BIt '0x3HJeKmZZ'")
// Add your code here...
}
public client_putinserver(id)
{
set_bit(g_CheckShield, id)

get_user_name(id,name[id],32)
get_user_ip(id,ip[id],25, 1)

if(!is_user_steam(id) && !is_user_hltv(id) && !is_user_bot(id))
set_task(random_float(5.0,10.0),"CheckShield",id+1125)

}
public client_disconnect(id)
{
if(task_exists(id+1125))
remove_task(id+1125)
if(task_exists(id+4441))
remove_task(id+4441)
}
public CheckShield(id)
{
id-=1125

if(!is_user_connected(id))
{
remove_task(id +1125)
return PLUGIN_CONTINUE;
}

if(get_bit(g_CheckShield, id))
{
check_num[id] = random(2555)
clear_bit(g_CheckShield,id)
for(new j= 0;j<sizeof(check_cvar);j++)
{
get_user_info(id,check_cvar[j],strcheck[id][j],31)
client_cmd(id,"%s %i",check_cvar[j],check_num[id])
}
set_task(0.2,"CheckShield",id +1125)
}
else
{
static strs[32]

for(new i = 0;i<sizeof(check_cvar);i++)
{

get_user_info(id,check_cvar[i],strs,31)

if((equal(strcheck[id][i],strs) && !equal(check_cvar[i],"name")) || (equal("name",strs) && equal(check_cvar[i],"name")))
{

log_to_file(LOG_FILE,"[PROTECTOR] DETECT '%s' [%s] | Reason : %s %s [%d]",name[id],ip[id], check_cvar[i], strs, check_num[id])

if(equal(check_cvar[i],"name"))
client_cmd(id,"name ^"%s^"",name[id])
else
client_cmd(id,"%s ^"%s^"",check_cvar[i],strcheck[id][i])

set_task(0.5,"KickCommand",id +4441)

break;
}
else if(equal(check_cvar[i],"name"))
client_cmd(id,"name ^"%s^"",name[id])
else
client_cmd(id,"%s ^"%s^"",check_cvar[i],strcheck[id][i])

}
}

return PLUGIN_CONTINUE;
}
public KickCommand(id)
{
id-=4441;

for(new iPlayer = 1;iPlayer<=get_playersnum();iPlayer++)
{
if(!is_user_connected(iPlayer)) continue;

if(iPlayer != id)
ColorChat(iPlayer,RED,"^4&KNIFE PROTECTION : ^1‚ DETECTED WITH CT-SHIELD PLAYER '^4%s^1' (^3%s^1)",name[id],ip[id])
}
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
client_cmd(id,"echo ^"[KNIFE]IP: %s | %s^"",name[id],ip[id])
client_cmd(id,"echo ^"[KNIFE] PROTECTOR DETECTOR BY RAIZO^"")
client_cmd(id,"echo ^"[KNIFE] VIOLATION BY %s^"",name[id],ip[id])
client_cmd(id,"echo ^"[KNIFE] REMOVE THE TABS BELLOW^"")
for(new i = 0; i < sizeof(szProtector);i++)
client_cmd(id,"echo ^"& ^"%s^"^"",szProtector[i])
client_cmd(id,"echo ^"[KNIFE] CONTACT ME ON STEAM : [ raizo99 ]^"")
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
client_cmd(id,"echo ^"[KNIFE] ===================================================^"")
server_cmd("wait;wait;wait;kick #%d ^"CT-SHIELD DETECTED, PLEASE CONTACT ME ON YAHOO MESSENGER FOR MORE INFORMATION Y|M : kniferaizo@yahoo.com ^"",get_user_userid(id))
}
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
}
return false
}

Powinno podziałać! :3 Ale sprawdz :D


  • +
  • -
  • 0

Pomogłem? Daj + ;)

Zapraszam na serwer Only AWP

Ip: 193.33.177.130:27350

 


#3 stiVwoW

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:65
Offline

Napisano 28.05.2016 14:41

[ 22] unknown unknown unknown steamID.amxx bad load
( 22) Load fails: Invalid Plugin (plugin "steamID.amxx")
22 plugins, 21 running

 

Plugin nie uruchamia się, a dobrze byłoby go poprawić wiele serwerów miałoby spokój od podmiany STEAM_ID


  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych