Оживление игроков своей команды.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
210
Реакции
-20
Ошибка
L 12/27/2021 - 20:51:26: Start of error session.
L 12/27/2021 - 20:51:26: Info (map "de_dust2_2x2_snow") (file "addons/amxmodx/logs/error_20211227.log")
L 12/27/2021 - 20:51:26: [ReAPI] set_entvar: invalid or uninitialized entity
L 12/27/2021 - 20:51:26: [AMXX] Displaying debug trace (plugin "revive_teammates.amxx", version "1.0.0")
L 12/27/2021 - 20:51:26: [AMXX] Run time error 10: native error (native "set_entvar")
L 12/27/2021 - 20:51:26: [AMXX] [0] revive_teammates.sma::stop_revive (line 339)
L 12/27/2021 - 20:51:26: [AMXX] [1] revive_teammates.sma::CBasePlayer_PreThink (line 380)
L 12/27/2021 - 20:51:27: [ReAPI] set_entvar: invalid or uninitialized entity
L 12/27/2021 - 20:51:27: [AMXX] Displaying debug trace (plugin "revive_teammates.amxx", version "1.0.0")
L 12/27/2021 - 20:51:27: [AMXX] Run time error 10: native error (native "set_entvar")
L 12/27/2021 - 20:51:27: [AMXX] [0] revive_teammates.sma::stop_revive (line 339)
L 12/27/2021 - 20:51:27: [AMXX] [1] revive_teammates.sma::fw_CmdStart (line 213)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5294
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.767-dev-mpatch
Build date: 16:24:49 Oct 28 2021 (2756)
ReGamedll
ReGameDLL version: 5.21.0.540-dev
Build date: 17:33:16 Oct 25 2021
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Список метамодулей
[ 1] CStrike                 1.9.0.5294  AMX Mod X Dev Team   running    
[ 2] CSX 1.9.0.5294 AMX Mod X Dev Team running
[ 3] Engine 1.9.0.5294 AMX Mod X Dev Team running
[ 4] FakeMeta 1.9.0.5294 AMX Mod X Dev Team running
[ 5] Fun 1.9.0.5294 AMX Mod X Dev Team running
[ 6] GeoIP 1.9.0.5294 AMX Mod X Dev Team running
[ 7] Ham Sandwich 1.9.0.5294 AMX Mod X Dev Team running
[ 8] MySQL 1.9.0.5294 AMX Mod X Dev Team running
[ 9] nVault 1.9.0.5294 AMX Mod X Dev Team running
[10] SQLite 1.9.0.5294 AMX Mod X Dev Team running
[11] VTC AMXX API 2017 RC2 WPMG.PRoSToC0der running
[12] SxGeo 2.2 s1lent running
[13] ReAimDetector 0.2.2 ReHLDS Team running
[14] ReAPI 5.21.0.248 Asmodai & s1lent running
[15] JSON 1.9.0.5294 AMX Mod X Dev Team running
[16] RegEx 1.9.0.5294 AMX Mod X Dev Team running
[17] Sockets 1.9.0.5294 AMX Mod X Dev Team running
[18] Sockets2 1.8.1.3746 HLSW Dev Team running
18 modules, 18 correct
Список плагинов
name                    version     author            file             status   
[ 1] GameCMS_API 5.5.1 zhorzh78 gamecms.amxx running
[ 2] Revive Players 1.0.0 Emma Jule revive_teammate debug
[ 3] recoil_manager 1.0.0 fl0wer recoil_manager. running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] Advanced Client Checke 0.3.6 Mistrick cmdchecker.amxx running
[ 6] Anti Sound ESP 0.2.181 s3zy AntiSoundESP.am running
[ 7] Anticheat 3.1.6 ctr52 anticheat.amxx running
[ 8] BhopHack Detector 0.1 Mistrick bhophack.amxx running
[ 9] NightDM 1.0 Hartmann nightdm.amxx running
[ 10] FreshBans 1.4.5b kanagava fresh_bans.amxx running
[ 11] Advanced Rechecker 0.4 F@nt0M rechecker.amxx running
[ 12] [190] MapChooser RBS 20.08.02 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 13] [190] Ultimate Weapons 21.08.23BE SKAJIbnEJIb ultimate_weapon running
[ 14] [190] Ultimate Flags 20.06.06 SKAJIbnEJIb ultimate_flags. running
[ 15] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 16] Rock to Ban 1.02 Safety1st rock2ban.amxx running
[ 17] [190] Ultimate Informe 21.03.23 SKAJIbnEJIb ultimate_inform running
[ 18] [190] VIP RBS 21.08.23BE SKAJIbnEJIb vip_rbs.amxx running
[ 19] [190] Army Ranks Ultim 20.06.06 SKAJIbnEJIb army_ranks_ulti running
[ 20] [190] Ultimate Models 21.08.23BE SKAJIbnEJIb ultimate_models running
[ 21] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 22] [190] DemoRecorder RBS 20.06.06 SKAJIbnEJIb demorecorder_rb running
[ 23] [190] BackWeapons RBS 20.06.06 SKAJIbnEJIb & ho backweapons_rbs running
[ 24] [190] BonusMenu RBS 21.08.23BE SKAJIbnEJIb bonusmenu_rbs.a running
[ 25] [190] AR Pogony 20.06.06 SKAJIbnEJIb ar_pogony.amxx running
[ 26] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 27] [190] High Ping Kicker 20.06.06 SKAJIbnEJIb hpk_rbs.amxx running
[ 28] [190] AC Spectator ESP 20.06.06 SKAJIbnEJIb & Ko ac_esp.amxx running
[ 29] [190] Parachute RBS 20.08.22BE SKAJIbnEJIb & KR parachute_rbs.a running
[ 30] [190] CmdMenu RBS 20.06.06 SKAJIbnEJIb & AM cmdmenu_rbs.amx running
[ 31] [190] Kill Assist RBS 20.06.06 SKAJIbnEJIb & Di killassist_rbs. running
[ 32] [190] AfkKicker RBS 21.08.22BE SKAJIbnEJIb afkkicker_rbs.a running
[ 33] [190] Top Award RBS 20.06.06 SKAJIbnEJIb topaward_rbs.am running
[ 34] [190] Jobs RBS 21.08.23BE SKAJIbnEJIb jobs_rbs.amxx running
[ 35] [190] Chat RBS 20.10.24BE SKAJIbnEJIb chat_rbs.amxx running
[ 36] [190] AR Bets 20.06.06 SKAJIbnEJIb ar_bets.amxx running
[ 37] [190] CsStats MySQL 21.08.22BE SKAJIbnEJIb csstats_mysql.a running
[ 38] [190] Stats Configurat 20.06.06 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 39] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 40] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 41] Restrict Weapons 1.9.0.5294 AMXX Dev Team restmenu.amxx running
[ 42] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 43] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash_l running
[ 44] Autoresponder/Advertis 0.5 MaximusBrood reklama_in_chat running
[ 45] SpecList 1.5 FatalisDK+Seroff speclist.amxx running
[ 46] Reset Score 1.0 SKAJIbnEJIb reset_score.amx running
[ 47] GameCMS_Registration 1.5 zhorzh78 gamecms_registr running
[ 48] AWP Restrictions 1.5.1 Radius awp_restriction running
[ 49] [ReAPI] Healthnade 0.0.2 F@nt0M healthnade.amxx running
[ 50] Mode 2x2 2.5re s1lent mode.amxx running
[ 51] [SxGeo] Connect Info 1.0 s1lent sxgeo_connect_i running
[ 52] Style C4 Timer 3.1 OciXCrom crx_c4timer.amx running
[ 53] MOTD Model 1.1.0 fl0wer motd_model.amxx running
[ 54] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 55] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 56] Injector X 1.0 Deadly|Darkness dd_injectorX.am running
[ 57] Weapon Model + Sound R 1.2 GHW_Chronic ghw.amxx running
[ 58] Simple Grenade Trail 1.0 seroff granade_trail.a running
[ 59] Block Change Name 1.0 DJ_WEST block_change_na running
[ 60] [ReAPI] Ghost after de 0.0.2 steelzzz ghost.amxx running
[ 61] Custom Smoke 1.07 bionext custom_smoke.am running
[ 62] ScreenMaker 1.1 neygomon screenmaker.amx running
[ 63] GameName Changer 1.0 neugomon gamename_change running
[ 64] Radio Block 1.0 Mmonster radio.amxx running
[ 65] Welcom to VersuS 1.0 LavriK welcome_music.a running
[ 66] Voice Manager 1.6 Stimul voice_manager.a running
[ 67] Players Menu 1.7 neugomon players_menu.am running
67 plugins, 67 running
Автор плагина
Emma Jule
Версия плагина
1.0.0
Исходный код
// #define API					// включить API (возможности для других плагинов)
// #define MODELS // мертвецы смогут иметь уникальные модельки (может быть небольшой конфликт с вашими админ/вип моделями)

#include <amxmodx>
#include <fakemeta>
#include <reapi>

// ========================================================================== //

new const BODY_CLASSNAME[] = "player_corpse";

#define StartRevive(%1) (set_entvar(%1, var_iuser1, 1))
#define StopRevive(%1) (set_entvar(%1, var_iuser1, 0))
#define IsReviving(%1) (get_entvar(%1, var_iuser1) == 1)

#define IsValidTeam(%1) (TEAM_TERRORIST <= get_member(%1, m_iTeam) <= TEAM_CT)

new const SOUND_REVIVED[] = "weapons/c4_disarmed.wav"; // звук при завершении возрождения

#if defined MODELS
//new const MODEL_REVIVED_T[] = "vip"; // модель воскрешенного игрока Т
//new const MODEL_REVIVED_CT[] = "vip"; // модель воскрешенного игрока КТ
#endif

// ========================================================================== //

enum any:CVARS
{
ACCESS_FLAGS[64],
DURATION,
ROUND,
Float:ROUND_TIME,
PER_ROUND,
MAX_USER,
SHOOT,
Float:SPEED,
Float:DISTANCE,
Float:FLOOD,
Float:DELAY,
SPAWN,
Float:SPEED,
Float:HEALTH,
GUN[24],
COST,
PROGRESS_BAR,
BOMB,
ONE_VS_ONE,
VIP,
DIFF,
SOUND_MODE,
NOTIFICATION

}; new g_CvarValue[CVARS];

enum any:PLAYER_DATA
{
Corpse,
ReviveIndex,
ReviveCount,
Float:flDelay,
Float:flSpawnDelay

}; new g_PlayersData[MAX_PLAYERS + 1][PLAYER_DATA];

#if defined API
enum any:Forwards
{
Fw_Return,
Fw_Revive_Start,
Fw_Revived

}; new gForwards[Forwards];
#endif

// other
new iRoundPlayed, mBombPlanted/*, iFlagsBitSum*/;

public plugin_precache()
{
precache_sound(SOUND_REVIVED);

#if defined MODELS
new model_path[128];

formatex(model_path, charsmax(model_path), "models/player/%s/%s.mdl", MODEL_REVIVED_T, MODEL_REVIVED_T);
precache_model(model_path);
formatex(model_path, charsmax(model_path), "models/player/%s/%sT.mdl", MODEL_REVIVED_T, MODEL_REVIVED_T);

if (file_exists(model_path)) precache_model(model_path);

formatex(model_path, charsmax(model_path), "models/player/%s/%s.mdl", MODEL_REVIVED_CT, MODEL_REVIVED_CT);
precache_model(model_path);
formatex(model_path, charsmax(model_path), "models/player/%s/%sT.mdl", MODEL_REVIVED_CT, MODEL_REVIVED_CT);

if (file_exists(model_path)) precache_model(model_path);
#endif
}

public plugin_init()
{
register_plugin("Revive Players", "1.0.0", "Emma Jule");

register_dictionary("revive_teammates.txt");

register_message(get_user_msgid("ClCorpse"), "MsgHookClCorpse");

register_forward(FM_CmdStart, "fw_CmdStart");

RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true);
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound", false);

#if defined MODELS
RegisterHookChain(RG_CBasePlayer_SetClientUserInfoModel, "CBasePlayer_SetClientUserInfoModel", false);
#endif

CreateCvars();

#if defined API
gForwards[Fw_Revive_Start] = CreateMultiForward("rt_start_revive", ET_CONTINUE, FP_CELL, FP_CELL);
gForwards[Fw_Revived] = CreateMultiForward("rt_revived", ET_IGNORE, FP_CELL, FP_CELL);
}

public plugin_natives()
{
// register_library("ReviveTeammates");

register_native("is_user_revivng", "native_is_reviving");
}

public native_is_reviving(plugin_id, num_params)
{
// this dangerous
return is_nullent(g_PlayersData[get_param(1)][ReviveIndex]) ? false : true;
}
#else
}
#endif

public client_disconnected(id)
{
if (task_exists(id)) remove_task(id);

CorpseRemove(id);
}

public CBasePlayer_Spawn_Post(const id)
{
CorpseRemove(id);

arrayset(g_PlayersData[id], 0, PLAYER_DATA);

#if defined MODELS
rg_reset_user_model(id);
rh_update_user_info(id);
#endif
}

public CSGameRules_RestartRound()
{
iRoundPlayed = get_member_game(m_bCompleteReset) ? 0 : ++iRoundPlayed;

mBombPlanted = false;
}

public fw_CmdStart(id, uc_handle)
{
// it's checking time..

if (!is_user_alive(id))
return;

if (get_member_game(m_bRoundTerminating))
return;

if (iRoundPlayed < g_CvarValue[ROUND])
return;

if (abs(get_member_game(m_iNumTerroristWins) - get_member_game(m_iNumCTWins)) > g_CvarValue[DIFF])
return;

if (g_CvarValue[ACCESS_FLAGS] && ~get_user_flags(id) & read_flags(g_CvarValue[ACCESS_FLAGS]))
return;

if (g_CvarValue[VIP] && get_member(id, m_bIsVIP))
return;

if (g_CvarValue[BOMB] && mBombPlanted)
return;

new Float:gametime = get_gametime();

if (gametime - Float:get_member_game(m_fRoundStartTime) < g_CvarValue[ROUND_TIME])
return;

if (g_CvarValue[ONE_VS_ONE] && rg_is_1v1())
return;

if (get_member(id, m_iAccount) < g_CvarValue[COST])
return;

if (g_CvarValue[PER_ROUND] && g_PlayersData[id][ReviveCount] >= g_CvarValue[PER_ROUND])
return;

if (g_PlayersData[id][flDelay] > gametime)
return;

if (get_uc(uc_handle, UC_Buttons) & IN_USE && ~get_entvar(id, var_oldbuttons) & IN_USE && !g_PlayersData[id][ReviveIndex])
{
start_revive(id);
}
else if (get_entvar(id, var_oldbuttons) & IN_USE && ~get_uc(uc_handle, UC_Buttons) & IN_USE && g_PlayersData[id][ReviveIndex])
{
stop_revive(id);
}
}

public CBasePlayer_ResetMaxSpeed_Post(const this)
{
if (g_PlayersData[this][ReviveIndex])
{
set_entvar(this, var_maxspeed, g_CvarValue[SPEED]);
}
}

#if defined MODELS
public CBasePlayer_SetClientUserInfoModel(const id, infobuffer[], szNewModel[])
{
if (get_member(id, m_iNumSpawns) > 1)
{
new szModel[32]; copy(szModel, charsmax(szModel), get_member(id, m_iTeam) == TEAM_CT ? MODEL_REVIVED_CT : MODEL_REVIVED_T);

if (strcmp(szNewModel, szModel) != 0) SetHookChainArg(3, ATYPE_STRING, szModel);
}

return HC_CONTINUE;
}
#endif

// Bomb Featrues
public PlantBomb()
{
mBombPlanted = true;
}

start_revive(id)
{
if (g_PlayersData[id][ReviveIndex])
{
stop_revive(id);
}

new pArray[MAX_PLAYERS], pNum;

get_players(pArray, pNum, "be", get_member(id, m_iTeam) == TEAM_CT ? "CT" : "TERRORIST");

if (!pArray[0] || !pNum)
return;

new Float:flPlayerOrigin[3]; get_entvar(id, var_origin, flPlayerOrigin);

for (new i, pPlayer, pEnt, Float:flEntityOrigin[3]; i < pNum; i++)
{
pPlayer = pArray[i];

pEnt = g_PlayersData[pPlayer][Corpse];

if (is_nullent(pEnt))
continue;

if (IsReviving(pEnt))
continue;

/* ?
if (get_entvar(pEnt, var_owner) != pPlayer)
continue;
*/

get_entvar(pEnt, var_origin, flEntityOrigin);

if (vector_distance(flPlayerOrigin, flEntityOrigin) > g_CvarValue[DISTANCE])
continue;

if (g_CvarValue[DELAY])
{
if (g_PlayersData[pPlayer][flSpawnDelay] > get_gametime())
continue;
}

if (g_CvarValue[MAX_USER])
{
if (get_member(pPlayer, m_iNumSpawns) > g_CvarValue[MAX_USER])
continue;
}

#if defined API
ExecuteForward(gForwards[Fw_Revive_Start], gForwards[Fw_Return], pPlayer, id);

if (gForwards[Fw_Return] >= PLUGIN_HANDLED)
continue;
#endif

client_print(id, print_center, "%l", "RT_REVIVING", pPlayer);
client_print(pPlayer, print_center, "%l", "RT_REVIVING2", id);

StartRevive(pEnt);

g_PlayersData[id][ReviveIndex] = pEnt;

if (g_CvarValue[SPEED])
{
rg_reset_maxspeed(id);
}

if (g_CvarValue[PROGRESS_BAR])
{
rg_send_bartime(id, g_CvarValue[DURATION], bool:(g_CvarValue[PROGRESS_BAR] == 1));
}

if (!g_CvarValue[SHOOT])
{
set_member(id, m_bIsDefusing, true);
}

set_task(float(g_CvarValue[DURATION]), "respawn_friendly", id);

RequestFrame("CBasePlayer_PreThink", id);

break;
}
}

stop_revive(id)
{
if (!g_PlayersData[id][ReviveIndex])
return;

new ent = g_PlayersData[id][ReviveIndex];

StopRevive(ent);

g_PlayersData[id][ReviveIndex] = 0;
g_PlayersData[id][flDelay] = get_gametime() + g_CvarValue[FLOOD];

if (g_CvarValue[SPEED])
{
rg_reset_maxspeed(id);
}

if (g_CvarValue[PROGRESS_BAR])
{
rg_send_bartime(id, 0);
}

if (!g_CvarValue[SHOOT])
{
set_member(id, m_bIsDefusing, false);
}

// I think that mistake(
if (task_exists(id)) remove_task(id);
}

public CBasePlayer_PreThink(id)
{
if (!is_user_alive(id))
{
stop_revive(id);
}
else
{
if (!g_PlayersData[id][ReviveIndex])
return;

new Float:origin[3], Float:origin2[3];
get_entvar(id, var_origin, origin);
get_entvar(g_PlayersData[id][ReviveIndex], var_origin, origin2);

if (vector_distance(origin, origin2) > g_CvarValue[DISTANCE])
{
stop_revive(id);

client_print_color(id, print_team_red, "%l %l", "RT_PREFIX", "RT_DISTANCE_FAIL");
}
else
{
RequestFrame("CBasePlayer_PreThink", id);
}
}
}

public respawn_friendly(id)
{
new ent = g_PlayersData[id][ReviveIndex];

if (is_nullent(ent))
return;

stop_revive(id);

new player = get_entvar(ent, var_owner);

if (get_member_game(m_bRoundTerminating) || get_member(player, m_iTeam) != get_entvar(ent, var_team))
return;

// cvars gameplay checking
if (g_CvarValue[BOMB] && mBombPlanted || g_CvarValue[ONE_VS_ONE] && rg_is_1v1() || get_member(id, m_iAccount) < g_CvarValue[COST])
return;

rg_round_respawn(player);

if (g_CvarValue[SPAWN])
{
new Float:fOrigin[3]; get_entvar(ent, var_origin, fOrigin);

engfunc(EngFunc_SetOrigin, player, fOrigin);

set_entvar(player, var_flags, get_entvar(player, var_flags) | FL_DUCKING);

set_entvar(player, var_view_ofs, Float:{ 0.0, 0.0, 12.0 });
}

set_entvar(player, var_health, g_CvarValue[HEALTH]);

if (g_CvarValue[GUN][0])
{
new item = rg_give_item(player, fmt("weapon_%s", g_CvarValue[GUN]), GT_APPEND);

if (!is_nullent(item))
{
new WeaponIdType:weaponId = get_member(item, m_iId);

set_member(player, m_rgAmmo, rg_get_weapon_info(weaponId, WI_MAX_ROUNDS), rg_get_weapon_info(weaponId, WI_AMMO_TYPE));
}
}
else
{
rg_remove_all_items(player);
rg_give_default_items(player);
}

switch (g_CvarValue[NOTIFICATION])
{
case 1: client_print_color(0, id, "%l %l", "RT_PREFIX", "RT_NOTIFY_ALL", id, player);

case 2:
{
client_print_color(id, player, "%l %l", "RT_PREFIX", "RT_NOTIFY_OWNER", player);
client_print_color(player, id, "%l %l", "RT_PREFIX", "RT_NOTIFY_REVIVED", id);
}
}

switch (g_CvarValue[SOUND_MODE])
{
case 1: rh_emit_sound2(id, 0, CHAN_BODY, SOUND_REVIVED);

case 2:
{
rg_send_audio(id, SOUND_REVIVED);
rg_send_audio(player, SOUND_REVIVED);
}
}

#if defined API
ExecuteForward(gForwards[Fw_Revived], gForwards[Fw_Return], player, id);
#endif

rg_add_account(id, -g_CvarValue[COST]);

g_PlayersData[id][ReviveCount]++;

g_PlayersData[player][flSpawnDelay] = get_gametime() + g_CvarValue[DELAY];
}

public MsgHookClCorpse()
{
new ent = rg_create_entity("info_target");

if (is_nullent(ent))
return PLUGIN_CONTINUE;

new player = get_msg_arg_int(12);

if (!IsValidTeam(player))
return PLUGIN_CONTINUE;

g_PlayersData[player][Corpse] = ent;

new Float:origin[3], Float:angles[3];

get_entvar(player, var_origin, origin);
get_entvar(player, var_angles, angles);

/*
for (new i; i < 2; i++)
{
origin[i] = float(get_msg_arg_int(2 + i)) / 128.0;
angles[i] = get_msg_arg_float(5 + i);
}
*/

new model[32]; get_msg_arg_string(1, model, charsmax(model));

engfunc(EngFunc_SetModel, ent, fmt("models/player/%s/%s.mdl", model, model));
engfunc(EngFunc_SetSize, ent, Float:{ -24.0, -24.0, 0.0 }, Float:{ 24.0, 24.0, 24.0 });
engfunc(EngFunc_SetOrigin, ent, origin);
//engfunc(EngFunc_DropToFloor, ent);

set_entvar(ent, var_classname, BODY_CLASSNAME);
set_entvar(ent, var_angles, angles);
set_entvar(ent, var_body, get_msg_arg_int(10));
set_entvar(ent, var_framerate, 1.0);
set_entvar(ent, var_animtime, 0.0);
set_entvar(ent, var_sequence, get_msg_arg_int(9));
set_entvar(ent, var_owner, player);
set_entvar(ent, var_team, get_msg_arg_int(11));

StopRevive(ent);

return PLUGIN_HANDLED;
}

CreateCvars()
{
// флаг доступа
bind_pcvar_string(create_cvar("rt_access_flag", "", .description = "Флаг(и) доступа администратора (^"^" - доступно всем)"), g_CvarValue[ACCESS_FLAGS], charsmax(g_CvarValue[ACCESS_FLAGS]));

//iFlagsBitSum = read_flags(g_CvarValue[ACCESS_FLAGS]);

// время события
bind_pcvar_num(create_cvar("rt_duration", "5", .description = "Время через которое воскреснит союзник", .has_min = true, .min_val = 1.0, .has_max = true, .max_val = 10.0), g_CvarValue[DURATION]);

// ограничение по раундам
bind_pcvar_num(create_cvar("rt_round", "3", .description = "С какого раунда это будет доступно?", .has_min = true), g_CvarValue[ROUND]);

// ограничение по времени
bind_pcvar_float(create_cvar("rt_round_time", "10.0", .description = "Это будет доступно через Х сек. от начала раунда [0 - выкл]", .has_min = true, .has_max = true, .max_val = 30.0), g_CvarValue[ROUND_TIME]);

// ограничение по кол-ву
bind_pcvar_num(create_cvar("rt_per_round", "0", .description = "Максимальное кол-во раз сколько может игрок воскресить союзников за раунд [0 - бесконечно]", .has_min = true), g_CvarValue[PER_ROUND]);

// ограничение по кол-ву
bind_pcvar_num(create_cvar("rt_max_respawns", "0", .description = "Максимальное кол-во раз сколько может воскреснуть игрок за раунд [0 - бесконечно]", .has_min = true), g_CvarValue[MAX_USER]);

// запрещаем стрельбу
bind_pcvar_num(create_cvar("rt_can_shoot", "1", .description = "Могу ли я стрелять во время события", .has_min = true, .has_max = true, .max_val = 1.0), g_CvarValue[SHOOT]);

// скорость
bind_pcvar_float(create_cvar("rt_speed", "150.0", .description = "Скорость игрока во время события [0 - будет неизменной]", .has_min = true, .has_max = true, .max_val = 250.0), g_CvarValue[SPEED]);

if (g_CvarValue[SPEED]) RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "CBasePlayer_ResetMaxSpeed_Post", true);

// дистанция
bind_pcvar_float(create_cvar("rt_distance", "150.0", .description = "Максимальная допустимая дистанция", .has_min = true, .min_val = 64.0, .has_max = true, .max_val = 300.0), g_CvarValue[DISTANCE]);

// спам
bind_pcvar_float(create_cvar("rt_flood", "1.0", .description = "Через сколько могу использовать вновь (spam protect)", .has_min = true, .min_val = 0.1), g_CvarValue[FLOOD]);

// ограничение по времени
bind_pcvar_float(create_cvar("rt_delay", "15.0", .description = "Через сколько можно будет воскрешать умершего игрока", .has_min = true, .has_max = true, .max_val = 15.0), g_CvarValue[DELAY]);

// спаун-режим
bind_pcvar_num(create_cvar("rt_spawn_mode", "1", .description = "Режим возрождения^n^n0. возрождается на базе^n1. возрождается там где умер", .has_min = true, .has_max = true, .max_val = 1.0), g_CvarValue[SPAWN]);

// здоровье
bind_pcvar_float(create_cvar("rt_health", "50.0", .description = "здоровье воскрешенного игрока", .has_min = true, .min_val = 1.0, .has_max = true, .max_val = 255.0), g_CvarValue[HEALTH]);

// аммуниция
bind_pcvar_string(create_cvar("rt_weapon", "", .description = "Оружиме воскрешенного игрока (^"^" - как обычно Т - glock | CT - usp)"), g_CvarValue[GUN], charsmax(g_CvarValue[GUN]));

if (!CheckIsCvarPossible(g_CvarValue[GUN])) server_print("[Revive Teammates] Некорректно заполнен квар rt_weapon");

// стоимость
bind_pcvar_num(create_cvar("rt_cost", "0", .description = "Стоимость услуги [0 - соответственно бесплатно]", .has_min = true), g_CvarValue[COST]);

// полоска
bind_pcvar_num(create_cvar("rt_progress_bar", "1", .description = "Линия прогресса^n^n0. выкл^n1. вкл^n2. вкл (но те кто наблюдают за игроком не увидят это)", .has_min = true, .has_max = true, .max_val = 2.0), g_CvarValue[PROGRESS_BAR]);

// бомба
bind_pcvar_num(create_cvar("rt_bomb", "0", .description = "Блокируем возрождения когда бобма установленна?", .has_min = true, .has_max = true, .max_val = 1.0),g_CvarValue[BOMB]);

if (g_CvarValue[BOMB] && get_member_game(m_bMapHasBombTarget)) RegisterHookChain(RG_PlantBomb, "PlantBomb", true);

// 1 vs 1
bind_pcvar_num(create_cvar("rt_1v1", "0", .description = "Блокируем возрождения когда остались 1 vs 1?", .has_min = true, .has_max = true, .max_val = 1.0), g_CvarValue[ONE_VS_ONE]);

// VIP
bind_pcvar_num(create_cvar("rt_vip", "1", .description = "Сможет ли VIP игрок воскрешать союзников? (на as_* картах)", .has_min = true, .has_max = true, .max_val = 1.0), g_CvarValue[VIP]);

// балансер
bind_pcvar_num(create_cvar("rt_score_diff", "20", .description = "Если разница между победами команд превышает это значение, то мы блокируем воскрешения?", .has_min = true, .min_val = 3.0), g_CvarValue[DIFF]);

// звуки
bind_pcvar_num(create_cvar("rt_sounds", "1", .description = "Звуки событий (изменить их вы можете в исходном коде^n^n0. выкл^n1. через rh_emit_sound2^n2. через rg_send_audio (исключительно игроку)", .has_min = true, .has_max = true, .max_val = 2.0), g_CvarValue[SOUND_MODE]);

// уведомления
bind_pcvar_num(create_cvar("rt_notifications", "1", .description = "Уведомления..^n^n0. выкл^n1. видно всем^n2. только воскресившему игроку и тот кто воскрешал его", .has_min = true, .has_max = true, .max_val = 2.0), g_CvarValue[NOTIFICATION]);

// расположение: ..ddir/addons/amxmodx/configs/plugins/ReviveTeammates.cfg

AutoExecConfig(.name = "ReviveTeammates");
}

CorpseRemove(id)
{
new corpse = g_PlayersData[id][Corpse];

if (!is_nullent(corpse)) set_entvar(corpse, var_flags, FL_KILLME);

g_PlayersData[id][Corpse] = 0;
}

CheckIsCvarPossible(const cvar[])
{
if (!cvar[0])
return true;

// ConnorMcLeod
new const weaponEntities[][] = { "p228", "scout", "xm1014", "mac10", "aug", "elite",
"fiveseven", "ump45", "sg550", "galil", "famas", "usp", "glock18", "awp", "mp5navy",
"m249", "m3", "m4a1", "tmp", "g3sg1", "deagle", "sg552", "ak47", "p90" };

for (new i; i < sizeof(weaponEntities); i++)
if (strcmp(weaponEntities[i], cvar) == 0)
return true;

return false;
}

stock bool:rg_is_1v1()
{
new alive_t, alive_ct; rg_initialize_player_counts(alive_t, alive_ct);

return bool:(alive_t == 1 && alive_ct == 1);
}
Всем привет, в общем периодически проблема в логах вылазит, не подскажите как исправить?
 
В этой теме было размещено решение! Перейти к решению.

Вложения

Сообщения
500
Реакции
110
Помог
16 раз(а)
Старая версия плагина,автор выкладывал поновее
 
Сообщения
94
Реакции
11
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Сообщения
210
Реакции
-20
Скинул он мне исходник. Сейчас при новом исходнике компиляция не проходит, пишет ошибку, Помогите разобратся. Исходник и скрин прикладываю.

error 017: undefined symbol "rg_spawn_random_gibs"
 

Download all Attachments

Сообщения
1,275
Реакции
2,257
Помог
57 раз(а)
koly, упоминание этого натива в коде можно просто закомментировать. фичи разлёта ошмётков не будет, но зато скомпилируется
 
Сообщения
210
Реакции
-20
@ham63,Спасибо большое всем, я проблему решил, обратился к автору он скинул мне обновлённый исходник, сейчас нет проблем. Ещё раз всем спасибо и всех с наступившими праздниками.
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу