Пользователь
- Сообщения
- 12
- Реакции
- -1
- Ошибка
-
L 03/08/2021 - 14:02:24: [MySQL] Invalid database handle: 0
L 03/08/2021 - 14:02:24: [AMXX] Displaying debug trace (plugin "jb_quest_core.amxx", version "1.0")
L 03/08/2021 - 14:02:24: [AMXX] Run time error 10: native error (native "SQL_PrepareQuery")
L 03/08/2021 - 14:02:24: [AMXX] [0] jb_quest_core.sma::func_GetStoreNick (line 6)
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5271
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.698-dev
Build date: 10:14:22 Aug 19 2020 (2321)
Build from: https://github.com/dreamstalker/rehlds/commit/376bc15
- ReGamedll
-
ReGameDLL version: 5.18.0.474-dev
Build date: 11:07:34 Jul 16 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/efb06a7
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.135 ini Start Never
[ 2] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 4] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 5] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl3 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl3 ANY ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl3 ANY ANY
[ 8] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl3 ANY ANY
[ 9] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl3 ANY ANY
[10] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl3 ANY ANY
[11] ReAPI RUN - reapi_amxx_i386.so v5.15.0.197-dev pl3 ANY Never
[12] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl3 ANY ANY
[13] FakeServerQueries RUN - fsq_amxx_i386.so v1.0 pl3 ANY ANY
- Список плагинов
-
[ 1] Center Msg Fix 0.4 mx?! CenterMsgFix.am running
[ 2] FreshBans 1.4.2b kanagava fresh_bans.amxx running
[ 3] Admin Base 1.9.0.5271 AMXX Dev Team admin.amxx running
[ 4] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 5] Multi-Lingual System 1.9.0.5249 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5271 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.8.1.3746 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx running
[ 11] Scrolling Message 1.9.0.5271 AMXX Dev Team scrollmsg.amxx running
[ 12] Info. Messages 1.9.0.5271 AMXX Dev Team imessage.amxx running
[ 13] Admin Votes 1.9.0.5271 AMXX Dev Team adminvote.amxx running
[ 14] Map Manager 2.5.61 Mistrick mapmanager.amxx debug
[ 15] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx running
[ 16] Jailbreak Quest 1.0 /7uBko jb_quest_core.a debug
[ 17] Jailbreak Flowers 1.0 /7uBko jb_quest_flower debug
[ 18] Jailbreak Quest Girl 1.0 /7uBko jb_quest_girl.a debug
[ 19] Jailbreak Mod 1.0 /7uBko jb_mod.amxx debug
[ 20] No Corpse 1.0 /7uBko jb_nocorps.amxx debug
[ 21] Loading Sound 1.0 Amxx User jb_music.amxx debug
[ 22] Jailbreak Hook 1.0 /7uBko jb_hook.amxx debug
[ 23] New FooTball 1.0 FlesHka /pRoxxx jb_football.amx debug
[ 24] Jailbraek 3th Cam 1.0 /7uBko jb_3th_cam.amxx debug
[ 25] Jailbreak Shop 1.0 /7uBko jb_shop.amxx debug
[ 26] Jailbreak Hud Delete 1.0 /7uBko jb_hudblock.amx debug
[ 27] JailBreak Grab 1.0 Lacoste jb_grab.amxx debug
[ 28] Jailbreak Game Name 1.0 /7uBko jb_game_name.am debug
[ 29] Ch Jb 2.1 Sky Cat jb_gamemode.amx debug
[ 30] Jailbreak Welcome 1.0 /7uBko jb_welcome_soun debug
[ 31] Jailbreak Knife Kill 1.0 /7uBko jb_knife_kill.a debug
[ 32] [JB] VIP Menu 1.0 /7uBko jb_vipmenu.amxx debug
[ 33] [ JB ] Ranks 0.1 /7uBko jb_rank.amxx debug
[ 34] Jailbreak Demo 1.0 /7uBko jb_demo.amxx debug
[ 35] Jailbreak Advert. 1.0 /7uBko jb_advertisment debug
[ 36] Jailbreak Noclip and G 1.0 /7uBko jb_noclip.amxx debug
[ 37] Jailberak Round Sound 1.0 /7uBko jb_roundsound.a debug
[ 38] Players FPS 1.0 Empowers and Adm JailFPS.amxx running
[ 39] Potti 1.40 p3tsin potti.amxx debug
[ 40] Jailbreak Hats 1.0 /7uBko jb_hats.amxx debug
[ 41] Jailbreak Chat 1.0 /7uBko jb_chat.amxx debug
[ 42] JailBreak | WTF 1.0 Lacoste fakeonline.amxx running
[ 43] Master Servers Check 4.8 Javekson ms_check.amxx running
[ 44] Map Spawns Editor 1.0.16 iG_os Map_Spawns_Edit debug
44 plugins, 44 running
- Автор плагина
- /7uBko
- Версия плагина
- 1.0
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich>
#include <extreme>
#include <colorchat>
#include <reapi>
#include <sqlx>
#define IsNotBit(%0,%1) (~(%0) & (1 << (%1)))
#define ClearBit(%0,%1) ((%0) &= ~(1 << (%1)))
#define IsBit(%0,%1) ((%0) & (1 << (%1)))
#define SetBit(%0,%1) ((%0) |= (1 << (%1)))
#define SQL_SIZE 96
#define linux_diff_player 5
#define linux_diff_weapon 4
#define m_pPlayer 41
new const QUEST_PREFIX[] = "^1[^4Quest^1] "
new const VERSION[] = "1.0"
new const INFO_MODEL[][] = { "models/jail_extreme/quest/info.mdl" }
// Quests
enum _:QUESTS_ITEMS {
QUEST_NAME[512],
QUEST_DESCRIPTION[512],
QUEST_REWARD,
QUEST_PROGRESS
}
new const g_szQuests[][QUESTS_ITEMS] = {
// Deafult quests
{ "Nothing", "Nothing", 0 },
{ "Первый и последниий", "Остаться последним зеком", 2, 1 },
{ "Безобидный", "Не бунтовать 7 игровых дней.", 4, 7},
{ "Шопоголик", "Потратить в сумме $100.000 в магазине", 3, 100000 },
{ "Опытный", "Получить звание <Свой человек>", 7, 6 },
{ "Курорт", "Вы устали, отдохните 3 часа :)", 5, 10800 },
// New quests
{ "С возвращением", "Пока вас не было,^nв тюрьму заявилась девушка.^nПознакомьтесь с ней.", 4, 1 },
{ "Сбор цветов", "Соберите 10 цветов", 9, 10 },
{ "Подарок", "Подарите Алёне цветы", 7, 1 }
}
new
g_bitInfoMarker,
g_bitUserQuestDone,
g_mUserDialogStep[MAX_PLAYERS + 1],
g_mUserQuestProgress[MAX_PLAYERS + 1]
// SQL
new
Handle:g_SqlTuple,
sqlCvar[4],
szSqlError[512],
ErrorCode
// Menus
new
g_bitMenuOpen
// Accounts
new
g_mUserID[MAX_PLAYERS + 1],
g_mUserShilings[MAX_PLAYERS + 1],
g_mUserQuest[MAX_PLAYERS + 1],
g_bitUserEnterAccount
// Origins
new
Float:fMarkerInfoOrigin[3],
Float:fMarkerGirlOrigin[3],
Float:fPlayerOrigin[3],
Float:fDistanceMarkerInfo,
Float:fDistanceMarkerGirl,
Float:g_fOrigin[3]
// Others
new
g_bitMaxPlayers
new
configfile[200]
/* --------------------------------- */
public plugin_init() {
register_plugin("Jailbreak Quest", VERSION, "/7uBko")
// Lang
register_dictionary("jb_extreme_quests.txt")
sqlCvar[0] = register_cvar("jb_sql_host", "конфиденциально.")
sqlCvar[1] = register_cvar("jb_sql_user", "конфиденциально")
sqlCvar[2] = register_cvar("jb_sql_pass", "конфиденциально")
sqlCvar[3] = register_cvar("jb_sql_database", "конфиденциально")
register_forward(FM_PlayerPreThink, "FakeMeta_ClientPreThink", false)
func_connect_sql()
register_clcmd("infot", "func_CreateInfoModel")
register_clcmd("say /ts", "func_SaveInfoModel")
register_clcmd("say /td", "func_DeleteInfoModel")
register_clcmd("zalupa", "func_GetStoreNick")
register_menucmd(register_menuid("Menu_Open_QuestsMenu"), (1 << 0 | 1 << 1 | 1 << 2 | 1 << 9), "Menu_Keys_QuestsMenu")
register_menucmd(register_menuid("Menu_Open_GirlMenu"), (1 << 0 | 1 << 1 | 1 << 2 | 1 << 9), "Menu_Keys_GirlMenu")
g_bitMaxPlayers = get_maxplayers()
new mapname[32]
get_mapname(mapname,31)
get_configsdir(configfile,199)
format(configfile,199,"%s/jb_quest/%s.infospawns.cfg",configfile,mapname)
func_SpawnInfo()
}
/* --------------------------------- */
func_connect_sql() {
new
szHost[SQL_SIZE],
szUser[SQL_SIZE],
szPassword[SQL_SIZE],
szDbName[SQL_SIZE]
get_pcvar_string(sqlCvar[0], szHost, charsmax(szHost))
get_pcvar_string(sqlCvar[1], szUser, charsmax(szUser))
get_pcvar_string(sqlCvar[2], szPassword, charsmax(szPassword))
get_pcvar_string(sqlCvar[3], szDbName, charsmax(szDbName))
g_SqlTuple = SQL_MakeDbTuple(szHost, szUser,szPassword, szDbName)
new Handle: SqlConnection = SQL_Connect(g_SqlTuple, ErrorCode, szSqlError, charsmax(szSqlError))
if( SqlConnection == Empty_Handle ) set_fail_state(szSqlError)
SQL_FreeHandle(SqlConnection)
}
public func_GetStoreNick(pPlayer) {
new bool:AccountError = false
new szName[32]; get_user_name(pPlayer, szName, charsmax(szName))
new Handle:SqlConnection = SQL_Connect(g_SqlTuple, ErrorCode, szSqlError, charsmax(szSqlError))
new szSteamID[32]; get_user_authid(pPlayer, szSteamID, charsmax(szSteamID))
new Handle:Query = SQL_PrepareQuery(SqlConnection, "SELECT `id`, `shilings`, `quest_num`, `quest_progress` FROM `users` WHERE `nick` = '%s';", szName)
if(!SQL_Execute(Query)) {
SQL_QueryError(Query, szSqlError, charsmax(szSqlError))
set_fail_state(szSqlError)
}
if( SQL_NumResults(Query) > 0 ) {
for ( new i = 1; i <= g_bitMaxPlayers; i++ ) {
if ( g_mUserID[i] == SQL_ReadResult(Query, 0) ) {
get_user_name(i, szName, charsmax(szName))
ColorChat(pPlayer, RED, "%s %L", QUEST_PREFIX, pPlayer, "JB_LANG_CHAT_QUEST_ACCOUNT_USE", szName, SQL_ReadResult(Query, 0))
AccountError = true
break
}
}
if ( !AccountError ) {
g_mUserID[pPlayer] = SQL_ReadResult(Query, 0)
g_mUserShilings[pPlayer] = SQL_ReadResult(Query, 1)
g_mUserQuest[pPlayer] = SQL_ReadResult(Query, 2)
func_set_user_quest_progress(pPlayer, SQL_ReadResult(Query, 3))
ColorChat(pPlayer, NORMAL, "%s %L", QUEST_PREFIX, pPlayer, "JB_LANG_CHAT_QUEST_ACCOUNT_ENTER", SQL_ReadResult(Query, 0))
SetBit(g_bitUserEnterAccount, pPlayer)
}
}
else ColorChat(pPlayer, NORMAL, "%s %L", QUEST_PREFIX, pPlayer, "JB_LANG_CHAT_QUEST_ACCOUNT_NOT_FOUND")
SQL_FreeHandle(Query)
SQL_FreeHandle(SqlConnection)
}
public func_SaveQuestProgress(pPlayer) {
new szSave[256]; format(szSave, charsmax(szSave), "UPDATE `users` SET `shilings` = '%d', `quest_num` = '%d', `quest_progress` = '%d' WHERE `id`='%d';", g_mUserShilings[pPlayer], g_mUserQuest[pPlayer], g_mUserQuestProgress[pPlayer], g_mUserID[pPlayer]); SQL_ThreadQuery(g_SqlTuple, "QueryHandler", szSave)
}
/* --------------------------------- */
public func_CreateInfoModel(pPlayer) {
fm_get_aiming_position(pPlayer, g_fOrigin)
static iszFuncWall = 0
if(iszFuncWall || (iszFuncWall = engfunc(EngFunc_AllocString, "func_wall"))) g_bitInfoMarker = engfunc(EngFunc_CreateNamedEntity, iszFuncWall)
set_entvar(g_bitInfoMarker, var_classname, "InfoMarker")
set_entvar(g_bitInfoMarker, var_solid, SOLID_TRIGGER)
engfunc(EngFunc_SetModel, g_bitInfoMarker, "models/jail_extreme/quest/info.mdl")
engfunc(EngFunc_SetSize, g_bitInfoMarker, Float:{-6.0, -6.0, -6.0}, Float:{6.0, 6.0, 6.0})
set_entvar(g_bitInfoMarker, var_framerate, 1.0)
set_entvar(g_bitInfoMarker, var_sequence, 0)
set_entvar(g_bitInfoMarker, var_nextthink, get_gametime() + 0.04)
fm_get_aiming_position(pPlayer, g_fOrigin)
engfunc(EngFunc_SetOrigin, g_bitInfoMarker, g_fOrigin)
engfunc(EngFunc_DropToFloor, g_bitInfoMarker)
set_entity_render(g_bitInfoMarker, kRenderFxGlowShell, 100, 100, 0, kRenderNormal, 5)
return g_bitInfoMarker
}
public func_SaveInfoModel() {
if ( file_exists(configfile) )
delete_file(configfile)
new configdir[200]
get_configsdir(configdir,199)
format(configdir,199,"%s/jb_quest",configdir)
if ( !dir_exists(configdir) )
mkdir(configdir)
new string[64]
format(string, 63, "%d %d %d",
floatround(g_fOrigin[0]),
floatround(g_fOrigin[1]),
floatround(g_fOrigin[2]))
write_file(configfile,string,-1)
}
public func_DeleteInfoModel() {
new ent = -1
while( (ent = find_ent_by_class(ent, "InfoMarker")) ) if(is_valid_ent(ent)) remove_entity(ent)
}
public func_SpawnInfo() {
new
readString[128],
trash,
Float:last_spawn[3]
read_file(configfile, 0, readString, 127, trash)
new
left[32]
argbreak(readString, left, 31,readString, 127)
last_spawn[0] = str_to_float(left)
argbreak(readString, left,31, readString, 127)
last_spawn[1] = str_to_float(left)
argbreak(readString, left, 31, readString, 127)
last_spawn[2] = str_to_float(left)
static iszFuncWall = 0
if(iszFuncWall || (iszFuncWall = engfunc(EngFunc_AllocString, "func_wall"))) g_bitInfoMarker = engfunc(EngFunc_CreateNamedEntity, iszFuncWall)
set_entvar(g_bitInfoMarker, var_classname, "InfoMarker")
set_entvar(g_bitInfoMarker, var_solid, SOLID_TRIGGER)
engfunc(EngFunc_SetModel, g_bitInfoMarker, "models/jail_extreme/quest/info.mdl")
engfunc(EngFunc_SetSize, g_bitInfoMarker, Float:{-6.0, -6.0, -6.0}, Float:{6.0, 6.0, 6.0})
set_entvar(g_bitInfoMarker, var_framerate, 1.0)
set_entvar(g_bitInfoMarker, var_sequence, 0)
set_entvar(g_bitInfoMarker, var_nextthink, get_gametime() + 0.04)
engfunc(EngFunc_SetOrigin, g_bitInfoMarker, last_spawn)
engfunc(EngFunc_DropToFloor, g_bitInfoMarker)
set_entity_render(g_bitInfoMarker, kRenderFxGlowShell, 100, 100, 0, kRenderNormal, 5)
return g_bitInfoMarker
}
/* --------------------------------- */
public func_get_user_quest_num(pPlayer)
return g_mUserQuest[pPlayer]
public func_get_user_quest_progress(pPlayer)
return g_mUserQuestProgress[pPlayer]
public func_set_user_quest_progress(pPlayer, iNum) {
new PlayersNum = get_playersnum()
if ( g_mUserQuest[pPlayer] != 7 && PlayersNum < 6 || IsBit(g_bitUserQuestDone, pPlayer) ) return PLUGIN_HANDLED
g_mUserQuestProgress[pPlayer] = iNum
if ( g_mUserQuestProgress[pPlayer] >= g_szQuests[g_mUserQuest[pPlayer]][QUEST_PROGRESS] ) {
ColorChat(pPlayer, NORMAL, "%s Вы выполнили задание: ^4%s^1.", QUEST_PREFIX, g_szQuests[g_mUserQuest[pPlayer]][QUEST_NAME])
SetBit(g_bitUserQuestDone, pPlayer)
if ( g_mUserQuest[pPlayer] == 7 ) {
g_mUserShilings[pPlayer] = g_mUserShilings[pPlayer] + g_szQuests[g_mUserQuest[pPlayer]][QUEST_REWARD]
g_mUserQuestProgress[pPlayer] = 1
g_mUserQuest[pPlayer]++
func_SaveQuestProgress(pPlayer)
}
}
return PLUGIN_CONTINUE
}
/* --------------------------------- */
public FakeMeta_ClientPreThink(id) {
get_entvar(g_bitInfoMarker, var_origin, fMarkerInfoOrigin)
get_entvar(jb_get_quest_girl(), var_origin, fMarkerGirlOrigin)
get_entvar(id, var_origin, fPlayerOrigin)
fDistanceMarkerInfo = get_distance_f(fMarkerInfoOrigin, fPlayerOrigin)
fDistanceMarkerGirl = get_distance_f(fMarkerGirlOrigin, fPlayerOrigin)
if ( fDistanceMarkerInfo < 70.0 && IsNotBit(g_bitMenuOpen, id) && is_user_alive(id) ) {
SetBit(g_bitMenuOpen, id)
return Menu_Open_QuestsMenu(id)
}
else if ( fDistanceMarkerGirl < 70.0 && IsNotBit(g_bitMenuOpen, id) && is_user_alive(id) ) {
SetBit(g_bitMenuOpen, id)
return Menu_Open_GirlMenu(id)
} else if ( fDistanceMarkerGirl > 70.0 && fDistanceMarkerInfo > 70.0 ) ClearBit(g_bitMenuOpen, id)
return PLUGIN_CONTINUE
}
/* --------------------------------- */
Menu_Open_QuestsMenu(id) {
new g_szMenu[MENU_SIZE], iKeys = (1 << 9), iLen = formatex(g_szMenu, charsmax(g_szMenu), "\r%L^n", id, "JB_LANG_MENU_QUESTS_TITLE")
if ( IsNotBit(g_bitUserEnterAccount, id) ) {
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "^n\d%L^n", id, "JB_LANG_MENU_QUEST_ACCOUNT_NOT_FOUND")
} else {
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\w[ID: \r%d\w] | RUB: \r%d^n^n", g_mUserID[id], g_mUserShilings[id])
if ( g_mUserQuest[id] == 9 ) iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rSystem: \wВы завершили все квесты!")
else if ( !g_mUserQuest[id] ) {
switch(g_mUserDialogStep[id]) {
case 1: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rSystem: \wПривет, представляю вашему^nвниманию линейку квесты^nв честь праздника <8 Марта!>.^n^n\r1. \wЧитать дальше...^n")
case 2: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rSystem: \wЗа выполнение квестов, вы будете^nполучать Donate на свой счёт^nна сайте jb.cs-777.ru^n^n\r1. \wЧитать дальше...^n")
case 3: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rSystem: \wНе вижу смысла тянуть время,^nпора приступать к их выполнению!^n^n\r1. \wПриступить к квестам!^n")
}
iKeys |= (1 << 0)
}
else {
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rКвест: \w%s^n", g_szQuests[g_mUserQuest[id]][QUEST_NAME])
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rЦель: \w%s^n", g_szQuests[g_mUserQuest[id]][QUEST_DESCRIPTION])
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rНаграда: \y%d Rub.^n", g_szQuests[g_mUserQuest[id]][QUEST_REWARD])
if ( IsBit(g_bitUserQuestDone, id) && g_mUserQuest[id] != 7 ) {
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\r1. \wЯ выполнил задание^n")
iKeys |= (1 << 0)
}
}
}
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "^n\r0. %L", id, "JB_LANG_MENU_EXIT")
return show_menu(id, iKeys, g_szMenu, -1, "Menu_Open_QuestsMenu")
}
public Menu_Keys_QuestsMenu(id, iKey) {
get_entvar(g_bitInfoMarker, var_origin, fMarkerInfoOrigin)
get_entvar(id, var_origin, fPlayerOrigin)
fDistanceMarkerInfo = get_distance_f(fMarkerInfoOrigin, fPlayerOrigin)
if ( fDistanceMarkerInfo > 70.0 ) {
ColorChat(id, RED, "%s %L", QUEST_PREFIX, id, "JB_LANG_CHAT_QUEST_DISTANCE")
return PLUGIN_HANDLED
}
switch(iKey) {
case _KEY1_: {
if ( !g_mUserQuest[id] ) {
if ( g_mUserDialogStep[id] == 3 && !g_mUserQuest[id] ) {
g_mUserQuest[id] = 1
g_mUserDialogStep[id] = 1
} else g_mUserDialogStep[id]++
}
else {
if ( IsBit(g_bitUserQuestDone, id) ) {
g_mUserShilings[id] = g_mUserShilings[id] + g_szQuests[g_mUserQuest[id]][QUEST_REWARD]
g_mUserQuest[id]++
g_mUserQuestProgress[id] = 0
func_SaveQuestProgress(id)
ClearBit(g_bitUserQuestDone, id)
}
}
}
case _KEY0_: return PLUGIN_HANDLED
}
return Menu_Open_QuestsMenu(id)
}
Menu_Open_GirlMenu(id) {
new g_szMenu[MENU_SIZE], iKeys = (1 << 0 | 1 << 9), iLen = formatex(g_szMenu, charsmax(g_szMenu), "\r%L^n^n", id, "JB_LANG_MENU_QUESTS_TITLE")
if ( g_mUserQuest[id] < 6 ) {
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rНезнакомка: \wИзвини, у меня сейчас нет^nвремени с тобой общаться.^n^n\r1. \wЛадно..^n")
} else if ( g_mUserQuest[id] == 6 ) {
switch(g_mUserDialogStep[id]) {
case 1: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rНезнакомка: \wПривет!^n^n\r1. \wПривет, что ты тут делаешь?^n")
case 2: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rНезнакомка: \wДа так, мимо проходила^nрешила заглянуть к вам^n^n\r1. \wНу ладно.. Как хоть зовут то?^n")
case 3: {
new szName[32]
get_user_name(id, szName, charsmax(szName))
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wМеня Алёна зовут, а тебя?^n^n\r1. \wА меня %s^n", szName)
}
case 4: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wПриятно познакомиться *Улыбаясь*^n^n\r1. \wТы уж это.. извини,^nу меня даже подарка для тебя нет^n")
case 5: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wДа ладно тебе, не стоит^n^n\r1. \wНее, ты подожди здесь, я мигом^n")
}
}
else if ( g_mUserQuest[id] == 8 && IsNotBit(g_bitUserQuestDone, id) ) iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wО, ты вернулся! *Улыбаясь^n^n\r1. \wГы.. *Почёсывая затылок* Я ща вернусь^n")
else if ( g_mUserQuest[id] == 8 && IsBit(g_bitUserQuestDone, id) ) {
switch(g_mUserDialogStep[id]) {
case 1: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wО, ты вернулся! *Улыбаясь*^n^n\r1. \wВот, я тут собрал тебе^nцветочков, надеюсь нравятся^n")
case 2: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wНу конечно нравятся, спасибо^nтебе большое!^n^n\r1. \wПоздравляю тебя с 8 марта!^n")
case 3: iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rSystem: \wНа этом все квесты заканчивается!")
}
} else iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "\rАлёна: \wСпасибо большое, мне очень приятно!^n^n\r1. \w*Улыбнуться*^n")
iLen += formatex(g_szMenu[iLen], charsmax(g_szMenu) - iLen, "^n\r0. %L", id, "JB_LANG_MENU_EXIT")
return show_menu(id, iKeys, g_szMenu, -1, "Menu_Open_GirlMenu")
}
public Menu_Keys_GirlMenu(id, iKey) {
get_entvar(jb_get_quest_girl(), var_origin, fMarkerGirlOrigin)
get_entvar(id, var_origin, fPlayerOrigin)
fDistanceMarkerGirl = get_distance_f(fMarkerGirlOrigin, fPlayerOrigin)
if ( fDistanceMarkerGirl > 70.0 ) {
ColorChat(id, RED, "%s %L", QUEST_PREFIX, id, "JB_LANG_CHAT_QUEST_DISTANCE")
return PLUGIN_HANDLED
}
switch(iKey) {
case _KEY1_: {
if ( g_mUserQuest[id] < 6 ) return PLUGIN_HANDLED
else if ( g_mUserQuest[id] == 6 ) {
g_mUserDialogStep[id]++
if ( g_mUserDialogStep[id] == 6 ) {
g_mUserDialogStep[id] = 0
g_mUserShilings[id] = g_mUserShilings[id] + g_szQuests[6][QUEST_REWARD]
g_mUserDialogStep[id] = 1
g_mUserQuest[id]++
func_SaveQuestProgress(id)
ClearBit(g_bitUserQuestDone, id)
}
}
else if ( g_mUserQuest[id] == 8 && IsBit(g_bitUserQuestDone, id) ) {
g_mUserDialogStep[id]++
if ( g_mUserDialogStep[id] == 4 ) {
g_mUserShilings[id] = g_mUserShilings[id] + g_szQuests[6][QUEST_REWARD]
g_mUserDialogStep[id] = 1
g_mUserQuest[id]++
g_mUserQuestProgress[id] = 0
func_SaveQuestProgress(id)
ClearBit(g_bitUserQuestDone, id)
}
}
else return PLUGIN_HANDLED
}
case _KEY0_: return PLUGIN_HANDLED
}
return Menu_Open_GirlMenu(id)
}
/* --------------------------------- */
public client_putinserver(id) {
g_mUserDialogStep[id] = 1
g_mUserID[id] = 0
set_task(1.0, "func_GetStoreNick", id)
}
public client_disconnected(id) {
if ( IsBit(g_bitUserEnterAccount, id) ) {
ClearBit(g_bitUserEnterAccount, id)
if ( IsBit(g_bitUserQuestDone, id) ) ClearBit(g_bitUserQuestDone, id)
func_SaveQuestProgress(id)
g_mUserID[id] = 0
g_mUserShilings[id] = 0
g_mUserQuest[id] = 0
}
}
public plugin_precache() {
for ( new i; i < sizeof(INFO_MODEL); i++ )
precache_model(INFO_MODEL[i])
}
public plugin_natives() {
register_native("jb_get_user_quest_num", "func_get_user_quest_num", 1)
register_native("jb_get_user_quest_progress", "func_get_user_quest_progress", 1)
register_native("jb_set_user_quest_progress", "func_set_user_quest_progress", 1)
}
/* --------------------------------- */
public QueryHandler(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
switch(FailState)
{
case -2: log_amx("[JB] Failed to connect (%d): %s", Errcode, Error);
case -1: log_amx("[JB] (%d): %s", Errcode, Error);
}
return PLUGIN_HANDLED
}
/* --------------------------------- */
stock set_entity_render(s_Ent, s_RenderFx, s_Red, s_Green, s_Blue, s_RenderMode, s_RenderAmt)
{
new Float:s_fRenderColor[3]
s_fRenderColor[0] = float(s_Red)
s_fRenderColor[1] = float(s_Green)
s_fRenderColor[2] = float(s_Blue)
set_pev(s_Ent, pev_renderfx, s_RenderFx)
set_pev(s_Ent, pev_rendercolor, s_fRenderColor)
set_pev(s_Ent, pev_rendermode, s_RenderMode)
set_pev(s_Ent, pev_renderamt, float(s_RenderAmt))
}
stock fm_get_aiming_position(pPlayer, Float:vecReturn[3]) {
new Float:vecOrigin[3], Float:vecViewOfs[3], Float:vecAngle[3], Float:vecForward[3]
get_entvar(pPlayer, var_origin, vecOrigin)
get_entvar(pPlayer, var_view_ofs, vecViewOfs)
xs_vec_add(vecOrigin, vecViewOfs, vecOrigin)
get_entvar(pPlayer, var_v_angle, vecAngle)
engfunc(EngFunc_MakeVectors, vecAngle)
global_get(glb_v_forward, vecForward)
xs_vec_mul_scalar(vecForward, 8192.0, vecForward)
xs_vec_add(vecOrigin, vecForward, vecForward)
engfunc(EngFunc_TraceLine, vecOrigin, vecForward, DONT_IGNORE_MONSTERS, pPlayer, 0)
get_tr2(0, TR_vecEndPos, vecReturn)
}
stock xs_vec_add(const Float:vec1[], const Float:vec2[], Float:out[])
{
out[0] = vec1[0] + vec2[0];
out[1] = vec1[1] + vec2[1];
out[2] = vec1[2] + vec2[2];
}
stock xs_vec_mul_scalar(const Float:vec[], Float:scalar, Float:out[])
{
out[0] = vec[0] * scalar;
out[1] = vec[1] * scalar;
out[2] = vec[2] * scalar;
}
На локальном сервере всё работает без проблем, на основном сервере - выдаёт ошибку. Код не менялся, данные для подключения тоже.
Единственная разница - локальный сервер на Windows, основном на Linux
Единственная разница - локальный сервер на Windows, основном на Linux