- Ошибка
-
L 07/12/2023 - 13:44:52: [AMXX] [0] statswp.sma::SAVE (line 82)
L 07/12/2023 - 13:44:52: [AMXX] [1] statswp.sma::client_disconnected (line 60)
L 07/12/2023 - 13:44:52: Invalid weapon id 0
L 07/12/2023 - 13:44:52: [AMXX] Displaying debug trace (plugin "statswp.amxx", version "1.0")
L 07/12/2023 - 13:44:52: [AMXX] Run time error 10: native error (native "get_weaponname")
L 07/12/2023 - 13:44:52: [AMXX] [0] statswp.sma::SAVE (line 82)
L 07/12/2023 - 13:44:52: [AMXX] [1] statswp.sma::client_disconnected (line 60)
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5467
- Билд
-
ReHLDS version: 3.12.0.780-dev
- ReGamedll
-
ReGameDLL version: 5.21.0.576-dev
- Версия Metamod
-
Metamod-r v1.3.0.128
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5467 ini Start ANY
[ 2] MySQL RUN - mysql_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[ 3] CSX RUN - csx_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[ 4] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
4 plugins, 4 running
- Список плагинов
-
[ 1] 0 New Plug-In 1.0 author unknown statswp.amx debug
1 plugins, 1 running
- Автор плагина
- author
- Версия плагина
- 1.0
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <sqlx>
#include <csx>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define host "127.0.0.1"
#define user ""
#define pass ""
#define db ""
#define MAX_WEAPONS 32
enum _:SQL
{
DATA_NO,
DATA_YES
}
enum _:weapon
{
kills,
deaths,
hs
};
new Handle:g_SQLTuple
new g_weapon[33][MAX_WEAPONS+1][weapon];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_SQLTuple = SQL_MakeDbTuple(host, user, pass, db)
}
public plugin_end( )
{
SQL_FreeHandle(g_SQLTuple);
}
public client_putinserver(id)
{
for(new i;i < sizeof(g_weapon[]);i++)
{
arrayset(g_weapon[id][i],0,sizeof(g_weapon[]));
}
}
public client_disconnected(id)
{
SAVE(id);
}
public client_death(Attacker,Victim,iWeapon,Place,TK)
{
g_weapon[Attacker][iWeapon][kills]++;
g_weapon[Victim][iWeapon][deaths]++;
if(Place == HIT_HEAD)
g_weapon[Attacker][iWeapon][hs]++;
}
SAVE(const id)
{
new szQuery[ 2056 ]
new Stm[35],Wpname[32]
get_user_authid(id,Stm,charsmax(Stm));
for(new i;i < sizeof(g_weapon[]);i++)
{
get_weaponname(i,Wpname,charsmax(Wpname));
formatex(szQuery, charsmax(szQuery), "INSERT INTO `weapon_stats2` (`weapon_id`, `weapon_name`, `steamid`, `kills`, `deaths`, `hs`) \
VALUES ('%d', '%s', '%s', '%d', '%d', '%d') \
ON DUPLICATE KEY UPDATE \
`kills` = `kills` + VALUES(`kills`), \
`deaths` = `deaths` + VALUES(`deaths`), \
`hs` = `hs` + VALUES(`hs`);",
i, Wpname,Stm, g_weapon[id][i][kills], g_weapon[id][i][deaths], g_weapon[id][i][hs])
}
new szData[ 1 ]
szData[0] = DATA_NO;
SQL_ThreadQuery( g_SQLTuple, "QueryHandle", szQuery, szData, sizeof( szData ) );
}
public QueryHandle(iFailState,Handle:iQuery,szError[],iErrCode,szData[],iDataSize,Float:fQueueTime)
{
switch( iFailState )
{
case TQUERY_CONNECT_FAILED: { log_amx( "[SQL Error] Connection failed (%i): %s", iErrCode, szError ); return; }
case TQUERY_QUERY_FAILED: { log_amx( "[SQL Error] Query failed (%i): %s", iErrCode, szError ); return; }
}
}
privet. anyone can help plz
thank you.
thank you.
В этой теме было размещено решение! Перейти к решению.