Smoke: HealthNade 0.0.4b - флаг доступа

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
51
Реакции
5
Ошибка
В логах ошибкок нету
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (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: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.692-dev
Build date: 18:58:01 Sep 21 2019 (1988)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL version: 5.13.0.447-dev+m
Build date: 18:11:04 Jan 15 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/2eba3b1
Версия 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] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY
[ 2] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC4 ini ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 4] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.5 ini ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl3 ANY
[ 8] ReAPI RUN - reapi_amxx_i386.so v5.12.0.192-dev pl3 ANY Never
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl3 ANY
[10] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
[13] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl3 ANY Never
[14] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
[15] AuthEmu RUN - authemu_amxx_i386.so v4.2.12.311-dev+m pl3 ANY Never
15 plugins, 15 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Admin Loader v3.5 neygomon admin_loader.am running
[ 2] Lite Bans v2.2 neygomon lite_bans_off.a running
[ 3] Ultimate Chats Control v5.2(c) neygomon ucc.amxx running
[ 4] UCC Addon: VoteGAG v1.2 neygomon ucc_votegag.amx running
[ 5] [ReAPI] AdminFreeLook v1.0 ReHLDS Team adminfreelook.a running
[ 6] [ReAPI] Admin Models v0.0.2 Vaqtincha reapi_admin_mod running
[ 7] Admin Commands v1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 8] Slots Reservation v1.9.0.5263 AMXX Dev Team adminslots.amxx running
[ 9] Menus Front-End v1.5 neugomon menufront_end.a running
[ 10] Players Menu v1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 11] Maps Menu v1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 12] Admin Chat v1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 13] Admin Votes v1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 14] TimeLeft v1.9.0.5263 AMXX Dev Team timeleft.amxx running
[ 15] CSStatsX SQL v0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 16] AES: StatsX v0.5+1 serfreeman1337 aes_statsx_cstr running
[ 17] Chat Manager v1.1.2-16 Mistrick chatmanager.amx running
[ 18] Chat Manager: Addon v0.0.4-70 Mistrick chatmanager_add running
[ 19] Pause Plugins v1.9.0.5263 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration v1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 21] Restrict Weapons v1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 22] StatsX v1.9.0.5263 AMXX Dev Team statsx.amxx running
[ 23] Lie Flat Optimized v1.1 Nomexous lie_flat_optimi running
[ 24] [Re] Reset Score ReFre v0.0.1 wopox1337@Dev-CS ResetScore_ReFr running
[ 25] [ReAPI] AWPoff v1.3 PAffAEJIkA :3 awp_off.amxx running
[ 26] Killer ScreenFade v0.0.5 Vaqtincha reapi_killer_sc running
[ 27] [ReAPI] Block 'Fire in v0.0.1 sergrib reapi_block_FIT running
[ 28] Spec Money Save v0.2 F@nt0M spec_money_save running
[ 29] Rechecker Log v0.1 F@nt0M rc_log.amxx running
[ 30] Ping Checker v26.0.1 RC1 h1k3 ping_checker.am running
[ 31] [ReAPI] C4 Drop v0.9 a2 & F@nt0M c4_drop_0_7.amx running
[ 32] GameRules Info v1.2 shadow GameRulesInfo.a running
[ 33] [ReAPI] Silly C4 v2.0 F@ntoM & Cheap_S reapi_sillyc4.a running
[ 34] Block WpnSelect Sound v1.1 w0w & F@nt0M block_wpnselect running
[ 35] Team Select v1.5.0 F@nt0M teamselect.amxx running
[ 36] Parachute Lite [ReAPI] v11.0 Leo_[BH] parachute_lite. running
[ 37] [ReAPI:AMXX] Buy Nades v0.2 F@nt0M Buy_Nades_Timeo running
[ 38] [ReAPI] No Team Flash v0.0.3 Vaqtincha no_team_flash.a running
[ 39] Advanced Kill Assists v1.0 Xelson next21_kill_ass running
[ 40] Stop the Bastards v1.7.0 F@nt0M stop_the_bastar running
[ 41] [ReAPI] Hint blocker v0.1.0 F@tn0M reapi_hint_bloc running
[ 42] Reklama v09.07.2019 mx?! reklama.amxx running
[ 43] Smoke: HealthNade v0.0.4b wopox1337 Smoke_HealthNad running
[ 44] Auto recording demo v2.0 IzI | Bonaqua (R amx_autodemorec running
[ 45] [190] Ultimate Weapons v19.11.29 SKAJIbnEJIb ultimate_weapon running
[ 46] [190] VIP RBS v19.12.09 SKAJIbnEJIb vip_rbs.amxx running
[ 47] AFK Control ReNew v1.2(a) neygomon afk_control.amx running
[ 48] Models Replacement v0.0.2 ConnorMcLeod | V models_replacem running
[ 49] CSS Bomb v0.0.1 Vaqtincha cs_bomb.amxx running
[ 50] ReAimDetector API v0.2.2 ReHLDS Team reaimdetector.a running
[ 51] AuthEmu API v1.0 Dev-MS Team authemu.amxx running
[ 52] Map Manager: Core v3.0.4 Mistrick map_manager_cor running
[ 53] Map Manager: Scheduler v0.1.2 Mistrick map_manager_sch running
[ 54] Map Manager: Rtv v0.1.0 Mistrick map_manager_rtv running
[ 55] Map Manager: Nominatio v0.1.0 Mistrick map_manager_nom running
[ 56] Map Manager: BlockList v0.0.3 Mistrick map_manager_blo running
[ 57] Map Manager: Online so v0.0.2 Mistrick map_manager_onl running
[ 58] Map Manager: Effects v0.0.8 Mistrick map_manager_eff running
[ 59] Map Manager: Informer v0.0.5 Mistrick map_manager_inf running
[ 60] Hide HUD/Menu on Vote v1.2.2 d3m37r4 hide_hud_and_me running
[ 61] Advanced Experience Sy v0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 62] AES: CStrike Addon v0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 63] AES: Informer v0.5 Vega serfreeman1337 aes_informer.am running
[ 64] AES: Admin Tools v0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 65] AES: Bonus System v0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 66] AES: Bonus CSTRIKE v0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
66 plugins, 66 running
Автор плагина
wopox1337
Версия плагина
0.0.4b
Исходный код
/**
* Copyright (C) Dev-CS Team, 2018
*
* This software is licensed under the GNU General Public License, version 3 or higher.
* Additional exceptions apply. For full license details, see LICENSE.txt or visit:
* https://alliedmods.net/amxmodx-license
*
* Description:
* This plugin add a new grenade item to game names as 'HealthNade'.
* The grenade will give additional health of allies (or all) nearby.
*
* Changelog:
* - 0.0.1 (20.11.17):
* - Init;
* - 0.0.2 (23.11.17):
* - FIX: AMXX 1.8.2 compilation;
* - Removed HamSandwich module.
* - 0.0.3 (25.12.17):
* - FIX: some bugs with 'emessage' flood; (Thanks to Mistrick)
* - Removed AMXX 1.8.2 support;
* - 0.0.4 (09.08.18):
* - FIX: The blinding effect is no longer reset;
* - Add: ScreenFade effect settings;
* - Add: Customisable models use (on/off);
* - Rework function for restrict item;
* - Simply API: SHN_S(G)etStatus (realy nned it?!);
* - 0.0.4b (19.12.19):
* - Fix sprites show & work.
*
* TODO:
* - Change the principle of the replacement Item (smart replacement).
*
* Credits: Arkshine, https://forums.alliedmods.net/showpost.php?p=1567176&postcount=16
*/

#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

/* Enable Screenfade effect */
#define EFFECT_SCREENFADE

const HEALTH_TO_HEAL = 50;
const HEALTH_MAX = 100;
const HEAL_RADIUS = 300;

/* You can disable those models */
#define MODEL_V "models/smoke/v_he_mk_nade.mdl"
#define MODEL_P "models/smoke/p_he_mk_nade.mdl"
#define MODEL_W "models/smoke/w_he_mk_nade.mdl"

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

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

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 _SetWeaponModel(%1,%2) set_pev(%1, pev_weaponmodel2, %2)
#define _SetWorldModel(%1,%2) engfunc(EngFunc_SetModel, %1, %2)

#define _RemoveEntity(%1) engfunc(EngFunc_RemoveEntity, %1)

#define _get_blindStartTime(%1) get_ent_data_float(%1, "CBasePlayer", "m_blindStartTime")
#define _get_blindFadeTime(%1) get_ent_data_float(%1, "CBasePlayer", "m_blindFadeTime")

new g_MsgId_StatusIcon, g_MsgId_ScreenFade;

new g_pFirstExplosion,
g_pPros,
g_pCircle;

enum status_s { status_DISABLED = 0, status_ENABLED = 1 };
new status_s: g_bCanUseItem = status_ENABLED;

new const VERSION[] = "0.0.4b";

public plugin_natives()
{
register_native("SHN_SetStatus", "native__SetStatus", .style = 0);
register_native("SHN_GetStatus", "native__GetStatus", .style = 0);
}

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() {
#if defined MODEL_V
precache_model(MODEL_V);
#endif
#if defined MODEL_P
precache_model(MODEL_P);
#endif
#if defined MODEL_W
precache_model(MODEL_W);
#endif

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(!IsAllowedToUse(pPlayer)) return;

#if defined MODEL_V
OnPlayer_SetViewModels(pPlayer);
#endif

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(!IsAllowedToUse(pPlayer))
return;

#if defined MODEL_W
OnGrenade_SetWorldModel(pEnt);
#endif
}

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

static iOwner; iOwner = _GetEntOwner(pEnt);

if(!IsAllowedToUse(iOwner))
return;

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);

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

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

stock HealPlayersOnRadius(pInflictor, Float: fOrigin[3]) {
#if !defined ONLY_FOR_TEAMMATES
new iTeam = get_user_team(pInflictor);
#endif

for(new pPlayer = 1; pPlayer <= MaxClients; pPlayer++) {
if(is_user_alive(pPlayer)) {

#if !defined ONLY_FOR_TEAMMATES
if(iTeam != 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));

#if defined EFFECT_SCREENFADE
if(!IsBlind(pPlayer))
__UTIL_ScreenFade(pPlayer);
#endif
}

#if (defined MODEL_V || defined MODEL_P)
stock OnPlayer_SetViewModels(const pPlayer) {
#if defined MODEL_V
_SetViewModel(pPlayer, MODEL_V);
#endif
#if defined MODEL_P
_SetWeaponModel(pPlayer, MODEL_P);
#endif
}
#endif

stock OnGrenade_SetWorldModel(const pEnt)
_SetWorldModel(pEnt, MODEL_W);

stock OnGrenade_RemoveByTouch(const pEnt)
_RemoveEntity(pEnt);

stock Send_StatusIcon__Cross(const pPlayer, status = STATUSICON_FLASH) {
message_begin(MSG_ONE_UNRELIABLE, g_MsgId_StatusIcon, .player = pPlayer);
write_byte(status);
write_string("cross");
write_byte(0);
write_byte(255);
write_byte(0);
message_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]) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2] + 65);
write_short(g_pFirstExplosion);
write_byte(30);
write_byte(20);
write_byte(TE_EXPLFLAG_NOSOUND | TE_EXPLFLAG_NOPARTICLES);
message_end();
}

stock Send_Pros(iOrigin[3]) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_SPRITETRAIL);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2] + 20);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2] + 80);
write_short(g_pPros);
write_byte(20);
write_byte(20);
write_byte(4);
write_byte(20);
write_byte(10);
message_end();
}

stock Send_ShockWave(iOrigin[3]) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMCYLINDER);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2] + HEAL_RADIUS);
write_short(g_pCircle);
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();
}

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

message_begin(MSG_ONE_UNRELIABLE, g_MsgId_ScreenFade, .player = pPlayer);
write_short(FixedUnsigned16(flFxTime));
write_short(FixedUnsigned16(flHoldTime));
write_short(FFADE_IN);
write_byte(iColor[0]);
write_byte(iColor[1]);
write_byte(iColor[2]);
write_byte(iAlpha);
message_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);
}

bool: IsAllowedToUse(pPlayer) {
#pragma unused pPlayer

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

if(g_bCanUseItem == status_DISABLED) {
// client_print_color(pPlayer, print_team_red, "^3 You no may use this grenade now!");
return false;
}

// Also you can add another conditions there...
return true;
}

stock bool: IsBlind(pPlayer) {
return bool:(Float: _get_blindStartTime(pPlayer) + Float: _get_blindFadeTime(pPlayer) >= get_gametime());
}

/* API?! */

/**
* Set item status to use.
*
* @note Usage examples:
* SHN_SetStatus(1);
*
* @param status: 1 - enabled / 0 - disabled
*
* @noreturn
*/
// native SHN_SetStatus(status)
public native__SetStatus(plugin_id, argc)
{
enum { arg_status = 1 };

g_bCanUseItem = get_param(arg_status) == 1 ? status_ENABLED : status_DISABLED;
}

/**
* Retrieves the item status to use.
*
* @note Usage examples:
* SHN_GetStatus();
*
* @return Current status: 1 - enabled / 0 - disabled
*/
// native SHN_GetStatus()
public native__GetStatus(plugin_id, argc)
{
return g_bCanUseItem == status_ENABLED ? status_ENABLED : status_DISABLED;
}
Подскажите как лечебную гранату выдать по 2-ум флагам доступа "t" и "m"
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
3,582
Реакции
1,571
Помог
137 раз(а)
TomServ, на 44 строке дописать в скобках нужный флаг через знак "|"
 
  • Нравится
Реакции: Ayk
Сообщения
51
Реакции
5
Алексеич, так и сделал, но тут другая проблема вылезла, выдается и обычным игрокам.
 
Сообщения
51
Реакции
5
Алексеич, помогло. Хоть и знал как прописывать но не работало. Видать в чём-то не доглядел, в любом случае спасибо за помощь.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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