- Ошибка
-
Без понятия
- ОС
- Windows
- Amx Mod X
-
AMX Mod X 1.9.0.5294 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Dec 3 2021 22:52:28
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a8
Build ID: 5294:363871a8
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.6.3.7/Stdio (cstrike)
ReHLDS version: 3.12.0.782-dev
Build date: 12:19:10 Dec 07 2022 (3161)
Build from: https://github.com/dreamstalker/rehlds/commit/5e8b0ba
- ReGamedll
-
ReGameDLL version: 5.21.0.575-dev
Build date: 21:32:24 Dec 17 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/889edc8
- Версия Metamod
-
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:28 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
- Список метамодулей
-
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5294 ini Start ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] Revoice RUN - revoice_mm.dll v0.1.0.34 ini Start Never
[ 4] Fun RUN - fun_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 5] Engine RUN - engine_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 7] GeoIP RUN - geoip_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 8] CStrike RUN - cstrike_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 9] CSX RUN - csx_amxx.dll v1.9.0.5294 pl1 ANY ANY
[10] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5294 pl1 ANY ANY
- Список плагинов
-
[ 1] Admin Base 1.9.0.5294 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5294 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.9.0.5294 AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.9.0.5294 AMXX Dev Team statsx.amxx running
[ 22] [ZP] Core/Engine 5.0.8 ZP Dev Team zp50_core.amxx running
[ 23] [AMXX] Settings API 1.0 MeRcyLeZZ amx_settings_ap running
[ 24] [CS] Player Models API 1.2 WiLS cs_player_model running
[ 25] [CS] Teams API 1.2 WiLS cs_teams_api.am running
[ 26] [CS] MaxSpeed API 1.0 WiLS cs_maxspeed_api running
[ 27] [CS] Weapon Models API 1.1 WiLS cs_weap_models_ running
[ 28] [CS] Weapons Restrict 0.4 WiLS cs_weap_restric running
[ 29] [CS] Ham Hooks for Bot 1.0 WiLS cs_ham_bots_api running
[ 30] [ZP] Class: Zombie 5.0.8 ZP Dev Team zp50_class_zomb running
[ 31] [ZP] Class: Human 5.0.8 ZP Dev Team zp50_class_huma running
[ 32] [ZP] Class: Nemesis 5.0.8 ZP Dev Team zp50_class_neme running
[ 33] [ZP] Class: Assassin 5.0.8 ZP Dev Team zp50_class_assa running
[ 34] [ZP] Class: Survivor 5.0.8 ZP Dev Team zp50_class_surv running
[ 35] [ZP] Class: Sniper 5.0.8 ZP Dev Team zp50_class_snip running
[ 36] [ZP] Class: Zombie: Cl 5.0.8 ZP Dev Team zp50_class_zomb running
[ 37] [ZP] Class: Zombie: Ra 5.0.8 ZP Dev Team zp50_class_zomb running
[ 38] [ZP] Class: Zombie: Li 5.0.8 ZP Dev Team zp50_class_zomb running
[ 39] [ZP] Class: Zombie: Fa 5.0.8 ZP Dev Team zp50_class_zomb running
[ 40] [ZP] Class: Zombie: Le 5.0.8 ZP Dev Team zp50_class_zomb running
[ 41] [ZP] Class: Zombie: Ra 5.0.8 ZP Dev Team zp50_class_zomb running
[ 42] [ZP] Zombie Class: Rad 1.8 Re.Act!ve zp_zclass_oxida running
[ 43] [ZP] Class: Human: Cla 5.0.8 ZP Dev Team zp50_class_huma running
[ 44] [ZP] Human Armor 5.0.8 ZP Dev Team zp50_human_armo running
[ 45] [ZP] Game Modes Manage 5.0.8 ZP Dev Team zp50_gamemodes. running
[ 46] [ZP] Game Mode: Infect 5.0.8 ZP Dev Team zp50_gamemode_i paused
[ 47] [ZP] Game Mode: Multip 5.0.8 ZP Dev Team zp50_gamemode_m paused
[ 48] [ZP] Game Mode: Swarm 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 49] [ZP] Game Mode: Nemesi 5.0.8 ZP Dev Team zp50_gamemode_n paused
[ 50] [ZP] Game Mode: Assass 5.0.8 ZP Dev Team zp50_gamemode_a paused
[ 51] [ZP] Game Mode: Surviv 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 52] [ZP] Game Mode: sniper 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 53] [ZP] Game Mode: Plague 5.0.8 ZP Dev Team zp50_gamemode_p paused
[ 54] [ZP] Game Mode: Armage 5.0.8 ZP Dev Team zp50_gamemode_a paused
[ 55] [ZP] Items Manager 5.0.8 ZP Dev Team zp50_items.amxx running
[ 56] [ZP] Items Manager: Am 5.0.8 ZP Dev Team zp50_items_ammo running
[ 57] [ZP] Item: Weapons 5.0.8 ZP Dev Team zp50_item_weapo running
[ 58] [ZP] Item: Nightvision 5.0.8 ZP Dev Team zp50_item_night running
[ 59] [ZP] Item: Antidote 5.0.8 ZP Dev Team zp50_item_antid running
[ 60] [ZP] Item: Zombie Madn 5.0.8 ZP Dev Team zp50_item_zombi running
[ 61] [ZP] Item: Infection B 5.0.8 ZP Dev Team zp50_item_infec running
[ 62] [ZP] Admin Commands 5.0.8 ZP Dev Team zp50_admin_comm running
[ 63] [ZP] Admin Menus 5.0.8 ZP Dev Team zp50_admin_menu running
[ 64] [ZP] Admin Models 5.0.8 ZP Dev Team zp50_admin_mode running
[ 65] [ZP] Custom Buy Menus 5.0.8 ZP Dev Team zp50_buy_menus. running
[ 66] [ZP] Buyzones 5.0.8 ZP Dev Team zp50_buy_zones. running
[ 67] [ZP] Rewards: Ammo Pac 5.0.8 ZP Dev Team zp50_rewards_am running
[ 68] [ZP] Rewards: Frags & 5.0.8 ZP Dev Team zp50_rewards_fr running
[ 69] [ZP] Deathmatch 5.0.8 ZP Dev Team zp50_deathmatch running
[ 70] [ZP] Random Spawning 5.0.8 ZP Dev Team zp50_random_spa running
[ 71] [ZP] Spawn Protection 5.0.8 ZP Dev Team zp50_spawn_prot running
[ 72] [ZP] Zombie Features 5.0.8 ZP Dev Team zp50_zombie_fea running
[ 73] [ZP] Zombie Sounds 5.0.8 ZP Dev Team zp50_zombie_sou running
[ 74] [ZP] Zombie Damage 5.0.8 ZP Dev Team zp50_zombie_dam running
[ 75] [ZP] Human Unlimited A 5.0.8 ZP Dev Team zp50_human_ammo running
[ 76] [ZP] Flashlight 5.0.8 ZP Dev Team zp50_flashlight running
[ 77] [ZP] Nightvision 5.0.8 ZP Dev Team zp50_nightvisio running
[ 78] [ZP] Leap/Longjump 5.0.8 ZP Dev Team zp50_leap.amxx running
[ 79] [ZP] Pain Shock Free 5.0.8 ZP Dev Team zp50_painshockf running
[ 80] [ZP] Knockback 5.0.8 ZP Dev Team zp50_knockback. running
[ 81] [ZP] Weapon Drop/Strip 5.0.8 ZP Dev Team zp50_weapon_dro running
[ 82] [ZP] Addon: Ammo Box 1.1 | 2019 xUnicorn zp_addon_ammobo running
[ 83] [ZP] SupplyBoxes 1.0 Docaner zp_supplyboxes. running
[ 84] [ZP]Level System 6.0 Dambas zp_level_system running
[ 85] [ZP] Admin Lvl Menu 1.0 Dambas zp_level_admin_ running
[ 86] [CSDM, DM, Public] Add 1.0 MKOD cs_new_currency running
[ 87] [ZP] Addon: Display th 0.1.6 meTaLiCroSS mad_cso_round_v running
[ 88] Weapon Model + Sound R 1.3 GHW_Chronic GHW_Weapon_Repl running
[ 89] [ZP] Effects: Infect 5.0.8 ZP Dev Team zp50_effects_in running
[ 90] [ZP] Effects: Cure 5.0.8 ZP Dev Team zp50_effects_cu running
[ 91] [ZP] Effects: Lighting 5.0.8 ZP Dev Team zp50_effects_li running
[ 92] [ZP] Ambience Effects 5.0.8 ZP Dev Team zp50_ambience_e running
[ 93] [ZP] Ambience Sonds 5.0.8 ZP Dev Team zp50_ambience_s running
[ 94] [ZP] Main Menu 5.0.8 ZP Dev Team zp50_main_menu. running
[ 95] [ZP] Objective Remover 5.0.8 ZP Dev Team zp50_objective_ running
[ 96] [ZP] Gameplay Fixes 5.0.8 ZP Dev Team zp50_gameplay_f running
[ 97] [ZP] Team Scoring 5.0.8 ZP Dev Team zp50_team_scori running
[ 98] [ZP] HUD Information 5.0.8 ZP Dev Team zp50_hud_info.a running
[ 99] [ZP] Server Browser In 5.0.8 ZP Dev Team zp50_serverbrow running
[100] [ZP] Ammo Packs 5.0.8 ZP Dev Team zp50_ammopacks. running
[101] [ZP] Grenade: Fire 5.0.8 ZP Dev Team zp50_grenade_fi running
[102] [ZP] Grenade: Frost 5.0.8 ZP Dev Team zp50_grenade_fr running
[103] [ZP] Grenade: Flare 5.0.8 ZP Dev Team zp50_grenade_fl running
[104] [ZP] ZP 4.3 Subplugin 5.0.8 ZP Dev Team zp50_zp43_compa running
104 plugins, 95 running
- Автор плагина
- Dambas
- Версия плагина
- 6.0
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <zombieplague>
#include <zp_level_system>
#define is_user_valid_connected(%1) (1 <= %1 <= g_maxplayers && g_isconnected[%1])
#define is_user_valid_alive(%1) (1 <= %1 <= g_maxplayers && g_isalive[%1])
#define is_user_valid(%1) (1 <= %1 <= g_maxplayers)
//#define MYSQL_SAVE // MySQL сохранение
#define NVAULT_SAVE // Nvault сохранение
#define HUD // Показывает худ опыта
#define LUP // Screen-fade, когда обновляется уровень.
#if defined MYSQL_SAVE
#include <sqlx>
#endif
#if defined NVAULT_SAVE
#include <nvault>
#endif
//Опыт для каждого уровня 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
new const Level_Exp[51] = {1, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300, 4400, 4500, 4600, 4700, 4800, 4900, 5000}
new g_level[51], g_exp[51], g_next_exp[50], string[21], exp[3][33]
new const level_up[] = "zombie_plague/levelup.wav"
new g_maxplayers, d_exp, Float:g_PlayerDamage[33]
new pcvar_damage[10]
#if defined NVAULT_SAVE
new g_vault
#endif
#if defined MYSQL_SAVE
#define SQL_HOST "" // host name
#define SQL_USER ""
#define SQL_PASSWORD ""
#define SQL_DATABASE ""
#define SQL_TABLENAME "zp_level_system"
new Handle:MYSQL_Tuple
new Handle:MYSQL_Connect
new g_szQuery[512];
new bool: UserLoaded[33];
new UserSteamID[33][34];
#endif
public plugin_init()
{
register_plugin("[ZP]Level System", "6.0", "Dambas")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage")
register_logevent("RoundStart", 2, "1=Round_Start")
pcvar_damage[0] = register_cvar("zp_dmg_for_xp", "500") // Сколько урона надо нанести для того что бы получить 1 опыт
pcvar_damage[1] = register_cvar("zp_give_xp_for_dmg", "1") // Сколько опыта получит id за нанесенный урон
pcvar_damage[2] = register_cvar("zp_give_for_kill_nem", "10") // Сколько получит id за убийство немезиды
pcvar_damage[3] = register_cvar("zp_give_for_kill_sur", "10") // Сколько получит id за убийство выжевшего
pcvar_damage[4] = register_cvar("zp_give_for_kill_last", "10") // Сколько получит id за убийство последнего человека
pcvar_damage[5] = register_cvar("zp_give_for_kill", "5") // Сколько получит id-человек, за убийство зомби
pcvar_damage[6] = register_cvar("zp_give_zombie", "1") // Сколько получит зомби за убийство человека
pcvar_damage[7] = register_cvar("zp_give_nemesis", "1") // Сколько получит Немезида за убийство человека
pcvar_damage[8] = register_cvar("zp_give_surv", "1") // Сколько получит Выживший за убийство зомби
pcvar_damage[9] = register_cvar("zp_give_lasthum", "10") // Сколько получит Последний человек за убийство зомби
g_maxplayers = get_maxplayers()
#if defined NVAULT_SAVE
g_vault = nvault_open("zp_level_system")
#endif
}
public plugin_precache()
{
precache_sound(level_up)
}
public plugin_natives()
{
register_native("zp_level", "native_level", 1)
register_native("zp_exp", "native_exp", 1)
register_native("zp_next_level_exp", "native_zp_next_level_exp", 1)
register_native("zp_get_user_exp", "native_zp_get_user_exp", 1)
register_native("zp_set_user_exp", "native_zp_set_user_exp", 1)
}
public plugin_cfg()
{
new cfgdir[32]
get_configsdir(cfgdir, charsmax(cfgdir))
server_cmd("exec %s/zp_level_system.cfg", cfgdir)
#if defined MYSQL_SAVE
SQL_LoadDebug();
#endif
}
public client_connect(id)
{
if (is_user_bot(id))
return
#if defined NVAULT_SAVE
LoadData(id)
#endif
}
public client_putinserver(id)
{
#if defined MYSQL_SAVE
LoadData(id)
#endif
set_task(3.0, "func_change_exp", id)
}
public client_disconnect(id)
{
#if defined NVAULT_SAVE
SaveData(id)
#endif
#if defined MYSQL_SAVE
if(!UserLoaded[id])
return;
formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s` SET `lvl` = '%d', `exp` = '%d' WHERE `%s`.`SteamID` = '%s';", SQL_TABLENAME, g_level[id], g_exp[id], SQL_TABLENAME, UserSteamID[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Thread", g_szQuery)
#endif
remove_task(id)
}
public plugin_end()
{
#if defined NVAULT_SAVE
nvault_close(g_vault)
#endif
#if defined MYSQL_SAVE
if(MYSQL_Tuple)
SQL_FreeHandle(MYSQL_Tuple)
if(MYSQL_Connect)
SQL_FreeHandle(MYSQL_Connect)
#endif
}
#if defined MYSQL_SAVE
public SQL_LoadDebug()
{
new szError[512]
new iErrorCode
MYSQL_Tuple = SQL_MakeDbTuple(SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE)
MYSQL_Connect = SQL_Connect(MYSQL_Tuple, iErrorCode, szError, charsmax(szError))
if(MYSQL_Connect == Empty_Handle)
set_fail_state(szError)
if(!SQL_TableExists(MYSQL_Connect, SQL_TABLENAME))
{
new Handle:hQueries
new szQuery[512]
formatex( szQuery, charsmax(szQuery), "CREATE TABLE IF NOT EXISTS `%s` (SteamID VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_general_ci NOT NULL, lvl INT NOT NULL, exp INT NOT NULL, PRIMARY KEY (SteamID))", SQL_TABLENAME)
hQueries = SQL_PrepareQuery(MYSQL_Connect, szQuery)
if( !SQL_Execute(hQueries))
{
SQL_QueryError(hQueries, szError, charsmax(szError))
set_fail_state(szError)
}
SQL_FreeHandle(hQueries)
}
SQL_QueryAndIgnore(MYSQL_Connect, "SET NAMES utf8")
}
public SQL_Query( iState, Handle: hQuery, szError[], iErrorCode, iParams[], iParamsSize)
{
switch(iState)
{
case TQUERY_CONNECT_FAILED: log_amx("Load - Could not connect to SQL database. [%d] %s", iErrorCode, szError)
case TQUERY_QUERY_FAILED: log_amx("Load Query failed. [%d] %s", iErrorCode, szError)
}
new id = iParams[0]
UserLoaded[id] = true
if(SQL_NumResults(hQuery) < 1)
{
if(equal(UserSteamID[id], "ID_PENDING"))
return PLUGIN_HANDLED
formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO `%s` (`SteamID`, `lvl`, `exp`) VALUES ('%s', '%d', '%d');", SQL_TABLENAME, UserSteamID[id], g_level[id], g_exp[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Thread", g_szQuery)
return PLUGIN_HANDLED;
}
else
{
g_level[id] = SQL_ReadResult(hQuery, 1)
g_exp[id] = SQL_ReadResult(hQuery, 2)
}
return PLUGIN_HANDLED;
}
public LoadData(id)
{
if(!is_user_connected(id))
return;
new iParams[1]
iParams[0] = id
get_user_authid(id, UserSteamID[id], charsmax(UserSteamID[]))
formatex(g_szQuery, charsmax(g_szQuery), "SELECT * FROM `%s` WHERE (`%s`.`SteamID` = '%s')", SQL_TABLENAME, SQL_TABLENAME, UserSteamID[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Query", g_szQuery, iParams, sizeof iParams)
}
public SQL_Thread(iState, Handle: hQuery, szError[], iErrorCode, iParams[], iParamsSize)
{
if(iState == 0)
return;
log_amx("SQL Error: %d (%s)", iErrorCode, szError)
}
#endif
#if defined NVAULT_SAVE
public SaveData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s",AuthID)
format(vaultdata,255,"%i#%i#%i#",g_exp[id],g_level[id],g_next_exp[id])
nvault_set(g_vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE;
}
public LoadData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s",AuthID)
format(vaultdata,255,"%i#%i#%i#",g_exp[id],g_level[id],g_next_exp[id])
nvault_get(g_vault,vaultkey,vaultdata,255)
replace_all(vaultdata, 255, "#", " ")
new playerxp[32], playerlevel[32], playernextexp[32]
parse(vaultdata, playerxp, 31, playerlevel, 31)
g_exp[id] = str_to_num(playerxp)
g_level[id] = str_to_num(playerlevel)
g_next_exp[id] = str_to_num(playernextexp)
return PLUGIN_CONTINUE;
}
#endif
public func_change_exp (id)
{
d_exp = zp_get_user_exp(id)
exp[0][id] = d_exp
exp[1][id] = d_exp
exp[2][id] = d_exp
#if defined HUD
set_task(1.0,"change_exp",id,_,_,"b")
#endif
}
public change_exp(id)
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR && is_user_connected(id))
return PLUGIN_HANDLED
exp[1][id] = zp_get_user_exp(id)
if(exp[1][id] != exp[2][id])
{
if(exp[1][id] > exp[2][id])
{
d_exp = exp[1][id] - exp[2][id]
format(string,charsmax(string),"[+%d Опыт]", d_exp)
}
exp[2][id] = exp[1][id]
set_hudmessage(198, 209, 207, 0.57, 0.57, 0, 6.0, 3.0,_,_,4)
show_hudmessage(id, "%s", string)
}
return PLUGIN_HANDLED;
}
public fwTakeDamage(id, inflictor, attacker, Float:damage)
{
if(!is_user_connected(attacker))
return;
if(zp_get_user_zombie(attacker) || zp_get_user_survivor(attacker) || zp_get_user_nemesis(attacker))
return;
if(g_level[attacker] > Level_Exp[id])
return;
g_PlayerDamage[attacker] += damage
if(g_PlayerDamage[attacker] >= get_pcvar_float(pcvar_damage[0]))
{
g_exp[attacker] += get_pcvar_num(pcvar_damage[1])
change_exp(id)
g_PlayerDamage[attacker] -= get_pcvar_float(pcvar_damage[0])
}
check_level(attacker)
}
public fw_PlayerKilled(id, killer)
{
menu_cancel(id)
if(!is_user_alive(killer))
return;
if(g_level[killer] > Level_Exp[id])
return;
if(zp_get_user_nemesis(id))
g_exp[killer] += get_pcvar_num(pcvar_damage[2])
else if(zp_get_user_survivor(id))
g_exp[killer] += get_pcvar_num(pcvar_damage[3])
else if(zp_get_user_last_human(id))
g_exp[killer] += get_pcvar_num(pcvar_damage[4])
else if(zp_get_user_zombie(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[6])
else if(zp_get_user_nemesis(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[7])
else if(zp_get_user_survivor(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[8])
else if(zp_get_user_last_human(killer))
g_exp[killer] += get_pcvar_num(pcvar_damage[9])
else
g_exp[killer] += get_pcvar_num(pcvar_damage[5])
check_level(killer)
}
public check_level(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;
new MAX_LVL = sizeof Level_Exp - 1;
if (g_exp[id] > Level_Exp[MAX_LVL] - 1 )
return PLUGIN_HANDLED;
if( g_exp[id] >= Level_Exp[ g_level[id]])
{
if ( g_level[id] < MAX_LVL )
{
g_level[id]++
emit_sound(id, CHAN_STREAM, level_up, 1.0, ATTN_NORM, 0, PITCH_NORM)
#if defined LUP
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0, 0, 0}, id)
write_short(1 << 11)
write_short(1 << 11)
write_short(0x0001)
write_byte(255)
write_byte(255)
write_byte(0)
write_byte(110)
message_end()
#endif
ChatColor(id, "!g[ZP] !yТы достиг !g%d !yуровня.", g_level[id])
g_exp[id] = 0
}
}
return PLUGIN_HANDLED;
}
public RoundStart()
{
new players[32], num, i
get_players (players, num)
for( i=1; i < num; i++ )
{
exp[0][players[i]] = zp_get_user_exp(players[i])
}
#if defined MYSQL_SAVE
for(new id = 1; id <= 32; id++)
{
if(!is_user_connected(id))
continue;
if(!UserLoaded[id])
return;
formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s` SET `lvl` = '%d', `exp` = '%d' WHERE `%s`.`SteamID` = '%s';", SQL_TABLENAME, g_level[id], g_exp[id], SQL_TABLENAME, UserSteamID[id])
SQL_ThreadQuery(MYSQL_Tuple, "SQL_Thread", g_szQuery)
}
#endif
}
public native_level(id)
{
return g_level[id];
}
public native_exp(id)
{
return g_exp[id];
}
public native_zp_next_level_exp(id)
{
return Level_Exp[g_level[id]];
}
public native_zp_get_user_exp(id)
{
if (!is_user_valid(id))
{
log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
return -1;
}
return g_exp[id];
}
public native_zp_set_user_exp(id, amount)
{
if (!is_user_valid(id))
{
return false;
}
g_exp[id] = amount
check_level(id)
return true;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!r", "^3")
replace_all(msg, 190, "!b", "^0")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
stock bool: SQL_TableExists(Handle: hDataBase, const szTable[])
{
new Handle: hQuery = SQL_PrepareQuery(hDataBase, "SELECT * FROM information_schema.tables WHERE table_name = '%s' LIMIT 1;", szTable)
new szError[512]
if(!SQL_Execute(hQuery))
{
SQL_QueryError(hQuery, szError, charsmax(szError))
set_fail_state(szError)
}
else if( !SQL_NumResults(hQuery))
{
SQL_FreeHandle(hQuery)
return false;
}
SQL_FreeHandle(hQuery)
return true;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
Вчера кент этот плагин ставил на свой сервер и все вроде бы получилось, все сохранилось, но почему то выше 3 уровня он не сохраняет. Сегодня он мне скинул исходники и я поставил уже на свой сервер, но у меня другая проблема, уровень вообще не сохраняется.
Вложения
-
33.4 KB Просмотры: 21