Raised This Month: $183 Target: $400
 45% 

Glow instead of flashlight


Post New Thread Reply   
 
Thread Tools Display Modes
sanimare
Senior Member
Join Date: Sep 2010
Old 06-05-2020 , 16:09   Re: Glow instead of flashlight
Reply With Quote #11

I want when player press F he gets glow (1 - 2 seconds) + it will show name on head too like when I aim teammate (last code above), only to teammates, for one who is pressing F only glow.
sanimare is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-06-2020 , 19:38   Re: Glow instead of flashlight
Reply With Quote #12

This is how it is going to look.

A unique semi-clip that could withstand feedback...
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 12-02-2020 at 11:11.
DJEarthQuake is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 10-18-2020 , 14:40   Re: Glow instead of flashlight
Reply With Quote #13

That would be great, AUTO off at 2 sec. CT blue color and TT red color, and only teammates can see when its glowing so they dont know when you signal for passing ball.
sanimare is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-22-2020 , 19:38   Re: Glow instead of flashlight
Reply With Quote #14

What mod?
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 12-02-2020 at 11:11. Reason: Updated code.
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-02-2020 , 11:15   Re: Glow instead of flashlight
Reply With Quote #15

Updated.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 12-27-2020 , 17:26   Re: Glow instead of flashlight
Reply With Quote #16

It's Soccerjam mod. Can you make it just to glow, i see something on my head and it's akward
And it is not working all the time when i'm pressing F, sometimes.
Maybe it's better to be without models, just glow like i used in my code, i just need to disappear and maybe better, hudge, glow.

Last edited by sanimare; 12-27-2020 at 18:51.
sanimare is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-28-2020 , 13:42   Re: Glow instead of flashlight
Reply With Quote #17

Comment out, CVAR, or discard that part. Those teleporter models are red and blue. Only teams can see them. Like the voice icon above the head. It can help see.

Code:
/*             emessage_begin( MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, { 0, 0, 0 }, players[m] );             ewrite_byte(TE_PLAYERATTACHMENT)             ewrite_byte(iPlayers_index)             ewrite_coord(MAX_AUTHID_LENGTH) //(attachment origin.z = player origin.z + vertical offset)             if(equal(glowteam, "CT"))                 ewrite_short(overhead_icon_ct)             else                 ewrite_short(overhead_icon_t)             ewrite_short(MAX_IP_LENGTH) //life * 10             emessage_end(); */

Changing MSG_ONE_UNRELIABLE to MSG_ONE should help with not being able to see it all the time. There's a trade-off. MSG_ONE is more reliable but less stable.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 12-28-2020 at 13:53. Reason: obvious typo
DJEarthQuake is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 12-28-2020 , 17:30   Re: Glow instead of flashlight
Reply With Quote #18

It's good but when enemy kill me i can't do signals anymore because this mod is like deathmatch..

can i change this somehow to hud of his name?
client_print(players[m], print_center, "%s is signaling",signalers_name);

Last edited by sanimare; 12-28-2020 at 17:48.
sanimare is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-01-2021 , 21:20   Re: Glow instead of flashlight
Reply With Quote #19

Quote:
Originally Posted by sanimare View Post
when enemy kill me i can't do signals anymore
Where you see is_user_alive change alive to connected. As far as adding who you are aiming as a HUD. That easy enough but will wait for you to test changing that code so you can signal when dead.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 01-07-2021 , 13:14   Re: Glow instead of flashlight
Reply With Quote #20

Quote:
Originally Posted by DJEarthQuake View Post
Where you see is_user_alive change alive to connected. As far as adding who you are aiming as a HUD. That easy enough but will wait for you to test changing that code so you can signal when dead.
It's not showing after i die and respawn.

PHP Code:
/*
 * 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.
 * 
*/

#include amxmodx
#include engine
#include fakemeta
#include colorchat

#define MAX_IP_LENGTH     16
#define MAX_NAME_LENGTH   32
#define MAX_PLAYERS       32
#define MAX_AUTHID_LENGTH 64
//#define DEBUG

new bool:cool_down_active
new glowteam[MAX_IP_LENGTH], g_radiusg_timeoverhead_icon_ct,overhead_icon_t;
new 
playersMAX_PLAYERS ], team_nameMAX_NAME_LENGTH ], signalers_nameMAX_NAME_LENGTH ], playercount;
new 
Origin[3];


public 
plugin_init()

{
    
register_plugin("Team Glow flashlight""1.1""SPiNX");
    
register_impulse(100"client_impulse_flashlight");
    
g_radius register_cvar("glow_radius""10")
    
g_time register_cvar("glow_time""10")
    
register_logevent("round_start"2"1=Round_Start");
    
register_logevent("round_end"2"1=Round_End");
}

public 
client_impulse_flashlight(iPlayers_index)

    
glowinsteadofflashlight(iPlayers_index);


public 
round_start()

    
cool_down_active false


public round_end()

    
cool_down_active true


public plugin_precache()

{
    
overhead_icon_ct precache_model("sprites/ct_pass.spr");
    
overhead_icon_t precache_model("sprites/t_pass.spr");
}

public 
glowinsteadofflashlight(iPlayers_index)

{
    
get_user_team(iPlayers_indexglowteamcharsmax(glowteam));

    if(
is_user_connected(iPlayers_index) && !cool_down_active)

        {
            
get_user_origin(iPlayers_indexOrigin);
            
get_players(players,playercount,"ae"glowteam)

            for (new 
m=0playercount; ++m)

            {

            
#if defined DEBUG
            
server_print("Team is %s"glowteam);
            
#endif

            
get_user_name(players[m], team_namecharsmax(team_name) );

            if(!
is_user_bot(players[m]))
                
get_user_name(iPlayers_indexsignalers_namecharsmax(signalers_name) );

            
#if defined DEBUG
            
client_print(iPlayers_indexprint_chat"Trying to send glow to %s",team_name);
            
#endif

            
ColorChat(players[m], GREEN"^3Asking ^1for pass ^4%s",signalers_name);

            
emessage_beginMSG_ONE SVC_TEMPENTITY, { 00}, players[m] );
            
ewrite_byte(TE_PLAYERATTACHMENT)
            
ewrite_byte(iPlayers_index)
            
ewrite_coord(MAX_AUTHID_LENGTH//(attachment origin.z = player origin.z + vertical offset)
            
if(equal(glowteam"CT"))
                
ewrite_short(overhead_icon_ct)
            else
                
ewrite_short(overhead_icon_t)
            
ewrite_short(MAX_IP_LENGTH//life * 10
            
emessage_end();

            
emessage_begin(MSG_ONE SVC_TEMPENTITY,{0,0,0},players[m]);
            
ewrite_byte(TE_DLIGHT);

            
ewrite_coord(Origin[0]);
            
ewrite_coord(Origin[1]);
            
ewrite_coord(Origin[2]);

            
ewrite_byte(get_pcvar_num(g_radius)); ///(radius in 10's)

            //CS team RGB messaging
            
if(equal(glowteam"CT"))
                {
                    if (
entity_get_float(iPlayers_indexEV_FL_armorvalue) < 101.0)
                        {
                            
ewrite_byte(0);
                            
ewrite_byte(0);
                            
ewrite_byte(255);
                        }

                        else 
/* VIP */
                            
{
                                
ewrite_byte(0);
                                
ewrite_byte(255);
                                
ewrite_byte(0);
                            }

                }

            if(
equal(glowteam"TERRORIST"))

                {
                    
ewrite_byte(255);
                    
ewrite_byte(0);
                    
ewrite_byte(0);
                }

            
ewrite_byte(get_pcvar_num(g_time));  ///life
            
ewrite_byte(get_pcvar_num(g_time));  ///(decay rate in 10's)
            
emessage_end();

            
message_begin(MSG_ONE SVC_TEMPENTITY,{0,0,0},players[m]);
            
ewrite_byte(TE_ELIGHT);

            
ewrite_short(iPlayers_index);

            
ewrite_coord(Origin[0]);
            
ewrite_coord(Origin[1]);
            
ewrite_coord(Origin[2]);

            
ewrite_coord(get_pcvar_num(g_radius));  ///(radius in 10's)

            //CS team RGB messaging
            
if(equal(glowteam"CT"))
                {
                    if (
entity_get_float(iPlayers_indexEV_FL_armorvalue) < 101.0)
                        {
                            
ewrite_byte(0);
                            
ewrite_byte(0);
                            
ewrite_byte(255);
                        }

                        else 
/* VIP */
                            
{
                                
ewrite_byte(0);
                                
ewrite_byte(255);
                                
ewrite_byte(0);
                            }

                    }

            if(
equal(glowteam"TERRORIST"))

                {
                    
ewrite_byte(255);
                    
ewrite_byte(0);
                    
ewrite_byte(0);
                }

            
ewrite_byte(get_pcvar_num(g_time));   ///life
            
ewrite_coord(get_pcvar_num(g_time));  ///(decay rate in 10's)
            
emessage_end();
        }
    }

sanimare is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:08.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode