My request is to set glow to player who presses F (+flashlight or impulse 101).
Glow can be in radius little or bigger so i can set it, in .sma, no need for cvar.
Blue glow for CT and Red for TT.
When you are in CT blue glow and only counters see it, in TT red glow and only terrorists see it.
/*
* glow_flashlight.sma Toggle Flashlight and you glow depending on team.
*
* Copyright 2020 SPiNX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* 2020-12-02 1.0 to 1.1 SPiNX
* Updated so opposing team cannot see.
*
*/
new bool:cool_down_active
new glowteam[MAX_IP_LENGTH], g_radius, g_time, overhead_icon_ct,overhead_icon_t;
new players[ MAX_PLAYERS ], team_name[ MAX_NAME_LENGTH ], signalers_name[ MAX_NAME_LENGTH ], playercount;
new Origin[3];
new g_debug
ewrite_byte(get_pcvar_num(g_time)); ///life
ewrite_coord(get_pcvar_num(g_time)); ///(decay rate in 10's)
emessage_end();
}
}
}
Original. Everybody can see. Requires Amxx 1.9.0
Spoiler
Code:
/*
My request is to set glow to player who presses F (+flashlight or impulse 101).
Glow can be in radius little or bigger so i can set it, in .sma, no need for cvar.
Blue glow for CT and Red for TT.
When you are in CT blue glow and only counters see it, in TT red glow and only terrorists see it.
*/#include amxmodx#include amxmisc#include engine#include fun#define OFF set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, g_SPShell)new fx,r,g,b,render,amount,g_SPShell;
public plugin_init(){register_plugin("Team Glow flashlight", "1.0", "SPiNX");
register_impulse(100, "client_impulse_flashlight");
}public client_impulse_flashlight(id){if(is_user_alive(id) || (is_user_connected(id) && is_user_bot(id)))
g_SPShell = 75;
//3-way toggle light switch. BOTH|FLASHLIGHT|GLOW|OFF
get_user_rendering(id,fx,r,g,b,render,amount)if(r|g|b == 255)
OFF
else{if(entity_get_float(id, EV_FL_armorvalue) > 100.0 && get_user_team(id) == 2){
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, g_SPShell)return PLUGIN_CONTINUE;
}if(get_user_team(id) == 1){
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, g_SPShell)return PLUGIN_CONTINUE;
}if(entity_get_float(id, EV_FL_armorvalue) <= 100.0 && get_user_team(id) == 2){
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, g_SPShell)return PLUGIN_CONTINUE;
}}return PLUGIN_HANDLED_MAIN;
}
Can you just make it when you press F to show up glow for like 2 seconds and auto-disappear (cvar would be good or in sma) and showing glow only for team, you don't see enemy glow (cvar too or in sma) ?
Implementing "show name" would be great too.
I have some edited code that's working when you aim at player, can you implement with this plugin to show hud name too when he press F (cvar or in sma settings)?
PHP Code:
#include <amxmodx>
#include <fakemeta>
new gCvarEnable;
new gCvarAlpha;
new gCvarShowNames;
new gMaxPlayers;
new gHudSyncObj;
new gPlayerTeam[33];
new bool:gPlayerSolid[33];
new bool:gPlayerRestore[33];
public plugin_init()
{
register_plugin("HNS_SEMICLIP", "1.0", "Jon");