Скриптер
Участник
Пользователь
- Сообщения
- 458
- Реакции
- 263
- Помог
- 9 раз(а)
- Ошибка
-
Player out of range -1
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5241 (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: Jan 30 2019 07:09:07
Built from: https://github.com/alliedmodders/amxmodx/commit/2110037
Build ID: 5241:2110037
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.6.0.672-dev
Build date: 17:31:06 Jun 5 2019 (1880)
Build from: https://github.com/dreamstalker/rehlds/commit/0c8d3d7
- ReGamedll
-
ReGameDLL version: 5.9.0.356-dev
Build date: 19:37:44 Jun 20 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/9ed1945
- Версия 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
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx.so v1.9.0.5241 ini ANY
[ 2] VoiceTranscoder RUN - vtc.so v2017RC3 ini ANY
[ 3] WHBlocker RUN - whblocker.so v1.5.696 ini ANY
[ 4] Reunion RUN - reunion.so v0.1.0.133 ini Start Never
[ 5] Rechecker RUN - rechecker.so v2.5 ini ANY
[ 6] ReAuthCheck RUN - reauthcheck.so v0.1.6 ini Start Never
[ 7] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5241 pl1 ANY
[ 8] CSX RUN - csx_amxx_i386.so v1.9.0.5241 pl1 ANY
[ 9] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5241 pl1 ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5241 pl1 ANY
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5241 pl1 ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.9.0.167-dev pl1 ANY Never
[13] Engine RUN - engine_amxx_i386.so v1.9.0.5241 pl1 ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5241 pl1 ANY
14 plugins, 14 running
- Список плагинов
-
[ 1] FreshBans 1.4.0b kanagava fresh_bans.amxx running
[ 2] Admin Load 3.9.3 Dev F@nt0M admin_load.amxx running
[ 3] Slots Reservation @1 Pirates! admin_slots.amx running
[ 4] SQL MAIN INITS @1 Pirates! main_sql_inits. running
[ 5] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 6] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 7] Bonuses @1 Pirates! player_bonuses. running
[ 8] Level system @1 Pirates! level_system.am debug
[ 9] Best round and map pla @1 Pirates! best_roundnmap. running
[ 10] nightvision @1 Pirates! nightvision.amx running
[ 11] Unstick Player 1.0.2 Arkshine unstuck.amxx running
[ 12] asp @1 Pirates! autoshoot_pisto running
[ 13] Music manager 1.0.1 .cpCTRL music.amxx running
[ 14] Demorecorder @1 Pirates! demorecorder.am running
[ 15] Napalm Nade @1 MeRcyLeZZ, Pirat napalm_nades.am debug
[ 16] Menu main @1 Pirates! menu_main.amxx running
[ 17] Menu settings @1 Pirates! menu_settings.a running
[ 18] Lang manage @1 Pirates! lang_manage.amx running
[ 19] Menu vip @1 Pirates! menu_vip.amxx running
[ 20] Players Menu @1 Pirates! players_menu.am running
[ 21] Pushable push @1 Pirates! pushable_push.a running
[ 22] Block fast infect @1 Pirates! block_fast_infe running
[ 23] Remove droped weapons @1 Pirates! remove_weaponsn running
[ 24] Damager[b] @1 @Pirates! damager.amxx running
[ 25] Block & Hide money @1 Pirates! block_money.amx running
[ 26] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 27] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 28] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 29] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 30] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 31] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 32] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 33] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 34] [b] Core 0.1.2 81x08 biohazard.amxx debug
[ 35] Weapons MaxClip 0.3.0 ConnorMcLeod weapons_maxclip running
[ 36] Bio Stats @1 Pirates! bio_stats.amxx running
[ 37] Real velocity @1 Pirates! bio_real_veloci running
[ 38] Remove Objectives @1 Pirates! bio_remove_obje running
[ 39] Block touch & Use @1 Pirates! bio_block_touch running
[ 40] Informer hud @1 Pirates! bio_informer.am running
40 plugins, 40 running
- Автор плагина
- MeRcyLeZZ, Pirates!
- Версия плагина
- @1
- Исходный код
-
#include <amxmodx>
#include <reapi>
#include <engine>
#include <zmb>
#define MsgId_Damage 71
#define NapalmRadius 300
#define NapalmDuration 10
#define NapalmDamage 5.0
#define NapalmSlowDown 0.55
#define TASK_ID_BURN 2102
#define NapalmSound "weapons/hegrenade-1.wav"
enum _: spritesNum {
SpriteFlame,
SpriteSmoke,
SpriteTrail,
SpriteShockwave
};
new const napalmSprites[spritesNum][] = {
"sprites/flame.spr",
"sprites/black_smoke3.spr",
"sprites/laserbeam.spr",
"sprites/shockwave.spr"
};
new g_indexSprite[spritesNum];
public plugin_precache()
{
precache_sound(NapalmSound);
for (new i; i < sizeof napalmSprites; i++)
g_indexSprite[i] = precache_sound(napalmSprites[i]);
}
public plugin_init() {
register_plugin("Napalm Nade", "@1", "MeRcyLeZZ, Pirates!");
register_event("HLTV", "Event_Hltv", "a", "1=0", "2=0");
RegisterHookChain(RG_ThrowHeGrenade, "@CGrenade_ThrowHeGrenade_Post", true);
RegisterHookChain(RG_CGrenade_ExplodeHeGrenade, "@CGrenade_ExplodeHeGrenade_Pre", false);
}
public Event_Hltv() {
static iIndex;
for (iIndex = 1; iIndex <= MaxClients; iIndex++)
remove_task(iIndex + TASK_ID_BURN);
}
@CGrenade_ThrowHeGrenade_Post(const index, Float:vecStart[3], Float:vecVelocity[3], Float:time, const team, const usEvent) {
new entityIndex = GetHookChainReturn(ATYPE_INTEGER);
if (is_nullent(entityIndex))
return HC_CONTINUE;
rg_set_rendering(entityIndex, kRenderFxGlowShell, 155, 0, 0, kRenderNormal, 16);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMFOLLOW); // TE id
write_short(entityIndex) // entity
write_short(g_indexSprite[SpriteTrail]) // sprite
write_byte(10); // life
write_byte(10); // width
write_byte(155); // r
write_byte(0); // g
write_byte(0); // b
write_byte(200); // brightness
message_end();
return HC_CONTINUE;
}
@CGrenade_ExplodeHeGrenade_Pre(const this, tracehandle, const bitsDamageType) {
new iAttacker = get_entvar(this, var_owner);
if (!IsPlayer(iAttacker))
{
server_print("Player out of range %d", iAttacker);
return HC_CONTINUE;
}
new Float: grenadeOrigin[3];
get_entvar(this, var_origin, grenadeOrigin);
message_begin_f(MSG_PVS, SVC_TEMPENTITY, grenadeOrigin, 0);
write_byte(TE_BEAMCYLINDER); // TE id
write_coord_f(grenadeOrigin[0]); // x
write_coord_f(grenadeOrigin[1]); // y
write_coord_f(grenadeOrigin[2]); // z
write_coord_f(grenadeOrigin[0]); // x axis
write_coord_f(grenadeOrigin[1]); // y axis
write_coord_f(grenadeOrigin[2]+385.0); // z axis
write_short(g_indexSprite[SpriteShockwave]); // sprite
write_byte(0); // startframe
write_byte(0); // framerate
write_byte(4); // life
write_byte(60); // width
write_byte(0); // noise
write_byte(155); // red
write_byte(0); // green
write_byte(0); // blue
write_byte(200); // brightness
write_byte(0); // speed
message_end();
rh_emit_sound2(0, this, CHAN_WEAPON, NapalmSound, 1.0, ATTN_NORM, 0, PITCH_NORM);
for (new iIndex = 1; iIndex <= MaxClients; iIndex++)
{
if (entity_range(this, iIndex) > NapalmRadius)
continue;
if (!is_user_alive(iIndex))
continue;
if (!is_user_zombie(iIndex))
continue;
if (iAttacker == iIndex)
continue;
if (get_member(iAttacker, m_iTeam) == get_member(iIndex, m_iTeam))
continue;
message_begin(MSG_ONE_UNRELIABLE, MsgId_Damage, _, iIndex);
write_byte(0); // damage save
write_byte(0); // damage take
write_long(DMG_BURN); // damage type
write_coord(0); // x
write_coord(0); // y
write_coord(0); // z
message_end();
static burnParams[1];
burnParams[0] = NapalmDuration;
set_task(0.1, "burnPlayer", iIndex + TASK_ID_BURN, burnParams, sizeof burnParams);
}
return HC_CONTINUE;
}
public burnPlayer(burnParams[2], iIndex) {
iIndex -= TASK_ID_BURN;
if (!is_user_alive(iIndex))
return;
static Float: playerOrigin[3], playerFlags;
get_entvar(iIndex, var_origin, playerOrigin);
playerFlags = get_entvar(iIndex, var_flags);
if ((playerFlags & FL_INWATER) || burnParams[0] < 1)
{
// Smoke sprite
message_begin_f(MSG_PVS, SVC_TEMPENTITY, playerOrigin, 0);
write_byte(TE_SMOKE); // TE id
write_coord_f(playerOrigin[0]); // x
write_coord_f(playerOrigin[1]); // y
write_coord_f(playerOrigin[2]-50.0); // z
write_short(g_indexSprite[SpriteSmoke]); // sprite
write_byte(random_num(15, 20)); // scale
write_byte(random_num(10, 20)); // framerate
message_end();
return;
}
if (NapalmSlowDown > 0.0 && (playerFlags & FL_ONGROUND))
{
static Float: playerVelocity[3];
get_entvar(iIndex, var_velocity, playerVelocity);
UTIL_VecMulScalar(playerVelocity, NapalmSlowDown, playerVelocity);
set_entvar(iIndex, var_velocity, playerVelocity);
}
static Float: playerHealth;
playerHealth = get_entvar(iIndex, var_health);
if (playerHealth - NapalmDamage > 0.0)
set_entvar(iIndex, var_health, playerHealth - NapalmDamage);
message_begin_f(MSG_PVS, SVC_TEMPENTITY, playerOrigin, 0);
write_byte(TE_SPRITE); // TE id
write_coord_f(playerOrigin[0]+random_float(-5.0, 5.0)); // x
write_coord_f(playerOrigin[1]+random_float(-5.0, 5.0)); // y
write_coord_f(playerOrigin[2]+random_float(-10.0, 10.0)); // z
write_short(g_indexSprite[SpriteFlame]); // sprite
write_byte(random_num(5, 10)); // scale
write_byte(200); // brightness
message_end();
burnParams[0]--;
set_task(0.4, "burnPlayer", iIndex + TASK_ID_BURN, burnParams, sizeof burnParams);
}
stock rg_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3]
color[0] = float(r)
color[1] = float(g)
color[2] = float(b)
set_entvar(entity, var_renderfx, fx)
set_entvar(entity, var_rendercolor, color)
set_entvar(entity, var_rendermode, render)
set_entvar(entity, var_renderamt, float(amount))
}
Не получает индекс игрока бросившего гранату в функции
RG_CGrenade_ExplodeHeGrenade
. m_pPlayer и var_owner выдают одинаково -1.
В этой теме было размещено решение! Перейти к решению.