Участник
Пользователь
- Сообщения
- 47
- Реакции
- 6
- Помог
- 1 раз(а)
- Ошибка
-
После пропадания спрайта молотова если встать на то-же место, то хп все-равно снимается (это действует ещё секунд 5-10 после испарения спрайта огня).
- ОС
- Linux
- Amx Mod X
-
1.8.3-dev+5154
- Билд
-
ReHLDS version: 3.4.0.653-dev
- ReGamedll
-
ReGameDLL version: 5.7.0.309-dev
- Версия Metamod
-
Metamod v1.21p37
- Список метамодулей
-
[ 1] Reunion RUN - reunion_mm_i386. v0.1.0.9 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i v0.1.6 ini Start Never
[ 3] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-d ini Start ANY
[ 4] SafeNameAndChat RUN - SafeNameAndChat. v1.1 ini ANY ANY
[ 5] Rechecker RUN - rechecker_mm_i38 v2.5 ini Chlvl ANY
[ 6] Revoice RUN - revoice_mm_i386. v0.1.0.3 ini Start Never
[ 7] WHBlocker RUN - whblocker_mm_i38 v1.5.695 ini Chlvl ANY
[ 8] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 9] MySQL RUN - mysql_amxx_i386. v1.8.3-d pl3 ANY ANY
[10] Fun RUN - fun_amxx_i386.so v1.8.3-d pl3 ANY ANY
[11] Engine RUN - engine_amxx_i386 v1.8.3-d pl3 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-d pl3 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-d pl3 ANY ANY
[14] ReAimDetector RUN - reaimdetector_am v0.2.2 pl3 ANY Never
[15] CStrike RUN - cstrike_amxx_i38 v1.8.3-d pl3 ANY ANY
[16] CSX RUN - csx_amxx_i386.so v1.8.3-d pl3 ANY ANY
[17] ReAPI RUN - reapi_amxx_i386. v5.5.0.1 pl3 ANY Never
[18] MySQL Threads RUN - mysqlt_amxx_i386 v1.2 pl3 ANY ANY
- Список плагинов
-
[ 1] AMXBans: Core MA 1.6.9 Larte Team amxbans_core.am running
[ 2] AMXBans: Main MA 1.6.9 Larte Team amxbans_main.am running
[ 3] AIM detector 0.7.4e kanagava aim_detector.am running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] ReChecker Logging freesrv phe rc_logging.amxx running
[ 6] Admin ESP 1.5b_mini KoST admin_esp_mini. running
[ 7] Aliases checker 0.8.2 kanagava alias_detector0 running
[ 8] Admin Commands 1.8.3-dev+ AMXX Dev Team admincmd.amxx running
[ 9] Commands Menu 1.8.3-dev+ AMXX Dev Team cmdmenu.amxx running
[ 10] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 11] Players Menu 1.8.3-dev+ AMXX Dev Team plmenu.amxx running
[ 12] Admin Votes 1.8.3-dev+ AMXX Dev Team adminvote.amxx running
[ 13] Pause Plugins 1.8.3-dev+ AMXX Dev Team pausecfg.amxx running
[ 14] Menus Front-End 1.8.3-dev+ AMXX Dev Team menufront.amxx running
[ 15] Restrict Weapons 1.8.3-dev+ AMXX Dev Team restmenu.amxx running
[ 16] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr running
[ 17] StatsX 1.8.3-dev+ AMXX Dev Team statsx.amxx running
[ 18] Stats Configuration 1.8.3-dev+ AMXX Dev Team statscfg.amxx running
[ 19] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 20] Block grande info 1.0 neygomon BlockGrenadeInf running
[ 21] Gag Me 2.3.4 Radius gag_me.amxx running
[ 22] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 23] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 24] resetscore(ReAPI) 1.0 Phantom rslite.amxx running
[ 25] Lite Advert 1.0 ATSZ Dev Team LiteAdvert.amxx running
[ 26] Advanced Kill Assists 0.9 Spection kill_assist.amx running
[ 27] Show Score 1.0 ill show_CT_T.amxx running
[ 28] Yet Another Voteban 1.7 AndrewZ/voed/wop yet_another_vot running
[ 29] Warmup 1.2.2 Radius warmup.amxx stopped
[ 30] Plugins Controller 1.0 neygomon plugins_control stopped
[ 31] NameChangeTime 0.0.1 Vaqtincha antifastnick.am running
[ 32] unknown unknown unknown AmmorHat.amxx running
[ 33] GameName Changer 1.0 neugomon gamename_change running
[ 34] [DD] Quick defuse 1.0 Deadly|Darkness dd_qdefuse.amxx running
[ 35] Bomb Timer 3.2 Twe3k Bomb_DhuD.amxx running
[ 36] Kill Manager Sound 1.3 ShaTalKiN kmansound.amxx running
[ 37] Show Damage 1.0 neygomon damager.amxx running
[ 38] Lite AwpLimit 1.09 neygomon awp.amxx running
[ 39] HUD Message 1.5 neygomon hud_message.amx running
[ 40] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc running
[ 41] Remove Corpses 0.0.1 Vaqtincha remove_corpses. running
[ 42] DemoRecoder 1.1 neygomon Legend_DemorecN running
[ 43] Map Manager RU 1.2.2 Mistrick Legend_AddonMap running
[ 44] VOTEBAN yav yav Legend_VotebanV running
[ 45] unknown unknown unknown Legend_SayMeHP. running
[ 46] unknown unknown unknown Legend_SteamBon running
[ 47] Custom Models 1.3.2 neugomon Legend_CustomMo running
[ 48] [PB_VERSION] Bonus Kil pro xser Legend_KillBonu running
[ 49] Grenade_Molotov Pro xser Legend_GrenadeM running
[ 50] Gr_Jump Pro I Am LeGenD Legend_JumpBomb running
[ 51] unknown unknown unknown Legend_AddonAfk running
[ 52] DM MOD Pro Pro Legend_DmModV1. running
[ 53] V.I.P Custom Weapons 1.0.0 Vaqtincha vip_custom.amxx running
[ 54] V.I.P Custom AK-47 1.0.0 Vaqtincha custom_ak47.amx running
[ 55] V.I.P Custom AWP 1.0.0 Vaqtincha custom_awp.amxx running
[ 56] V.I.P Custom DEAGLE 1.0.0 Vaqtincha custom_deagle.a running
[ 57] V.I.P Custom KNIFE 1.0.0 Vaqtincha custom_knife.am running
[ 58] V.I.P Custom M4A1 1.0.0 Vaqtincha custom_m4a1.amx running
[ 59] AMXBans: Screens Gm 1.6 Larte Team amxbans_ssban.a running
[ 60] Advanced Experience Sy 0.4 serfreeman1337 aes_main.amxx running
[ 61] AES: Exp CSTRIKE 0.3 serfreeman1337 aes_exp_cstrike running
[ 62] AES: Informer 0.2 serfreeman1337 aes_informer.am running
[ 63] AES: Experience Editor 0.1 serfreeman1337 aes_exp_editor. running
[ 64] AES: Bonus System 0.2 serfreeman1337 aes_bonus_syste running
[ 65] AES: Bonus CSTRIKE 0.4 serfreeman1337 aes_bonus_cstri running
[ 66] AES: CSTRIKE Say Tag 0.1.1 serfreeman1337 aes_say_tag.amx running
- Автор плагина
- Legenda
- Версия плагина
- 1.0
- Исходный код
-
#include < amxmodx >
#include < fun >
#include < fakemeta_util >
#include < hamsandwich >
#define linux_diff_weapon 4
#define linux_diff_player 5
// CBasePlayerItem
#define m_pPlayer 41
#define MAX_CLIENTS 32
#define NADE_TYPE 1337
#define FLAME_CLASSNAME "ent_flame" // Класснейм огня
#define FLAME_DURATION 10.0 // Сколько будет идти горение
#define FLAME_TIMERESET 0.2 // Через сколько будет наносится урон
// Урон от огня
#define FLAME_DAMAGE random_float(1.0, 5.0)
#define GRENADE_VIEW_MODEL "models/legendINC/grenades/v_molotov.mdl"
#define GRENADE_PLAYER_MODEL "models/legendINC/grenades/p_molotov.mdl"
#define GRENADE_WORLD_MODEL "models/legendINC/grenades/w_molotov.mdl"
#define GRENADE_MODEL_BODY 0
#define GRENADE_EXPLODE_SOUND "legendINC/grenades/molotov_exp.wav"
new sgWeaponList; // < I Am LeGenD
new g_iThinkTimes[512];
new g_iszModelIndexSprite;
new g_iUserHasMolotov[MAX_CLIENTS + 1];
const Float:Push = 0.0
public plugin_init()
{
register_plugin("Grenade_Molotov", "Pro", "xser");
RegisterHam(Ham_Killed, "player", "CPlayer__Killed_Post", .Post = 1);
RegisterHam(Ham_Think, "grenade", "CGrenade__Think_Pre", .Post = 0);
RegisterHam(Ham_Think, "info_target", "CEntity__Think_Pre", .Post = 0);
RegisterHam(Ham_Item_Deploy, "weapon_hegrenade", "CGrenade__Item_Deploy_Post", .Post = 1);
register_forward(FM_SetModel, "FM_Hook_SetModel_Pre", ._post = 0);
// I Am LeGenD
sgWeaponList = get_user_msgid("WeaponList")
// debug
register_clcmd("molotov", "Command_GiveMolotov");
// I Am LeGenD
register_clcmd("legend_weapon_molotov", "Hook_Select")
}
public plugin_precache()
{
g_iszModelIndexSprite = engfunc(EngFunc_PrecacheModel, "sprites/legendINC/grenade/molotov_fire_ground.spr");
engfunc(EngFunc_PrecacheModel, GRENADE_VIEW_MODEL);
engfunc(EngFunc_PrecacheModel, GRENADE_PLAYER_MODEL);
engfunc(EngFunc_PrecacheModel, GRENADE_WORLD_MODEL);
// I Am LeGenD
precache_generic( "sprites/legend_weapon_molotov.txt" )
precache_generic( "sprites/legendINC/grenade/640molotov20.spr" )
engfunc(EngFunc_PrecacheSound, GRENADE_EXPLODE_SOUND);
}
public plugin_natives ( )
{
register_native("set_molotov", "native_give_weapon_molotov", 1)
}
public native_give_weapon_molotov( iPlayer )
{
Command_GiveMolotov(iPlayer)
}
public client_disconnect(iPlayer) g_iUserHasMolotov[iPlayer] = 0
public client_connect(iPlayer) g_iUserHasMolotov[iPlayer] = 0
// I Am LeGenD
public Hook_Select(id)
{
engclient_cmd(id, "weapon_hegrenade")
return PLUGIN_HANDLED
}
public Command_GiveMolotov(iPlayer)
{
if(!is_user_alive(iPlayer))
return PLUGIN_HANDLED;
if(user_has_weapon(iPlayer, CSW_HEGRENADE))
{
g_iUserHasMolotov[iPlayer]++;
ExecuteHamB(Ham_GiveAmmo, iPlayer, 1, "HeGrenade", 32);
emit_sound(iPlayer, CHAN_ITEM, "items/9mmclip1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}
if(CPlayer__MakeWeapon(iPlayer))
{
g_iUserHasMolotov[iPlayer]++;
emit_sound(iPlayer, CHAN_ITEM, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}
Sprite(iPlayer)
return PLUGIN_HANDLED;
}
public CPlayer__Killed_Post( iVictim ) {
g_iUserHasMolotov[ iVictim ] = 0;
Sprite1( iVictim )
}
public CGrenade__Think_Pre(iEntity)
{
if(!pev_valid(iEntity))
return HAM_IGNORED;
static Float: flDamageTime; pev(iEntity, pev_dmgtime, flDamageTime);
if(flDamageTime > get_gametime())
return HAM_IGNORED;
if(pev(iEntity, pev_flTimeStepSound) == NADE_TYPE)
{
MolotovExplode(iEntity);
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public CEntity__Think_Pre(iEntity)
{
if(!pev_valid(iEntity))
return HAM_IGNORED;
static iVictim = -1;
static Float:pos_ptr[3], Float:pos_ptd[3]
new szClassName[32], vecOrigin[3], iOwner;
pev(iEntity, pev_classname, szClassName, charsmax(szClassName));
if(equal(szClassName, FLAME_CLASSNAME))
{
pev(iEntity, pev_origin, vecOrigin);
iOwner = pev(iEntity, pev_owner);
for(new i = 0; i < 3; i++)
{
pos_ptd[i] -= pos_ptr[i]
pos_ptd[i] *= Push
}
if(g_iThinkTimes[iEntity] == floatround(FLAME_DURATION / FLAME_TIMERESET))
{
set_pev(iEntity, pev_flags, FL_KILLME);
return HAM_IGNORED;
}
while((iVictim = engfunc(EngFunc_FindEntityInSphere, iVictim, vecOrigin, 100.0)))
{
if(iOwner == iVictim || !is_user_alive(iVictim))
continue;
ExecuteHamB(Ham_TakeDamage, iVictim, iEntity, iOwner, FLAME_DAMAGE, DMG_BURN | DMG_NEVERGIB);
set_pev(iOwner, iVictim, pev_velocity, pos_ptd)
}
g_iThinkTimes[iEntity] += 1;
set_pev(iEntity, pev_nextthink, get_gametime() + FLAME_TIMERESET);
}
return HAM_IGNORED;
}
public CGrenade__Item_Deploy_Post(iEntity)
{
static iPlayer; iPlayer = get_pdata_cbase(iEntity, m_pPlayer, linux_diff_weapon);
if(!g_iUserHasMolotov[iPlayer])
return;
if( g_iUserHasMolotov[ iPlayer ] ){
Sprite(iPlayer)
}
else if(!g_iUserHasMolotov[iPlayer]){
Sprite1(iPlayer)
}
set_pev(iPlayer, pev_viewmodel2, GRENADE_VIEW_MODEL);
set_pev(iPlayer, pev_weaponmodel2, GRENADE_PLAYER_MODEL);
}
public FM_Hook_SetModel_Pre(iEntity, const szModel[])
{
if(!pev_valid(iEntity))
return FMRES_IGNORED;
static iOwner; iOwner = pev(iEntity, pev_owner);
if(equal(szModel, "models/w_hegrenade.mdl"))
{
if(g_iUserHasMolotov[iOwner])
{
engfunc(EngFunc_SetModel, iEntity, GRENADE_WORLD_MODEL);
set_pev(iEntity, pev_body, GRENADE_MODEL_BODY);
set_pev(iEntity, pev_flTimeStepSound, NADE_TYPE);
g_iUserHasMolotov[iOwner] -= 1;
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public CPlayer__MakeWeapon(iPlayer)
{
static iEntity, g_AllocString_E;
if(g_AllocString_E || (g_AllocString_E = engfunc(EngFunc_AllocString, "weapon_hegrenade")))
iEntity = engfunc(EngFunc_CreateNamedEntity, g_AllocString_E);
if(iEntity <= 0)
return 0;
g_iUserHasMolotov[iPlayer]++;
set_pev(iEntity, pev_spawnflags, SF_NORESPAWN);
ExecuteHam(Ham_Spawn, iEntity);
if(!ExecuteHamB(Ham_AddPlayerItem, iPlayer, iEntity))
{
set_pev(iEntity, pev_flags, FL_KILLME);
return 0;
}
ExecuteHamB(Ham_Item_AttachToPlayer, iEntity, iPlayer);
return iEntity;
}
MolotovExplode(iEntity)
{
static Float: vecOrigin[3];
pev(iEntity, pev_origin, vecOrigin);
emit_sound(iEntity, CHAN_WEAPON, GRENADE_EXPLODE_SOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
static iReference;
new iOwner; iOwner = pev(iEntity, pev_owner);
if(iReference || (iReference = engfunc(EngFunc_AllocString, "info_target")))
{
new iFlameEntity = engfunc(EngFunc_CreateNamedEntity, iReference);
g_iThinkTimes[iFlameEntity] = 0;
set_pev(iFlameEntity, pev_classname, FLAME_CLASSNAME);
set_pev(iFlameEntity, pev_solid, SOLID_TRIGGER);
set_pev(iFlameEntity, pev_movetype, MOVETYPE_TOSS);
set_pev(iFlameEntity, pev_effects, EF_NODRAW);
set_pev(iFlameEntity, pev_owner, iOwner);
set_pev(iFlameEntity, pev_nextthink, get_gametime() + FLAME_TIMERESET);
engfunc(EngFunc_SetModel, iFlameEntity, "models/w_ak47.mdl");
engfunc(EngFunc_SetOrigin, iFlameEntity, vecOrigin);
}
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_SPRITETRAIL);
engfunc(EngFunc_WriteCoord, vecOrigin[0]);
engfunc(EngFunc_WriteCoord, vecOrigin[1]);
engfunc(EngFunc_WriteCoord, vecOrigin[2] + 20.0);
engfunc(EngFunc_WriteCoord, vecOrigin[0]);
engfunc(EngFunc_WriteCoord, vecOrigin[1]);
engfunc(EngFunc_WriteCoord, vecOrigin[2] + 5.0);
write_short(g_iszModelIndexSprite);
write_byte(50);
write_byte(random_num(27, 30));
write_byte(random_num(4, 6));
write_byte(20);
write_byte(0);
message_end();
set_pev(iEntity, pev_flags, FL_KILLME);
}
// I Am LeGenD
public Sprite(iPlayer)
{
message_begin(MSG_ONE, sgWeaponList, {0,0,0}, iPlayer)
write_string("legend_weapon_molotov")
write_byte(12)
write_byte(1)
write_byte(-1)
write_byte(-1)
write_byte(3)
write_byte(1)
write_byte(4)
write_byte(24)
message_end()
}
public Sprite1(iPlayer)
{
message_begin(MSG_ONE, sgWeaponList, {0,0,0}, iPlayer)
write_string("weapon_hegrenade")
write_byte(12)
write_byte(1)
write_byte(-1)
write_byte(-1)
write_byte(3)
write_byte(1)
write_byte(4)
write_byte(24)
message_end()
}
Суть проблемы заключается в следующем:
После пропадания спрайта молотова если встать на то-же место, то хп все-равно снимается (это действует ещё секунд 5-10 после испарения спрайта огня).
Каким образом можно фиксануть? Может проблема в коде?
После пропадания спрайта молотова если встать на то-же место, то хп все-равно снимается (это действует ещё секунд 5-10 после испарения спрайта огня).
Каким образом можно фиксануть? Может проблема в коде?
В этой теме было размещено решение! Перейти к решению.