Помощь Хил гараната ошибка

s1ngle71rus

Участник
Сообщения
145
Симпатии
1
Баллы
79
#1
Привет , подскажите , что нужно исправить, в консоле выдает ошибку постоянно
L 04/25/2018 - 15:53:49: [AMXX] Run time error 3 (plugin "Smoke_HealthNade.amxx") - debug not enabled!
L 04/25/2018 - 15:53:49: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
WARNING: datagram overflowed for -_V@NEK_-
Дебаг я писал в плагинс ини не помогает. Что то в самом плагине не то наверное
/**
* Credits: Arkshine, [Ссылка]
*
*/

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <fun>
#include <csx>

/* Settings */
/* Enable action only for the privileged */
#define ACCESS_FLAGS ( ADMIN_LEVEL_H )
/* Enable action only for teammates */
#define ONLY_FOR_TEAMMATES

const HEALTH_TO_HEAL = 100;
const HEALTH_MAX = 100;
const HEAL_RADIUS = 250;

new const MODEL_V[] = "models/v_he_mk_nade.mdl";
new const MODEL_P[] = "models/p_he_mk_nade.mdl";
new const MODEL_W[] = "models/w_he_mk_nade.mdl";

new const SPRITE_EXPLODE1[] = "sprites/heal_explode.spr";
new const SPRITE_PROS[] = "sprites/heal_shape.spr";

new const SOUND_HEAL[] = "woomen_expr.wav";
/* End of settings */

#if !defined MaxClients
const MaxClients = 32;
#endif

enum {
XO_WEAPON = 4,
XO_CGRENADE = 5,
m_pPlayer = 41,
m_usEvent = 114
}

new const EXCLASS[] = "grenade";

enum { STATUSICON_HIDE = 0, STATUSICON_FLASH = 2 };

const flagSmokeEvent = (1 << 1);

#define IsSgGrenade(%1) (get_pdata_int(%1, m_usEvent, XO_CGRENADE) & flagSmokeEvent)

#define _GetEntOwner(%1) pev(%1, pev_owner)
#define _GetEntOrigin(%1,%2) pev(%1, pev_origin, %2)

#define _SetViewModel(%1,%2) set_pev(%1, pev_viewmodel2, %2)
#define _SetWorldModel(%1,%2) set_pev(%1, pev_weaponmodel2, %2)

new g_MsgId_StatusIcon, g_MsgId_ScreenFade;

new g_pFirstExplosion,
g_pPros,
g_pCircle;

new const VERSION[] = "0.0.2";

public plugin_init() {
register_plugin("Smoke: HealthNade", VERSION, "wopox1337");

g_MsgId_StatusIcon = get_user_msgid("StatusIcon");
g_MsgId_ScreenFade = get_user_msgid("ScreenFade");

register_touch(EXCLASS, "*", "CGrenade_ExplodeTouch");

register_event("CurWeapon", "Event_CurWeapon", "be", "1=1");
}

public plugin_precache() {
precache_model(MODEL_V);
precache_model(MODEL_P);
precache_model(MODEL_W);

g_pFirstExplosion = precache_model(SPRITE_EXPLODE1);
g_pPros = precache_model(SPRITE_PROS);
g_pCircle = precache_model("sprites/shockwave.spr");

precache_sound(SOUND_HEAL);
}

public Event_CurWeapon(pPlayer) {
enum { WeaponID = 2 };
if(read_data(WeaponID) == CSW_SMOKEGRENADE) {

#if defined ACCESS_FLAGS
if(!IsUserHaveAccessToUse(pPlayer)) return;
#endif

OnPlayer_SetViewModels(pPlayer);
Send_StatusIcon__Cross(pPlayer);
}
else Send_StatusIcon__Cross(pPlayer, .status = STATUSICON_HIDE);
}

public grenade_throw(pPlayer, pEnt, w_id) {
if(w_id != CSW_SMOKEGRENADE)
return;

#if defined ACCESS_FLAGS
if(!IsUserHaveAccessToUse(pPlayer)) return;
#endif

OnGrenade_SetWorldModel(pEnt);
}

public CGrenade_ExplodeTouch(const pEnt, const pOther) {
// Filter to another grenades type
if(!IsSgGrenade(pEnt))
return;

static iOwner; iOwner = _GetEntOwner(pEnt);

#if defined ACCESS_FLAGS
if(!IsUserHaveAccessToUse(iOwner)) return;
#endif

static Float: fOrigin[3], iOrigin[3];
_GetEntOrigin(pEnt, fOrigin);
FVecIVec(fOrigin, iOrigin);

// Show visuals
Send_Explode(iOrigin);
Send_Pros(iOrigin);
Send_ShockWave(iOrigin);
OnGrenade_PlaySound(pEnt);

// Action on near players
HealPlayersOnRadius(iOwner, fOrigin);

// Removed default smoke entity, and his detonate event accordingly
OnGrenade_RemoveByTouch(pEnt);
}

stock HealPlayersOnRadius(pInflictor, Float: fOrigin[3]) {
for(new pPlayer; pPlayer <= MaxClients; pPlayer++) {
if(is_user_alive(pPlayer)) {

#if !defined ONLY_FOR_TEAMMATES
if(get_user_team(pInflictor) != get_user_team(pPlayer))
continue;
#endif
#pragma unused pInflictor

static Float: playerOrigin[3];
_GetEntOrigin(pPlayer, playerOrigin);

if(get_distance_f(fOrigin, playerOrigin) < HEAL_RADIUS)
OnPlayer_HealEvent(pPlayer);
}
}
}

stock OnPlayer_HealEvent(const pPlayer) {
set_user_health(pPlayer, min(get_user_health(pPlayer) + HEALTH_TO_HEAL, HEALTH_MAX));
__UTIL_ScreenFade(pPlayer);
}

stock OnPlayer_SetViewModels(const pPlayer) {
_SetViewModel(pPlayer, MODEL_V);
_SetWorldModel(pPlayer, MODEL_P);
}

stock OnGrenade_SetWorldModel(const pEnt)
engfunc(EngFunc_SetModel, pEnt, MODEL_W);

stock OnGrenade_RemoveByTouch(const pEnt)
engfunc(EngFunc_RemoveEntity, pEnt);

stock Send_StatusIcon__Cross(const pPlayer, status = STATUSICON_FLASH) {
emessage_begin(MSG_ONE_UNRELIABLE, g_MsgId_StatusIcon, .player = pPlayer);
ewrite_byte(status);
ewrite_string("cross");
ewrite_byte(0);
ewrite_byte(255);
ewrite_byte(0);
emessage_end();
}

stock OnGrenade_PlaySound(const pEnt)
engfunc(EngFunc_EmitSound, pEnt, CHAN_WEAPON, SOUND_HEAL, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);


stock Send_Explode(iOrigin[3]) {
emessage_begin(MSG_BROADCAST, SVC_TEMPENTITY);
ewrite_byte(TE_EXPLOSION);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + 65);
ewrite_short(g_pFirstExplosion);
ewrite_byte(30);
ewrite_byte(20);
ewrite_byte(TE_EXPLFLAG_NOSOUND | TE_EXPLFLAG_NOPARTICLES);
emessage_end();
}

stock Send_Pros(iOrigin[3]) {
emessage_begin(MSG_BROADCAST, SVC_TEMPENTITY);
ewrite_byte(TE_SPRITETRAIL);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + 20);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + 80);
ewrite_short(g_pPros);
ewrite_byte(20);
ewrite_byte(20);
ewrite_byte(4);
ewrite_byte(20);
ewrite_byte(10);
emessage_end();
}

stock Send_ShockWave(iOrigin[3]) {
emessage_begin(MSG_ALL, SVC_TEMPENTITY, {0,0,0});
ewrite_byte(TE_BEAMCYLINDER);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2]);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + HEAL_RADIUS);
ewrite_short(g_pCircle);
ewrite_byte(0);
ewrite_byte(1);
ewrite_byte(5);
ewrite_byte(30);
ewrite_byte(1);
ewrite_byte(10);
ewrite_byte(255);
ewrite_byte(40);
ewrite_byte(255);
ewrite_byte(5);
emessage_end();
}

stock __UTIL_ScreenFade(const pPlayer, iColor[3] = {170, 255, 0}, iAlpha = 80, Float: flFxTime = 1.0, Float: flHoldTime = 0.3) {
const FFADE_IN = 0x0000;

emessage_begin(MSG_ONE_UNRELIABLE, g_MsgId_ScreenFade, .player = pPlayer);
ewrite_short(FixedUnsigned16(flFxTime));
ewrite_short(FixedUnsigned16(flHoldTime));
ewrite_short(FFADE_IN);
ewrite_byte(iColor[0]);
ewrite_byte(iColor[1]);
ewrite_byte(iColor[2]);
ewrite_byte(iAlpha);
emessage_end();
}

stock FixedUnsigned16(Float:flValue, iScale = (1 << 12)) {
return clamp(floatround(flValue * iScale), 0, 0xFFFF);
}

stock IsUserHaveAccessToUse(const pPlayer) {
// Anytime we can add other checks, like cached bool
return (get_user_flags(pPlayer) & ACCESS_FLAGS);
}

stock IsAllowedToUse() {
return true;
}
 

wantip22

Участник
Сообщения
330
Симпатии
38
Баллы
104
#4
debug плагину
 

Romanov K

Участник
Сообщения
33
Симпатии
1
Баллы
64
#6
Привет , подскажите , что нужно исправить, в консоле выдает ошибку постоянно
L 04/25/2018 - 15:53:49: [AMXX] Run time error 3 (plugin "Smoke_HealthNade.amxx") - debug not enabled!
L 04/25/2018 - 15:53:49: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
WARNING: datagram overflowed for -_V@NEK_-
Дебаг я писал в плагинс ини не помогает. Что то в самом плагине не то наверное
/**
* Credits: Arkshine, [Ссылка]
*
*/

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <fun>
#include <csx>

/* Settings */
/* Enable action only for the privileged */
#define ACCESS_FLAGS ( ADMIN_LEVEL_H )
/* Enable action only for teammates */
#define ONLY_FOR_TEAMMATES

const HEALTH_TO_HEAL = 100;
const HEALTH_MAX = 100;
const HEAL_RADIUS = 250;

new const MODEL_V[] = "models/v_he_mk_nade.mdl";
new const MODEL_P[] = "models/p_he_mk_nade.mdl";
new const MODEL_W[] = "models/w_he_mk_nade.mdl";

new const SPRITE_EXPLODE1[] = "sprites/heal_explode.spr";
new const SPRITE_PROS[] = "sprites/heal_shape.spr";

new const SOUND_HEAL[] = "woomen_expr.wav";
/* End of settings */

#if !defined MaxClients
const MaxClients = 32;
#endif

enum {
XO_WEAPON = 4,
XO_CGRENADE = 5,
m_pPlayer = 41,
m_usEvent = 114
}

new const EXCLASS[] = "grenade";

enum { STATUSICON_HIDE = 0, STATUSICON_FLASH = 2 };

const flagSmokeEvent = (1 << 1);

#define IsSgGrenade(%1) (get_pdata_int(%1, m_usEvent, XO_CGRENADE) & flagSmokeEvent)

#define _GetEntOwner(%1) pev(%1, pev_owner)
#define _GetEntOrigin(%1,%2) pev(%1, pev_origin, %2)

#define _SetViewModel(%1,%2) set_pev(%1, pev_viewmodel2, %2)
#define _SetWorldModel(%1,%2) set_pev(%1, pev_weaponmodel2, %2)

new g_MsgId_StatusIcon, g_MsgId_ScreenFade;

new g_pFirstExplosion,
g_pPros,
g_pCircle;

new const VERSION[] = "0.0.2";

public plugin_init() {
register_plugin("Smoke: HealthNade", VERSION, "wopox1337");

g_MsgId_StatusIcon = get_user_msgid("StatusIcon");
g_MsgId_ScreenFade = get_user_msgid("ScreenFade");

register_touch(EXCLASS, "*", "CGrenade_ExplodeTouch");

register_event("CurWeapon", "Event_CurWeapon", "be", "1=1");
}

public plugin_precache() {
precache_model(MODEL_V);
precache_model(MODEL_P);
precache_model(MODEL_W);

g_pFirstExplosion = precache_model(SPRITE_EXPLODE1);
g_pPros = precache_model(SPRITE_PROS);
g_pCircle = precache_model("sprites/shockwave.spr");

precache_sound(SOUND_HEAL);
}

public Event_CurWeapon(pPlayer) {
enum { WeaponID = 2 };
if(read_data(WeaponID) == CSW_SMOKEGRENADE) {

#if defined ACCESS_FLAGS
if(!IsUserHaveAccessToUse(pPlayer)) return;
#endif

OnPlayer_SetViewModels(pPlayer);
Send_StatusIcon__Cross(pPlayer);
}
else Send_StatusIcon__Cross(pPlayer, .status = STATUSICON_HIDE);
}

public grenade_throw(pPlayer, pEnt, w_id) {
if(w_id != CSW_SMOKEGRENADE)
return;

#if defined ACCESS_FLAGS
if(!IsUserHaveAccessToUse(pPlayer)) return;
#endif

OnGrenade_SetWorldModel(pEnt);
}

public CGrenade_ExplodeTouch(const pEnt, const pOther) {
// Filter to another grenades type
if(!IsSgGrenade(pEnt))
return;

static iOwner; iOwner = _GetEntOwner(pEnt);

#if defined ACCESS_FLAGS
if(!IsUserHaveAccessToUse(iOwner)) return;
#endif

static Float: fOrigin[3], iOrigin[3];
_GetEntOrigin(pEnt, fOrigin);
FVecIVec(fOrigin, iOrigin);

// Show visuals
Send_Explode(iOrigin);
Send_Pros(iOrigin);
Send_ShockWave(iOrigin);
OnGrenade_PlaySound(pEnt);

// Action on near players
HealPlayersOnRadius(iOwner, fOrigin);

// Removed default smoke entity, and his detonate event accordingly
OnGrenade_RemoveByTouch(pEnt);
}

stock HealPlayersOnRadius(pInflictor, Float: fOrigin[3]) {
for(new pPlayer; pPlayer <= MaxClients; pPlayer++) {
if(is_user_alive(pPlayer)) {

#if !defined ONLY_FOR_TEAMMATES
if(get_user_team(pInflictor) != get_user_team(pPlayer))
continue;
#endif
#pragma unused pInflictor

static Float: playerOrigin[3];
_GetEntOrigin(pPlayer, playerOrigin);

if(get_distance_f(fOrigin, playerOrigin) < HEAL_RADIUS)
OnPlayer_HealEvent(pPlayer);
}
}
}

stock OnPlayer_HealEvent(const pPlayer) {
set_user_health(pPlayer, min(get_user_health(pPlayer) + HEALTH_TO_HEAL, HEALTH_MAX));
__UTIL_ScreenFade(pPlayer);
}

stock OnPlayer_SetViewModels(const pPlayer) {
_SetViewModel(pPlayer, MODEL_V);
_SetWorldModel(pPlayer, MODEL_P);
}

stock OnGrenade_SetWorldModel(const pEnt)
engfunc(EngFunc_SetModel, pEnt, MODEL_W);

stock OnGrenade_RemoveByTouch(const pEnt)
engfunc(EngFunc_RemoveEntity, pEnt);

stock Send_StatusIcon__Cross(const pPlayer, status = STATUSICON_FLASH) {
emessage_begin(MSG_ONE_UNRELIABLE, g_MsgId_StatusIcon, .player = pPlayer);
ewrite_byte(status);
ewrite_string("cross");
ewrite_byte(0);
ewrite_byte(255);
ewrite_byte(0);
emessage_end();
}

stock OnGrenade_PlaySound(const pEnt)
engfunc(EngFunc_EmitSound, pEnt, CHAN_WEAPON, SOUND_HEAL, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);


stock Send_Explode(iOrigin[3]) {
emessage_begin(MSG_BROADCAST, SVC_TEMPENTITY);
ewrite_byte(TE_EXPLOSION);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + 65);
ewrite_short(g_pFirstExplosion);
ewrite_byte(30);
ewrite_byte(20);
ewrite_byte(TE_EXPLFLAG_NOSOUND | TE_EXPLFLAG_NOPARTICLES);
emessage_end();
}

stock Send_Pros(iOrigin[3]) {
emessage_begin(MSG_BROADCAST, SVC_TEMPENTITY);
ewrite_byte(TE_SPRITETRAIL);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + 20);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + 80);
ewrite_short(g_pPros);
ewrite_byte(20);
ewrite_byte(20);
ewrite_byte(4);
ewrite_byte(20);
ewrite_byte(10);
emessage_end();
}

stock Send_ShockWave(iOrigin[3]) {
emessage_begin(MSG_ALL, SVC_TEMPENTITY, {0,0,0});
ewrite_byte(TE_BEAMCYLINDER);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2]);
ewrite_coord(iOrigin[0]);
ewrite_coord(iOrigin[1]);
ewrite_coord(iOrigin[2] + HEAL_RADIUS);
ewrite_short(g_pCircle);
ewrite_byte(0);
ewrite_byte(1);
ewrite_byte(5);
ewrite_byte(30);
ewrite_byte(1);
ewrite_byte(10);
ewrite_byte(255);
ewrite_byte(40);
ewrite_byte(255);
ewrite_byte(5);
emessage_end();
}

stock __UTIL_ScreenFade(const pPlayer, iColor[3] = {170, 255, 0}, iAlpha = 80, Float: flFxTime = 1.0, Float: flHoldTime = 0.3) {
const FFADE_IN = 0x0000;

emessage_begin(MSG_ONE_UNRELIABLE, g_MsgId_ScreenFade, .player = pPlayer);
ewrite_short(FixedUnsigned16(flFxTime));
ewrite_short(FixedUnsigned16(flHoldTime));
ewrite_short(FFADE_IN);
ewrite_byte(iColor[0]);
ewrite_byte(iColor[1]);
ewrite_byte(iColor[2]);
ewrite_byte(iAlpha);
emessage_end();
}

stock FixedUnsigned16(Float:flValue, iScale = (1 << 12)) {
return clamp(floatround(flValue * iScale), 0, 0xFFFF);
}

stock IsUserHaveAccessToUse(const pPlayer) {
// Anytime we can add other checks, like cached bool
return (get_user_flags(pPlayer) & ACCESS_FLAGS);
}

stock IsAllowedToUse() {
return true;
}
 

wantip22

Участник
Сообщения
330
Симпатии
38
Баллы
104
#7
Можно же другую скачать и не мучатся с данным плагином.
 

Romanov K

Участник
Сообщения
33
Симпатии
1
Баллы
64
#10
+

Спс работает только как сделать , чтобы только у випов она была?
Уровень скриптинга у меня - чайник мира, любитель. Нужно добавлять проверку на флаг. Обращайтесь к скриптерам, или может кто еще подскажет))
 

wantip22

Участник
Сообщения
330
Симпатии
38
Баллы
104
#11
Проверку на флаг доступа и всё.
 

s1ngle71rus

Участник
Сообщения
145
Симпатии
1
Баллы
79
#12
Проверку на флаг доступа и всё.
где именно подскажи плиз
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <engine>

#define GIVE_HEALTH 100 //Сколько ХП восстанавливать
#define EXPLODE_TIME 0.5 //Через сколько секунд взорвется граната
#define HEAL_RADIUS 250.0 //Радиус
#define GENERAL_EXPLODE //Включить основной спрайт взрыва
#define TWO_EXPLODE //включить дополнительные осколки от взрыва
#define SHOKWAVE //Включить Shokwave вокруг гранаты при взрыве
//#define SCREENFADE //Включить скринфейд
#define STATUSICON //показывать иконку
#define TOUCH_EXPLODE //Взрываться ли сразу при соприкосновении с обьектами

//-------------------------------------
#define V_MODEL "models/v_he_mk_nade.mdl"
#define P_MODEL "models/p_he_mk_nade.mdl"
#define W_MODEL "models/w_he_mk_nade.mdl"

#if defined GENERAL_EXPLODE
#define EXPLODE_SPRITE "sprites/heal_explode.spr"
#endif

#if defined TWO_EXPLODE
#define EXPLODE_SPRITE2 "sprites/heal_shape.spr"
#endif

#define HEAL_SOUND "woomen_expr.wav"
//--------------------------------------

#if defined GENERAL_EXPLODE
new ExplSpr;
#endif

#if defined TWO_EXPLODE
new ExplSpr2;
#endif

#if defined SHOKWAVE
new g_iSpriteCircle;
#endif

#if defined STATUSICON
new g_IconStatus;
#endif

new const g_sound_explosion[] = "weapons/sg_explode.wav";
new const g_classname_grenade[] = "grenade";
new g_eventid_createsmoke;

public plugin_init()
{
register_plugin("Nade Health", "1.2", "medusa");

#if defined STATUSICON
g_IconStatus = get_user_msgid("StatusIcon");
#endif

register_forward(FM_EmitSound, "FMForward_EmitSound");
register_forward(FM_PlaybackEvent, "FMForward_PlaybackEvent");
register_event("CurWeapon", "EVCurWeapon", "be", "1=1");
register_forward(FM_SetModel, "FMForward_SetModel", 1);

register_think("grenade", "FMForward_Think" )

#if defined TOUCH_EXPLODE
register_touch("grenade", "*", "FMForward_Touch")
#endif
g_eventid_createsmoke = engfunc(EngFunc_PrecacheEvent, 1, "events/createsmoke.sc");
}

public plugin_precache()
{
#if defined GENERAL_EXPLODE
ExplSpr = precache_model(EXPLODE_SPRITE);
#endif

#if defined TWO_EXPLODE
ExplSpr2 = precache_model(EXPLODE_SPRITE2);
#endif

precache_model(V_MODEL);
precache_model(W_MODEL);
precache_model(P_MODEL);

precache_sound(HEAL_SOUND);

#if defined SHOKWAVE
g_iSpriteCircle = precache_model("sprites/shockwave.spr");
#endif
}

public EVCurWeapon(id)
{
if(is_user_connected(id) && is_user_alive(id))
{
if(get_user_weapon(id) == CSW_SMOKEGRENADE)
{
set_pev(id, pev_viewmodel2, V_MODEL);
set_pev(id, pev_weaponmodel2, P_MODEL);

#if defined STATUSICON
message_begin(MSG_ONE_UNRELIABLE, g_IconStatus, {0,0,0}, id);
write_byte(2)
write_string("cross");
write_byte(0);
write_byte(255);
write_byte(0);
message_end();
#endif
}
#if defined STATUSICON
else
{
message_begin(MSG_ONE_UNRELIABLE, g_IconStatus, {0,0,0}, id);
write_byte(0)
write_string("cross");
message_end();
}
#endif
}
}

public FMForward_SetModel(entity, const model[])
{
if(!pev_valid(entity)) return FMRES_IGNORED;

if(equal(model, "models/w_smokegrenade.mdl"))
{
engfunc(EngFunc_SetModel, entity, W_MODEL);
set_pev(entity, pev_dmgtime, get_gametime() + EXPLODE_TIME);
}
return FMRES_IGNORED;
}

#if defined TOUCH_EXPLODE
public FMForward_Touch(entity)
{
if(~get_pdata_int(entity, 114) & (1<<1))
return;

set_pev(entity, pev_dmgtime, get_gametime());
}
#endif


public FMForward_Think(entity)
{
if(get_pdata_int(entity, 114) & (1<<1))
set_pev( entity, pev_flags, FL_ONGROUND )
}


public FMForward_EmitSound(entity, channel, const sound[])
{
if (!equal(sound, g_sound_explosion) || !is_grenade(entity))
return FMRES_IGNORED;

static Float:eek:rigin[3];
static id; id = pev(entity, pev_owner);
pev(entity, pev_origin, origin);
engfunc(EngFunc_EmitSound, entity, CHAN_WEAPON, HEAL_SOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

#if defined GENERAL_EXPLODE
message_begin(MSG_PVS,SVC_TEMPENTITY,{0,0,0});
write_byte(TE_EXPLOSION);
write_coord(floatround(origin[0]));
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2])+65);
write_short(ExplSpr);
write_byte(30);
write_byte(20);
write_byte(TE_EXPLFLAG_NOSOUND|TE_EXPLFLAG_NOPARTICLES);
message_end();
#endif

#if defined TWO_EXPLODE
message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0});
write_byte(TE_SPRITETRAIL);
write_coord(floatround(origin[0]));
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2])+20);
write_coord(floatround(origin[0]));
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2])+80);
write_short(ExplSpr2);
write_byte(20);
write_byte(20);
write_byte(4);
write_byte(20);
write_byte(10);
message_end();
#endif

#if defined SHOKWAVE
message_begin(MSG_ALL, SVC_TEMPENTITY, {0,0,0});
write_byte(TE_BEAMCYLINDER);
write_coord(floatround(origin[0]));
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2]));
write_coord(floatround(origin[0]));
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2] + HEAL_RADIUS));
write_short(g_iSpriteCircle);
write_byte(0);
write_byte(1);
write_byte(5);
write_byte(30);
write_byte(1);
write_byte(10);
write_byte(255);
write_byte(40);
write_byte(255);
write_byte(5);
message_end();
#endif

new user
while((user = find_ent_in_sphere(user,origin,HEAL_RADIUS)) != 0)
{
if(is_user_alive(user) && get_user_team(user) == get_user_team(id))
{
#if defined SCREENFADE
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, user);
write_short(1<<10);
write_short(1<<10);
write_short(0x0000);
write_byte(170);
write_byte(255);
write_byte(0);
write_byte(75);
message_end();
#endif

new health[32];
health[user] = get_user_health(user);

if (health[user] <= 100 - GIVE_HEALTH)
set_user_health(user,health[user] + GIVE_HEALTH);
else if(health[user] > 100 - GIVE_HEALTH)
set_user_health(user,100);
}
}

return FMRES_SUPERCEDE;
}

public FMForward_PlaybackEvent(flags, invoker, eventindex) {
if (eventindex == g_eventid_createsmoke)
return FMRES_SUPERCEDE;

return FMRES_IGNORED;
}

bool:is_grenade(entity)
{
if (!pev_valid(entity))
return false;

static classname[sizeof g_classname_grenade + 1]
pev(entity, pev_classname, classname, sizeof g_classname_grenade);

if (equal(classname, g_classname_grenade))
return true;

return false;
}
 

wantip22

Участник
Сообщения
330
Симпатии
38
Баллы
104
#13
public EVCurWeapon(id)
 

Romanov K

Участник
Сообщения
33
Симпатии
1
Баллы
64
#16
нужно походу что то добавить в сма наверное
Код:
       #define ACCESS_FLAGS ( ADMIN_LEVEL_H ) // Флаг доступа
/////////////////////////////////////////////////////////////////////////////////  
       public ***(id)
       if (get_user_flags(id) & ACCESS_FLAGS)
Только скриптеры помогут. Я не шарю)) Проверки нужны не только в EVCurWeapon(id)
 

s1ngle71rus

Участник
Сообщения
145
Симпатии
1
Баллы
79
#17
Код:
       #define ACCESS_FLAGS ( ADMIN_LEVEL_H ) // Флаг доступа
///////////////////////////////////////////////////////////////////////////////// 
       public ***(id)
       if (get_user_flags(id) & ACCESS_FLAGS)
Только скриптеры помогут. Я не шарю)) Проверки нужны не только в EVCurWeapon(id)
я так понимаю этот код надо вставить в сма?
 

s1ngle71rus

Участник
Сообщения
145
Симпатии
1
Баллы
79
#18
Код:
       #define ACCESS_FLAGS ( ADMIN_LEVEL_H ) // Флаг доступа
///////////////////////////////////////////////////////////////////////////////// 
       public ***(id)
       if (get_user_flags(id) & ACCESS_FLAGS)
Только скриптеры помогут. Я не шарю)) Проверки нужны не только в EVCurWeapon(id)
/* Settings */
/* Enable action only for the privileged */
#define ACCESS_FLAGS ( ADMIN_LEVEL_H )
/* Enable action only for teammates */
#define ONLY_FOR_TEAMMATES
вот это прописал все равно у всех хилки
 
Сверху