Участник
Пользователь
- Сообщения
- 169
- Реакции
- 51
- Помог
- 6 раз(а)
- Ошибка
-
[AMXX] Displaying debug trace (plugin "vacbans_041_beta.amxx", version "0.41")
[AMXX] Run time error 3: stack error
- ОС
- Linux
- Amx Mod X
-
1.9.0.5294
- Билд
-
3.13.0.788-dev
- ReGamedll
-
5.22.0.593-dev
- Версия Metamod
-
1.3.0.128
- Список метамодулей
-
description stat pend file vers src load unload
[ 1] Accuracy Fix RUN - accuracyfix_mm.so v1.0.2 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.137 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 6] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5294 ini Start ANY
[ 7] ReSemiclip RUN - resemiclip_mm_i386.so v2.4.3 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 9] YaPB RUN - yapb.so v4.3.734 ini Chlvl ANY
[10] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[11] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[13] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[14] CURL AMXX RUN - curl_amxx_i386.so v1.1.1 pl6 ANY ANY
[15] ReAPI RUN - reapi_amxx_i386.so v5.22.0.254-dev pl6 ANY Never
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[17] CSX RUN - csx_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[18] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
[19] IPHub Client RUN - iphubclient_amxx_i386.so v1.0.1 pl6 ANY Never
[20] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl6 ANY Never
[21] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl6 ANY ANY
21 plugins, 21 running
- Список плагинов
-
name version author file status
[ 1] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 2] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 3] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 4] Restrict Weapons 1.9.0.5294 AMXX Dev Team restmenu.amxx running
[ 5] New Kick Menu 1.4.2 Radius newkickmenu.amx running
[ 6] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 7] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 8] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 9] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 10] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 11] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 12] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 13] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 14] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 15] VAC Ban Status 0.41 bugsy vacbans_041_bet debug
[ 16] MOTD Model 1.1.0 fl0wer motd_model.amxx running
[ 17] Mode 2x2 2.5re s1lent mode.amxx running
[ 18] [ReAPI] Silly C4 2.0 F@ntoM & Cheap_S reapi_sillyc4.a running
[ 19] Ultimate Gore 1.6 JTP10181 amx_gore_ultima running
[ 20] Welcom 1.0 4el welcome_music.a running
[ 21] Admin Spectator ESP 1.3 KoST admin_spec_esp. running
[ 22] Top Bomber 0.2.0 Albertio top_bomber.amxx stopped
[ 23] Style C4 Timer 2.0 OciXCrom crx_c4timer.amx running
[ 24] [RP] Connect Info 1.0.0 Nordic Warrior geoip_connect_i running
[ 25] AFK Control 1.0 mx?! afk_control.amx running
[ 26] [ReAPI] Block 'Fire in 0.0.1 sergrib reapi_block_FIT running
[ 27] [ReAPI] Colored Flash 1.0 ReHLDS Team colored_flash.a running
[ 28] [ReAPI:AMXX] Buy Nades 0.0.3a steelzorrr buy_nades_limit running
[ 29] Quick Defuse Bomb 0.0.2 Albertio quick_defuse_bo stopped
[ 30] C4 CD Voice 1.1 c4timer_by_msk18 c4_cd_voice.amx running
[ 31] Knife Duel with Telepo 1.2 neygomon knife_duel.amxx running
[ 32] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 33] KiLL Assist poka_4to_b PRoSToTeM@ Kill_assist_rea running
[ 34] Reset Score 1.1.1 Nordic Warrior reset_score.amx running
[ 35] [BG] Provider: IPHub-C 1.1 mx?! bg_provider_iph running
[ 36] [BG] Provider: GeoIP 0.2 mx?! bg_provider_geo running
[ 37] Bypass Guard 1.0.1 mx?! bypass_guard.am running
[ 38] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 39] Unreal Demo Plugin 1.54 karaulov unreal_demo_plu running
[ 40] HPP_BLOCK 1.1 UNKNOWN + bristo hpp_blocker.amx running
[ 41] UNREAL ANTI-ESP 2.7 Karaulov anti_esp.amxx running
[ 42] Client Autoexec 1.2 miRror client_autoexec running
[ 43] Weapon Kill 1.2 Slove. & AcE weaponkill.amxx running
[ 44] Knife kill 1.0.1 MurLemur knife_kill_soun running
[ 45] unknown unknown unknown Server-Side_Smo running
[ 46] [ReAPI] Best player of 1.1.2 F@nt0M best_player_of_ running
[ 47] Back Weapons New 0.1 Vaqtincha backweapon.amxx running
[ 48] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 49] Weapons Skins Manager 0.0.1 Vaqtincha weapons_skins_m running
[ 50] Time for info 1.0 neugomon time_for_info.a running
[ 51] [GM] Weapon Models 0.0.1.0 [GM] NWC gm_weapon_model running
[ 52] Game Description Advan 1.0 fl0wer gamedesc_advanc running
[ 53] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc running
[ 54] C4 & Grenade Explode S 1.0 BodyBuilder | Ma c4_grenade_expl running
[ 55] Unreal Spawn Fixer 1.1 karaulov unreal_spawn_fi running
[ 56] Fix rehlds rate 1.0 Spartanec fix_rehlds.amxx running
[ 57] [190] AMXBans RBS 22.12.08BE SKAJIbnEJIb & La amxbans_rbs.amx running
[ 58] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 59] [190] Army Ranks Ultim 20.06.06 SKAJIbnEJIb army_ranks_ulti running
[ 60] [ReAMX] Ultimate Gag 17.12.22BE SKAJIbnEJIb ultimate_gag.am running
[ 61] [190] Chat RBS 22.12.07BE SKAJIbnEJIb chat_rbs.amxx running
[ 62] [190] CsStats MySQL 22.11.15 SKAJIbnEJIb csstats_mysql.a running
[ 63] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 64] [190] First Players Re 20.06.06 SKAJIbnEJIb FirstPlayersRes paused
[ 65] [190] Maps Helper 20.06.06 SKAJIbnEJIb maps_helper.amx running
[ 66] [190] Parachute RBS 22.12.07BE SKAJIbnEJIb & KR parachute_rbs.a running
[ 67] [190] Skill ELO 22.11.15 SKAJIbnEJIb skill_elo.amxx running
[ 68] [190] StatsX Unlimited 22.12.08 SKAJIbnEJIb statsx_unlimite running
[ 69] [190] Stats Configurat 20.06.06 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 70] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 71] [190] Top Award RBS 20.06.06 SKAJIbnEJIb topaward_rbs.am running
[ 72] [190] Ultimate Flags 22.11.15 SKAJIbnEJIb ultimate_flags. running
[ 73] [190] Ultimate Weapons 22.11.15 SKAJIbnEJIb ultimate_weapon running
[ 74] [190] Vanga Detector 23.07.29 SKAJIbnEJIb & Pr vanga_detector. running
[ 75] [190] VIP RBS 22.12.08BE SKAJIbnEJIb vip_rbs.amxx running
[ 76] [190] RestMenu RBS 20.06.06 SKAJIbnEJIb & AM restmenu_rbs.am running
[ 77] [190] High Ping Kicker 20.06.06 SKAJIbnEJIb hpk_rbs.amxx running
[ 78] [190] SlayLosers RBS 20.06.06 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 79] [190] DemoRecorder RBS 20.06.06 SKAJIbnEJIb demorecorder_rb running
[ 80] [190] VoteBan RBS 20.06.06 SKAJIbnEJIb voteban_rbs.amx running
[ 81] Map Manager: Core 3.2.1 Mistrick map_manager_cor running
[ 82] Map Manager: Scheduler 0.2.1 Mistrick map_manager_sch running
[ 83] Map Manager: Rtv 0.1.5 Mistrick map_manager_rtv running
[ 84] Map Manager: Nominatio 0.3.5 Mistrick map_manager_nom running
[ 85] Map Manager: BlockList 0.0.4 Mistrick map_manager_blo running
[ 86] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[ 87] Map Manager: Effects 0.1.3 Mistrick map_manager_eff running
[ 88] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 89] Map Manager: Sounds 0.0.3 Mistrick map_manager_sou running
89 plugins, 86 running
- Автор плагина
- bugsy
- Версия плагина
- 0.41
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <curl>
#include <nvault>
new const Version[] = "0.41";
#define VAULT "vacbanstatus"
enum //Check method
{
AUTO_CHECK,
MANUAL_NAME,
MANUAL_STEAMID
}
enum //Punishments
{
LOG_ONLY,
KICK_ONLY,
KICK_BAN_ID,
KICK_BAN_IP,
KICK_AMXBAN,
SHOOTBLANKS,
KICK_KDRATIO,
KICK_BAN_ID_KDRATIO,
KICK_BAN_IP_KDRATIO,
KICK_AMXBAN_KDRATIO,
SHOOTBLANKS_KDRATIO
}
enum //Database ban values
{
NO_DB_ENTRY,
NOT_BANNED,
BANNED,
NOT_BANNED_WHITELIST,
BANNED_WHITELIST
}
//Global vars
new g_VACBanned[ MAX_PLAYERS + 1 ]; //1 if VAC banned
new g_Punished[ MAX_PLAYERS + 1 ]; //1 when player punished
new g_ShootsBlanks[ MAX_PLAYERS + 1 ]; //1 if player shoots blanks
new g_JoinedTeam[ MAX_PLAYERS + 1 ]; //1 when joins a team (T or CT)
new g_IsBot[ MAX_PLAYERS + 1 ]; //1 if player is bot
new g_NotifyFlag[ MAX_PLAYERS + 1 ]; //1 if user has notify admin flag
new g_FMTraceLine; //FM traceline forward handle.
new g_NumShootsBlanks; //# of players who shoot blanks.
new g_Vault; //nVault handle
new g_MaxPlayers; //Max players server holds
new g_szSteamName[ MAX_PLAYERS + 1 ][65]; //Steam community name
new g_szFriendID[ MAX_PLAYERS + 1 ][65]; //Steam community ID#
new g_szAuthID[ MAX_PLAYERS + 1 ][35]; //Steam ID
new g_szName[ MAX_PLAYERS + 1 ][33]; //Name
new g_BodyHits[ MAX_PLAYERS + 1 ][33]; //For fm_set_user_hitzones
enum _:RequestData
{
RequestorID,
PlayerID,
RequestType,
SteamID64[ 32 ]
}
new g_CurlRequests[ CURL:33 ][ RequestData ]; //Request ID (handle of curl request)
const CURL_BUFFERSIZE = 4096;
new g_szCurlErrorBuffer[ CURL_ERROR_SIZE ];
new g_szCurlSSLCert[ 64 ];
//Cvar pointers
new g_pAutoCheck; //CVAR Enable\disable autocheck
new g_pVACCheck; //CVAR Specifies when to check player (0=connect or 1=team join)
new g_pExpireDays; //CVAR Days at which a saved VAC ban is removed
new g_pKDRatio; //CVAR Kill\Death ratio used for kdratio punishments
new g_pKDMin; //CVAR Min kills required before checking kdratios
new g_pPunishment; //CVAR Type of punishment to issue
new g_pBanTime; //CVAR Number of minutes a player is banned for ban punishments
new g_pNotifyFlag; //CVAR Notify flag required for notifications
public plugin_init()
{
register_plugin( "VAC Ban Status" , Version , "bugsy" );
register_cvar( "VAC Ban Status" , Version , FCVAR_SERVER , 0.0 );
register_concmd( "amx_vacban" , "CommandHandler" , ADMIN_BAN , "<Player\SteamID> - Check if player\steamid is VAC banned." );
register_concmd( "amx_vacquery" , "CommandHandler" , ADMIN_BAN , "<Player\SteamID>- Query a player\steamid database entry." );
register_concmd( "amx_vacaddwhitelist" , "CommandHandler" , ADMIN_BAN , "<Player\SteamID>- Add player\steamid to whitelist." );
register_concmd( "amx_vacremovewhitelist" , "CommandHandler" , ADMIN_BAN , "<Player\SteamID>- Remove player\steamid from whitelist." );
register_concmd( "amx_vacremoveentry" , "CommandHandler" , ADMIN_BAN , "<Player\SteamID>- Remove VAC ban status from database." );
register_concmd( "amx_vacclearall" , "CommandHandler" , ADMIN_BAN , "- Clear all database entries" );
register_concmd( "amx_vacclearnotbanned" , "CommandHandler" , ADMIN_BAN , "- Clear database entries for players that are not VAC banned." );
g_pAutoCheck = register_cvar( "vbs_autocheck" , "1" );
g_pVACCheck = register_cvar( "vbs_vaccheck" , "0" );
g_pPunishment = register_cvar( "vbs_punishment" , "0" );
g_pNotifyFlag = register_cvar( "vbs_notifyflag" , "d" );
g_pKDRatio = register_cvar( "vbs_kdratio" , "3" );
g_pKDMin = register_cvar( "vbs_kdminkills" , "15" );
g_pExpireDays = register_cvar( "vbs_expiredays" , "15" );
g_pBanTime = register_cvar( "vbs_bantime" , "0" );
register_event( "DeathMsg" , "fwEvDeathMsg" , "a" );
register_event( "TeamInfo" , "fwPlayerJoinedTeam" , "a" , "2=TERRORIST" , "2=CT" );
g_MaxPlayers = get_maxplayers();
}
public plugin_cfg()
{
new szConfigDir[ 64 ] , iLen;
iLen = get_modname( g_szCurlSSLCert , charsmax( g_szCurlSSLCert ) );
g_szCurlSSLCert[ iLen++ ] = '/';
copy( g_szCurlSSLCert[ ( iLen += get_datadir( g_szCurlSSLCert[ iLen ] , charsmax( g_szCurlSSLCert ) - iLen ) ) ] , charsmax( g_szCurlSSLCert ) - iLen , "/curl_cert/cacert.pem" );
if ( !file_exists( g_szCurlSSLCert , true ) )
{
set_fail_state( "curl SSL certificate not found. Place here: %s^nVisit: https://curl.se/docs/caextract.html" , g_szCurlSSLCert );
return;
}
get_configsdir( szConfigDir , charsmax( szConfigDir ) );
server_cmd( "exec %s/vacbanstatus.cfg" , szConfigDir );
server_exec();
if ( ( g_Vault = nvault_open( VAULT ) ) == INVALID_HANDLE )
set_fail_state( "Error opening nVault" );
else
nvault_prune( g_Vault , 0 , get_systime() - ( get_pcvar_num( g_pExpireDays ) * 86400 ) );
}
public plugin_end()
{
nvault_close( g_Vault );
}
public client_connect( id )
{
fm_hitzones_reset( id );
}
public client_putinserver( id )
{
if ( ( g_IsBot[ id ] = is_user_bot( id ) ) )
return PLUGIN_CONTINUE;
//Get users name and steamid and store it in global variable so it will
//not need to be retrieved again if needed later.
get_user_name( id , g_szName[ id ] , charsmax( g_szName[] ) );
get_user_authid( id , g_szAuthID[ id ], charsmax( g_szAuthID[] ) );
//For testing with a known banned steamid
//if ( id == get_user_index("bugsy") )
// g_szAuthID[id] = "STEAM_0:0:100";
//If auto-checking and check-on-connect are enabled, check player for VAC ban
if ( get_pcvar_num( g_pAutoCheck ) && !get_pcvar_num( g_pVACCheck ) )
AutoCheckPlayer(id);
//An admin has connected, check if has the required admin flag needed for notification.
//If so, notify him of any players that are connected that have a VAC ban on record.
if ( is_user_admin( id ) )
{
new szFlag[2];
get_pcvar_string( g_pNotifyFlag , szFlag , 1 );
//If player has admin flag specified in cvar vbs_notifyflag
if ( ( g_NotifyFlag[ id ] = ( get_user_flags( id ) & read_flags( szFlag ) ) ) )
set_task( 8.0 , "NotifyAdmin" , id );
}
return PLUGIN_CONTINUE;
}
public fwPlayerJoinedTeam()
{
new id = read_data( 1 );
if ( g_JoinedTeam[id] || g_IsBot[id] || !get_pcvar_num( g_pAutoCheck ) || !get_pcvar_num( g_pVACCheck ) )
return PLUGIN_CONTINUE;
g_JoinedTeam[ id ] = 1;
AutoCheckPlayer( id );
return PLUGIN_CONTINUE;
}
public fwEvDeathMsg()
{
new iPunishment = get_pcvar_num( g_pPunishment );
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
if( ( iPunishment < KICK_KDRATIO ) || !iKiller || !g_VACBanned[ iKiller ] || ( iKiller == iVictim ) || g_Punished[ iKiller ] )
return PLUGIN_CONTINUE;
new iKills = get_user_frags( iKiller );
new iDeaths = get_user_deaths( iKiller );
if ( ( iKills >= get_pcvar_num( g_pKDMin ) ) && ( ( float( iKills ) / get_pcvar_float( g_pKDRatio ) ) >= float( iDeaths ) ) )
{
iPunishment -= KICK_KDRATIO;
PunishPlayer( iKiller , iPunishment );
}
return PLUGIN_CONTINUE;
}
#if AMXX_VERSION_NUM < 190
public client_disconnect( id )
#else
public client_disconnected( id )
#endif
{
if( g_IsBot[ id ] )
return PLUGIN_CONTINUE;
if ( g_ShootsBlanks[ id ] )
SetShootBlanks( id , 0 );
//Clear all vars for player index
g_szSteamName[ id ][ 0 ] = EOS;
g_szFriendID[ id ][ 0 ] = EOS;
g_szAuthID[ id ][ 0 ] = EOS;
g_szName[ id ][ 0 ] = EOS;
g_VACBanned[ id ] = 0;
g_JoinedTeam[ id ] = 0;
g_NotifyFlag[ id ] = 0;
g_Punished[ id ] = 0;
return PLUGIN_CONTINUE;
}
public AutoCheckPlayer(id)
{
new iBanVal = nvault_get( g_Vault , g_szAuthID[ id ] );
//No entry exists in database for player, send VAC check request to steam server
if ( iBanVal == NO_DB_ENTRY )
{
SendRequest( 0 , id , AUTO_CHECK );
}
//Entry found in database and player is VAC banned, punish and notify admins
else if ( iBanVal == BANNED )
{
static szHUD[ 256 ];
new iPlayers[ 32 ];
new iPlayersNum;
new iPlayer;
g_VACBanned[ id ] = 1;
get_players( iPlayers , iPlayersNum , "c" );
formatex( szHUD , charsmax( szHUD ) , "[VAC Ban Status]^n^n%s has a VAC ban on record. [Database]^nSteamID: %s" , g_szName[ id ] , g_szAuthID[ id ] );
set_hudmessage( 255 , 255 , 255 , 0.10 , 0.35 , 0 , 2.0 , 4.0 , 0.5 , 0.5 , 3 );
//Notify all connected admins that this player has connected and is banned
for ( new i = 0 ; ( i < iPlayersNum ) ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_NotifyFlag[ iPlayer ] )
{
show_hudmessage( iPlayer , szHUD );
client_cmd( iPlayer , "spk buttons/blip1.wav" );
}
}
//If punishment is not a kd-ratio punishment, issue punishment now.
new iPunishment = get_pcvar_num( g_pPunishment );
if ( iPunishment <= SHOOTBLANKS )
{
//VAC check done on client connect so we need a little pause to allow player to
//fully initialize into game or else some punishments will not work.
if ( !get_pcvar_num( g_pVACCheck ) )
{
new params[ 2 ];
params[ 0 ] = id;
params[ 1 ] = iPunishment;
set_task( 0.5 , "DelayPunishment" , _ , params , sizeof( params ) );
}
else
{
PunishPlayer( id , iPunishment );
}
}
}
}
public DelayPunishment( params[ 2 ] )
{
PunishPlayer( params[ 0 ] , params[ 1 ] );
}
public CommandHandler( id , level , cid )
{
if( !cmd_access( id , level , cid , 1 ) )
return PLUGIN_HANDLED;
//amx_vacban
//amx_vacremoveentry
//amx_vacaddwhitelist
//amx_vacremovewhitelist
//amx_vacquery
//amx_vacclearall
//amx_vacclearnotbanned
new szCmd[ 23 ];
read_argv( 0 , szCmd , charsmax( szCmd ) );
if ( equal( szCmd , "amx_vacclearnotbanned" ) )
{
nvault_prune( g_Vault , 0 , get_systime() );
console_print( id , "*[VAC BAN Status] Все записи, не запрещенные VAC, были удалены." );
return PLUGIN_HANDLED;
}
else if ( equal( szCmd , "amx_vacclearall" ) )
{
new szVaultFile[ 65 ] , iLen;
formatex( szVaultFile[ ( iLen = get_datadir( szVaultFile , charsmax( szVaultFile ) ) ) ] , charsmax( szVaultFile ) - iLen , "/vault/%s.vault" , VAULT );
nvault_close( g_Vault );
if ( delete_file( szVaultFile ) )
{
if ( ( g_Vault = nvault_open( VAULT ) ) != INVALID_HANDLE )
{
console_print( id , "*[VAC Ban Status] База данных успешно очищена." );
return PLUGIN_HANDLED;
}
}
set_fail_state( "Error clearing nvault" );
return PLUGIN_HANDLED;
}
new iPlayer;
new szVal[2];
new iBanVal;
new iTimestamp;
new szArgs[46];
new iRequestType;
read_args( szArgs , charsmax( szArgs ) );
//The below commands all require a parameter (name\steamid) so we determine which is
//being specified by the user.
if( !equali( szArgs , "STEAM_0:" , 8 ) )
{
iPlayer = cmd_target( id , szArgs , ( CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS ) );
if( !is_user_connected( iPlayer ) || g_IsBot[ iPlayer ] )
return PLUGIN_HANDLED;
}
else
{
iPlayer = 0;
trim( szArgs );
copy( g_szAuthID[ iPlayer ] , charsmax( g_szAuthID[] ) , szArgs[ strfind( szArgs , " " ) + 1 ] );
strtoupper( g_szAuthID[ iPlayer ] );
if ( ( strlen( g_szAuthID[ iPlayer ] ) <= 10 ) )
{
console_print( id , "*[VAC Ban Status] Недопустимый SteamID [%s]." , g_szAuthID[ iPlayer ] );
return PLUGIN_HANDLED;
}
if ( g_szAuthID[ iPlayer ][ 10 ] == '0' )
formatex( g_szAuthID[ iPlayer ][ 10 ] , charsmax( g_szAuthID[] ) - 10 , "%d" , str_to_num( g_szAuthID[ iPlayer ][ 10 ] ) );
}
if ( nvault_lookup( g_Vault , g_szAuthID[iPlayer] , szVal , charsmax( szVal ) , iTimestamp ) )
iBanVal = str_to_num( szVal );
if ( equal( szCmd , "amx_vacban" ) )
{
//if( g_Socket[id] )
//{
// console_print( id , "*[VAC Ban Status] Предыдущая проверка все еще выполняется, повторите попытку, когда она завершится." );
// return PLUGIN_HANDLED;
//}
if ( iPlayer )
{
console_print( id , "*[VAC Ban Status] Проверка %s [%s]." , g_szName[iPlayer] , g_szAuthID[iPlayer] );
iRequestType = MANUAL_NAME;
}
else
{
console_print( id , "*[VAC Ban Status] Проверка SteamID [%s]." , g_szAuthID[iPlayer] );
iRequestType = MANUAL_STEAMID;
}
SendRequest( id , iPlayer , iRequestType );
return PLUGIN_HANDLED;
}
else if ( equal( szCmd , "amx_vacquery" ) )
{
switch ( iBanVal )
{
case NO_DB_ENTRY: console_print( id , "*[VAC Ban Status] Запрос: В базе данных не существует записи для %s." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
case NOT_BANNED:
{
new Float:fExpireDays = ( ( get_pcvar_float( g_pExpireDays ) * 86400.0 ) - ( float(get_systime()) - float(iTimestamp) ) ) / 86400.0;
console_print( id , "*[VAC Ban Status] Запрос: %s не заблокирован VAC. Срок действия записи истекает через %d дней." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] , floatround(fExpireDays) );
}
case BANNED: console_print( id , "*[VAC Ban Status] Запрос: %s имеет VAC-бан на запись." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
case NOT_BANNED_WHITELIST: console_print( id , "*[VAC Ban Status] Запрос: %s занесен в белый список без запрета VAC на запись." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
case BANNED_WHITELIST: console_print( id , "*[VAC Ban Status] Запрос: %s занесен в белый список с запретом VAC на запись." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
}
return PLUGIN_HANDLED;
}
else if ( equal( szCmd , "amx_vacaddwhitelist" ) )
{
if ( iBanVal <= BANNED )
{
if ( !iBanVal )
iBanVal = NOT_BANNED;
szVal[0] = '0' + ( iBanVal + 2 );
nvault_pset( g_Vault , g_szAuthID[iPlayer] , szVal );
console_print( id , "*[VAC Ban Status] %s был внесен в белый список." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
}
else
{
console_print( id , "*[VAC Ban Status] %s уже внесен в белый список." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
}
return PLUGIN_HANDLED;
}
//The below commands involve removing existing entries so we verify that an entry exists first.
if ( !iBanVal )
{
console_print( id , "*[VAC Ban Status] Для %s не существует записи в базе данных." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
return PLUGIN_HANDLED;
}
if ( equal( szCmd , "amx_vacremoveentry" ) )
{
//Player has VAC status in db and is not whitelisted
if ( iBanVal <= BANNED )
{
nvault_remove( g_Vault , g_szAuthID[iPlayer] );
console_print( id , "*[VAC Ban Status] Запись базы данных VAC ban для %s была удалена." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
}
else
{
console_print( id , "*[VAC Ban Status] %s занесен в белый список, необходимо использовать команду amx_vacremovewhitelist." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
}
}
else if ( equal( szCmd , "amx_vacremovewhitelist" ) )
{
//Player is on whitelist, set appropriate ban status by subtracting 2 from whitelist status
if ( iBanVal >= NOT_BANNED_WHITELIST )
{
szVal[0] = '0' + ( iBanVal - 2 );
if ( iBanVal == NOT_BANNED_WHITELIST )
nvault_set( g_Vault , g_szAuthID[iPlayer] , szVal );
else
nvault_pset( g_Vault , g_szAuthID[iPlayer] , szVal );
console_print( id , "*[VAC Ban Status] %s был удален из белого списка; игрок %s забанен VAC." , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] , ( iBanVal == NOT_BANNED_WHITELIST ) ? " not" : "" );
}
else
{
console_print( id , "*[VAC Ban Status] %s имеет запись в базе данных, но не занесен в белый список. Используйте команду amx_vac удалить запись" , !iPlayer ? g_szAuthID[iPlayer] : g_szName[iPlayer] );
}
}
return PLUGIN_HANDLED;
}
public NotifyAdmin( id )
{
static szNames[513];
new iPlayers[32];
new iPlayersNum;
new iPlayer;
new iPos;
new iFound;
iPos = formatex( szNames , 512 , "[VAC Ban Status]^nThe following players have^na VAC ban on record:^n^n" );
get_players( iPlayers , iPlayersNum , "c" );
//Cycle through all players and create a list of VAC banned players
for ( new i = 0 ; i < iPlayersNum ; i++ )
{
iPlayer = iPlayers[ i ];
if( g_VACBanned[ iPlayer ] )
{
iFound++;
iPos += formatex( szNames[ iPos ] , charsmax( szNames ) - iPos , "%s^n" , g_szName[ iPlayer ] );
}
}
//If we have found any, display to admin
if( iFound )
{
set_hudmessage( 255 , 255 , 255 , 0.10 , 0.35 , 0 , 2.0 , 4.0 , 0.5 , 0.5 , 3 );
show_hudmessage( id , szNames );
client_cmd( id , "spk buttons/blip1.wav" );
}
}
public SendRequest( id , idCheck , iRequestType )
{
new szURL[ 128 ];
new CURL:cURLHandle , CURLcode:ccRetVal;
GetFriendID( g_szAuthID[ idCheck ] , g_szFriendID[ idCheck ] , charsmax( g_szFriendID[] ) );
formatex( szURL , charsmax( szURL ) , "https://steamcommunity.com/profiles/%s?xml=1" , g_szFriendID[ idCheck ] );
cURLHandle = curl_easy_init();
curl_easy_setopt( cURLHandle , CURLOPT_URL , szURL );
g_CurlRequests[ cURLHandle ][ RequestorID ] = id;
g_CurlRequests[ cURLHandle ][ PlayerID ] = idCheck;
g_CurlRequests[ cURLHandle ][ RequestType ] = iRequestType;
copy( g_CurlRequests[ cURLHandle ][ SteamID64 ] , charsmax( g_CurlRequests[][ SteamID64 ] ) , g_szFriendID[ idCheck ] );
curl_easy_setopt( cURLHandle , CURLOPT_WRITEFUNCTION , "ResponseReceived" );
curl_easy_setopt( cURLHandle , CURLOPT_ERRORBUFFER , g_szCurlErrorBuffer );
curl_easy_setopt( cURLHandle , CURLOPT_BUFFERSIZE , CURL_BUFFERSIZE );
curl_easy_setopt( cURLHandle , CURLOPT_SSL_VERIFYPEER, 1);
curl_easy_setopt( cURLHandle , CURLOPT_CAINFO , g_szCurlSSLCert );
if ( ( ccRetVal = CURLcode:curl_easy_perform( cURLHandle , "CurlCallback" , g_CurlRequests[ cURLHandle ] , sizeof( g_CurlRequests[] ) ) ) != CURLE_OK )
{
if ( g_szCurlErrorBuffer[ 0 ] == EOS )
{
curl_easy_strerror( ccRetVal , g_szCurlErrorBuffer , charsmax( g_szCurlErrorBuffer ) );
}
set_fail_state( "curl request failed with error %d [%s]" , ccRetVal , g_szCurlErrorBuffer );
}
return PLUGIN_HANDLED;
}
public ResponseReceived( const szBuffer[] , iSize , iNumMemb , sd )
{
new iBannedPos = strfind( szBuffer , "<vacBanned>" );
new szBanVal[ 2 ];
new szStatus[ 2 ];
new szName[ 32 ];
new szSteamID64[ 32 ];
new CURL:cSlot;
if ( iBannedPos != -1 )
{
new iSteamNamePos = strfind( szBuffer , "<steamID><![CDATA[" );
new iSteamNameEnd = strfind( szBuffer , "]]></steamID>" );
new iSteamID64 = strfind( szBuffer , "<steamID64>" );
new iSteamID64End = strfind( szBuffer , "</steamID64>" );
copy( szStatus , charsmax( szStatus ) , szBuffer[ iBannedPos + 11 ] );
copy( szName , iSteamNameEnd - ( iSteamNamePos + 18 ) , szBuffer[ iSteamNamePos + 18 ] );
copy( szSteamID64 , iSteamID64End - ( iSteamID64 + 11 ) , szBuffer[ iSteamID64 + 11 ] );
cSlot = GetSlotBySteam64( szSteamID64 );
new id = g_CurlRequests[ cSlot ][ RequestorID ];
new idCheck = g_CurlRequests[ cSlot ][ PlayerID ];
new iRequestType = g_CurlRequests[ cSlot ][ RequestType ];
if ( szStatus[ 0 ] == '1' )
{
g_VACBanned[idCheck] = 1;
switch ( iRequestType )
{
case AUTO_CHECK:
{
szBanVal[0] = '0' + BANNED;
nvault_pset( g_Vault , g_szAuthID[idCheck] , szBanVal );
log_to_file( "vacstatus.log", "%s is VAC banned. [SteamID: %s] [CommunityName: %s] [CommunityID: %s]", g_szName[ idCheck ], g_szAuthID[ idCheck ] , szName , szSteamID64 );
static szHUD[479];
new iPlayers[32];
new iPlayersNum;
new iPlayer;
formatex( szHUD , charsmax( szHUD ) , "[VAC Ban Status]^n^n%s has a VAC ban on record.^nSteamID: %s^nSteamCommunity Name: %s" , g_szName[ idCheck ] , g_szAuthID[ idCheck ] , szName );
set_hudmessage( 255 , 255 , 255 , 0.10 , 0.35 , 0 , 2.0 , 4.0 , 0.5 , 0.5 , 3 );
get_players( iPlayers, iPlayersNum , "c" );
for ( new i = 0 ; i < iPlayersNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_NotifyFlag[iPlayer] )
{
show_hudmessage( iPlayer , szHUD );
client_cmd( iPlayer , "spk buttons/blip1.wav" );
}
}
}
case MANUAL_NAME: console_print( id , "*[VAC Ban Status] %s is VAC banned!" , g_szName[ idCheck ] );
case MANUAL_STEAMID: console_print( id , "*[VAC Ban Status] SteamID [%s] is VAC banned!" , g_szAuthID[ idCheck ] );
}
//Issue punishment if non kill:death ratio punishment selected
new iPunishment = get_pcvar_num( g_pPunishment );
if ( iPunishment <= SHOOTBLANKS )
PunishPlayer( idCheck , iPunishment );
}
else if ( szStatus[ 0 ] == '0' )
{
g_VACBanned[idCheck] = 0;
switch ( iRequestType )
{
case AUTO_CHECK:
{
szBanVal[ 0 ] = '0' + NOT_BANNED;
nvault_set( g_Vault , g_szAuthID[ idCheck ] , szBanVal );
}
case MANUAL_NAME: console_print( id , "*[VAC Ban Status] %s is not VAC banned." , g_szName[ idCheck ] );
case MANUAL_STEAMID: console_print( id , "*[VAC Ban Status] SteamID [%s] is not VAC banned." , g_szAuthID[ idCheck ] );
}
}
}
return ( iSize * iNumMemb );
}
public CurlCallback( CURL:cURLHandle , CURLcode:code )
{
curl_easy_cleanup( cURLHandle );
}
public PunishPlayer( id , iPunishment )
{
new szMsg[ 30 ];
g_Punished[id] = 1;
switch ( iPunishment )
{
case LOG_ONLY:
{
return PLUGIN_HANDLED;
}
case KICK_ONLY:
{
KickPlayer( id , "[VAC Ban Status]", "A VAC ban record was found on your steam account." , "You have been kicked" ) ;
formatex( szMsg , charsmax( szMsg ) , "was kicked" );
}
case KICK_BAN_ID:
{
server_cmd("amx_ban ^"#%d^" ^"%d^" ^"VAC Banned^"" , get_user_userid( id ) , get_pcvar_num( g_pBanTime ) );
formatex( szMsg , charsmax( szMsg ) , "was kicked and banned" );
}
case KICK_BAN_IP:
{
server_cmd( "amx_banip ^"#%d^" ^"%d^" ^"VAC Banned^"" , get_user_userid( id ) , get_pcvar_num( g_pBanTime ) );
formatex( szMsg , charsmax( szMsg ) , "was kicked and banned" );
}
case KICK_AMXBAN:
{
server_cmd( "amx_ban %d %s VAC Banned", get_pcvar_num( g_pBanTime ) , g_szAuthID[ id ] );
formatex( szMsg , charsmax( szMsg ) , "was kicked and banned" );
}
case SHOOTBLANKS:
{
SetShootBlanks( id , 1 );
formatex( szMsg , charsmax( szMsg ) , "will now shoot blanks" );
}
}
new iPlayers[ 32 ];
new iPlayersNum;
new iPlayer;
get_players( iPlayers, iPlayersNum , "c" );
for ( new i = 0 ; i < iPlayersNum ; i++ )
{
iPlayer = iPlayers[ i ];
if ( g_NotifyFlag[ iPlayer ] )
client_print( iPlayer , print_chat , "[VAC Ban Status] %s %s for being VAC banned%s" , g_szName[ id ] , szMsg , ( get_pcvar_num( g_pPunishment ) >= 6 ) ? " with a high kill:death ratio." : "." );
}
return PLUGIN_HANDLED;
}
public SetShootBlanks( id , iVal )
{
//iVal = 1 - Set shoot blanks on player and enable traceline forward if not yet enabled.
//iVal = 0 - Remove shoot blanks for player id and disable forward if no other players shoot blanks.
if ( iVal )
{
fm_set_user_hitzones( id , 0 , 0 );
g_ShootsBlanks[ id ] = 1;
g_NumShootsBlanks++;
if ( !g_FMTraceLine )
g_FMTraceLine = register_forward( FM_TraceLine , "fw_TraceLine" , 1 );
}
else
{
g_ShootsBlanks[ id ] = 0;
g_NumShootsBlanks--;
if ( !g_NumShootsBlanks && g_FMTraceLine )
{
unregister_forward( FM_TraceLine , g_FMTraceLine , 1 );
g_FMTraceLine = 0;
}
}
}
//fm_set_user_hitzones
public fw_TraceLine( Float:v1[ 3 ] , Float:v2[ 3 ], NoMonsters , shooter , ptr )
{
if ( !( 1 <= shooter <= g_MaxPlayers ) )
return FMRES_IGNORED;
new iPlayerHit = get_tr2( ptr , TR_pHit );
if ( !( 1 <= iPlayerHit <= g_MaxPlayers ) )
return FMRES_IGNORED;
new iHitzone = get_tr2( ptr , TR_iHitgroup );
if ( !( g_BodyHits[ shooter ][ iPlayerHit ] & ( 1 << iHitzone ) ) )
set_tr2( ptr , TR_flFraction , 1.0 );
return FMRES_IGNORED;
}
public fm_set_user_hitzones(index, target, body)
{
if ( !index && !target )
{
for ( new i = 1 ; i <= g_MaxPlayers ; i++ )
for (new j = 1 ; j <= g_MaxPlayers ; j++ )
g_BodyHits[i][j] = body;
}
else if ( !index && target )
{
for ( new i = 1 ; i <= g_MaxPlayers ; i++ )
g_BodyHits[i][target] = body;
}
else if ( index && !target )
{
for ( new i = 1 ; i <= g_MaxPlayers ; i++ )
g_BodyHits[index][i] = body;
}
else if ( index && target )
{
g_BodyHits[index][target] = body;
}
}
public fm_hitzones_reset(index)
{
for ( new i = 1 ; i <= g_MaxPlayers ; i++ )
{
g_BodyHits[index][i] = (1<<HIT_GENERIC) | (1<<HIT_HEAD) | (1<<HIT_CHEST) |
(1<<HIT_STOMACH) | (1<<HIT_LEFTARM) | (1<<HIT_RIGHTARM)|
(1<<HIT_LEFTLEG) | (1<<HIT_RIGHTLEG);
}
}
// Credit to Teyut for multi-line kick message
KickPlayer( target , szReason[] , szLine2[] , szLine3[] )
{
static msg_content[1024];
formatex(msg_content, charsmax( msg_content ) , "%s^n%s^n%s", szReason, szLine2, szLine3);
message_begin(MSG_ONE_UNRELIABLE, 2 , _, target);
write_string(msg_content);
message_end() ;
}
CURL:GetSlotBySteam64( const szSteam64[] )
{
new CURL:cSlot;
for ( new CURL:cIndex = CURL:1 ; cIndex < CURL:sizeof( g_CurlRequests ) ; cIndex++ )
{
if ( equal( g_CurlRequests[ CURL:cIndex ][ SteamID64 ] , szSteam64 ) )
{
cSlot = cIndex;
break;
}
}
return cSlot;
}
// Credit to danielkza for the code below
GetFriendID( const szAuthID[] ,szReturn[] ,iRetLen )
{
static const szFriendsBaseNum[] = "76561197960265728";
new szServer[2], szSteamID[64];
new iServerPos = containi(szAuthID,":");
if(iServerPos < 0)
return 0;
strtok(szAuthID[iServerPos+1],szServer,charsmax(szServer),szSteamID,charsmax(szSteamID),':',1);
if(!is_str_num(szServer) || !is_str_num(szSteamID))
return 0;
// AuthID * 2
NumString_Add(szSteamID,szSteamID,szSteamID,charsmax(szSteamID));
// AuthID + Base Number + Server Number
NumString_Add(szSteamID,szFriendsBaseNum,szSteamID,charsmax(szSteamID));
NumString_Add(szSteamID,szServer,szSteamID,charsmax(szSteamID));
return (copy(szReturn,iRetLen,szSteamID) > 0);
}
NumString_Add(const szString1[],const szString2[],szReturn[], iRetLen)
{
new iLen1 = strlen(szString1), iLen2=strlen(szString2);
if(!iLen1 || !iLen2)
return;
static szTemp1[64];
copy(szTemp1,iLen1,szString1);
static szTemp2[64];
copy(szTemp2,iLen2,szString2);
static szTemp3[64];
new iTempNum,iCarry;
new iCharPos=0;
do
{
iTempNum = 0;
if(--iLen1 >= 0 && isdigit(szTemp1[iLen1]))
iTempNum += char_to_num(szTemp1[iLen1]);
if(--iLen2 >= 0 && isdigit(szTemp2[iLen2]))
iTempNum += char_to_num(szTemp2[iLen2]);
iTempNum += iCarry;
iTempNum -= ((iCarry = iTempNum / 10) * 10);
szTemp3[iCharPos++] = num_to_char(iTempNum);
}
while(iLen1 >= 0 || iLen2 >= 0);
new bool:iNumStarted = false;
new iLastChar = min(iRetLen, iCharPos),i;
if(iLastChar)
{
while(--iCharPos >= 0 && i < iLastChar)
{
if(szTemp3[iCharPos] == '0' && !iNumStarted)
continue;
else
{
iNumStarted = true;
szReturn[i++] = szTemp3[iCharPos];
}
}
}
}
num_to_char(num)
{
return ( (num < 0) || (num > 9) ) ? '^0' : '0' + num;
}
char_to_num(chr)
{
return ( (chr < '0') || (chr > '9') ) ? 0 : (chr - '0');
}
Оригинальная тема тут , к сожалению последнее сообщение датировано 04-07-2021
Собственно вопрос, как можно пофикисть работу плагина?
В логах есть сообщение об ошибке:
Собственно вопрос, как можно пофикисть работу плагина?
В логах есть сообщение об ошибке:
Код:
[AMXX] Displaying debug trace (plugin "vacbans_041_beta.amxx", version "0.41")
[AMXX] Run time error 3: stack error