Raised This Month: $51 Target: $400
 12% 

Grenade Trail VIP Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-17-2021 , 08:30   Grenade Trail VIP Error
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <csx>

#define PLUGIN_NAME    "Team Grenade Trail"
#define PLUGIN_VERSION    "1.2"
#define PLUGIN_AUTHOR    "null."

#define ACCESS_LEVEL        ADMIN_LEVEL_H

#define SetPlayerBit(%1,%2)    ( %1 |=  ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2)  ( %1 &= ~( 1 << ( %2 & 31 ) ) )
#define CheckPlayerBit(%1,%2)  ( %1 &   ( 1 << ( %2 & 31 ) ) )

new g_iCvar_ColorFlash;
new 
g_iCvar_ColorHe;
new 
g_iCvar_ColorSmoke;
new 
g_iCvar_TrailStatus;
new 
g_iCvar_TeamColor;

new 
g_iSpriteLine;
new 
g_iSpriteArrow;

new 
g_iConnectedUsers;
new 
g_iDeadUsers;
new 
g_iMaxPlayers;

public 
plugin_precache()
{
    
g_iSpriteArrow precache_model("sprites/arrow1.spr");
    
g_iSpriteLine  precache_model("sprites/smoke.spr");
}

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
    
g_iCvar_TrailStatus register_cvar("amx_grentrail_status""1"ACCESS_LEVEL);
    
    
g_iCvar_ColorFlash  register_cvar("amx_grentrail_color_fb""000000255"ACCESS_LEVEL);
    
g_iCvar_ColorHe     register_cvar("amx_grentrail_color_he""255000000"ACCESS_LEVEL);
    
g_iCvar_ColorSmoke  register_cvar("amx_grentrail_color_sg""000255000"ACCESS_LEVEL);
    
    
g_iCvar_TeamColor   register_cvar("amx_grentrail_team_color""0"ACCESS_LEVEL);
    
    
register_event("ResetHUD""Event_ResetHUD""be");
    
register_event("Health",   "Event_Health",   "bd");
    
    
g_iMaxPlayers clamp(get_maxplayers(), 132);
}

public 
client_connect(iPlrId)
{
    
ClearPlayerBit(g_iConnectedUsersiPlrId);
    
ClearPlayerBit(g_iDeadUsersiPlrId);
}

public 
client_putinserver(iPlrId)
{
    if( !
is_user_bot(iPlrId) )
    {
        
SetPlayerBit(g_iConnectedUsersiPlrId);
        if( 
is_user_alive(iPlrId) )
            
ClearPlayerBit(g_iDeadUsersiPlrId);
        else
            
SetPlayerBit(g_iDeadUsersiPlrId);
    }
}

public 
client_disconnect(iPlrId)
{
    
ClearPlayerBit(g_iConnectedUsersiPlrId);
    
ClearPlayerBit(g_iDeadUsersiPlrId);
}

public 
Event_ResetHUD(iPlrId)
{
    if( 
CheckPlayerBit(g_iConnectedUsersiPlrId) )
    {
        if( 
is_user_alive(iPlrId) )
            
ClearPlayerBit(g_iDeadUsersiPlrId);
        else
            
SetPlayerBit(g_iDeadUsersiPlrId);
    }
}

public 
Event_Health(iPlrId)
{
    if( 
CheckPlayerBit(g_iConnectedUsersiPlrId) )
    {
        if( 
is_user_alive(iPlrId) )
            
ClearPlayerBit(g_iDeadUsersiPlrId);
        else
            
SetPlayerBit(g_iDeadUsersiPlrId);
    }
}

public 
plugin_unpause()
{
    
g_iConnectedUsers 0;
    
g_iDeadUsers 0;
    
    for( new 
iPlrId=1iPlrId<=g_iMaxPlayersiPlrId++ )
    {
        if( 
is_user_connected(iPlrId) )
        {
            if( !
is_user_bot(iPlrId) )
            {
                
SetPlayerBit(g_iConnectedUsersiPlrId);
                if( !
is_user_alive(iPlrId) )
                    
SetPlayerBit(g_iDeadUsersiPlrId);
            }
        }
    }
}

public 
grenade_throw(iPlrIdiGrenIdiWeaponType)
{
    new 
iTemp;
    switch( 
iWeaponType )
    {
        case 
CSW_FLASHBANG:    iTemp get_pcvar_num(g_iCvar_ColorFlash);
        case 
CSW_HEGRENADE:    iTemp get_pcvar_num(g_iCvar_ColorHe);
        case 
CSW_SMOKEGRENADEiTemp get_pcvar_num(g_iCvar_ColorSmoke);
        default: return;
    }
    
    new 
iRed iTemp/1000000;
    
iTemp %= 1000000;
    new 
iGreen iTemp/1000;
    new 
iBlue iTemp%1000;
    
    
iTemp clamp(get_pcvar_num(g_iCvar_TeamColor), 01);
    
    switch( 
clamp(get_pcvar_num(g_iCvar_TrailStatus), 03) )
    {
        case 
1:
        {
            new 
CsTeams:iOwnerTeam cs_get_user_team(iPlrId);
            
            for( new 
iPlayer=1iPlayer<=g_iMaxPlayersiPlayer++ )
            {
                if( 
CheckPlayerBit(g_iConnectedUsersiPlayer) )
                {
                    if( 
cs_get_user_team(iPlayer)==iOwnerTeam )
                    {
                        
message_begin(MSG_TYPE_ALONESVC_TEMPENTITY_iPlayer);
                        
write_byte(TE_BEAMFOLLOW);
                        
write_short(iGrenId);
                        
write_short(g_iSpriteArrow);
                        
write_byte(15);
                        
write_byte(7);
                        
write_byte(iRed);
                        
write_byte(iGreen);
                        
write_byte(iBlue);
                        
write_byte(191);
                        
message_end();
                        
                        if( 
iTemp )
                        {
                            
message_begin(MSG_TYPE_ALONESVC_TEMPENTITY_iPlayer);
                            
write_byte(TE_BEAMFOLLOW);
                            
write_short(iGrenId);
                            
write_short(g_iSpriteLine);
                            
write_byte(15);
                            
write_byte(1);
                            switch( 
iOwnerTeam )
                            {
                                case 
CS_TEAM_T:
                                {
                                    
write_byte(255);
                                    
write_byte(0);
                                    
write_byte(0);
                                }
                                case 
CS_TEAM_CT:
                                {
                                    
write_byte(0);
                                    
write_byte(0);
                                    
write_byte(255);
                                }
                                default:
                                {
                                    
write_byte(127);
                                    
write_byte(127);
                                    
write_byte(127);
                                }
                            }
                            
write_byte(191);
                            
message_end();
                        }
                    }
                }
            }
        }
        case 
2:
        {
            new 
CsTeams:iOwnerTeam cs_get_user_team(iPlrId);
            
            for( new 
iPlayer=1iPlayer<=g_iMaxPlayersiPlayer++ )
            {
                if( 
CheckPlayerBit(g_iConnectedUsersiPlayer) )
                {
                    if( 
CheckPlayerBit(g_iDeadUsersiPlayer) || cs_get_user_team(iPlayer)==iOwnerTeam )
                    {
                        
message_begin(MSG_TYPE_ALONESVC_TEMPENTITY_iPlayer);
                        
write_byte(TE_BEAMFOLLOW);
                        
write_short(iGrenId);
                        
write_short(g_iSpriteArrow);
                        
write_byte(15);
                        
write_byte(7);
                        
write_byte(iRed);
                        
write_byte(iGreen);
                        
write_byte(iBlue);
                        
write_byte(191);
                        
message_end();
                        
                        if( 
iTemp )
                        {
                            
message_begin(MSG_TYPE_ALONESVC_TEMPENTITY_iPlayer);
                            
write_byte(TE_BEAMFOLLOW);
                            
write_short(iGrenId);
                            
write_short(g_iSpriteLine);
                            
write_byte(15);
                            
write_byte(1);
                            switch( 
iOwnerTeam )
                            {
                                case 
CS_TEAM_T:
                                {
                                    
write_byte(255);
                                    
write_byte(0);
                                    
write_byte(0);
                                }
                                case 
CS_TEAM_CT:
                                {
                                    
write_byte(0);
                                    
write_byte(0);
                                    
write_byte(255);
                                }
                                default:
                                {
                                    
write_byte(127);
                                    
write_byte(127);
                                    
write_byte(127);
                                }
                            }
                            
write_byte(191);
                            
message_end();
                        }
                    }
                }
            }
        }
        case 
3:
        {
            
message_begin(MSG_TYPE_ALLSVC_TEMPENTITY);
            
write_byte(TE_BEAMFOLLOW);
            
write_short(iGrenId);
            
write_short(g_iSpriteArrow);
            
write_byte(15);
            
write_byte(7);
            
write_byte(iRed);
            
write_byte(iGreen);
            
write_byte(iBlue);
            
write_byte(191);
            
message_end();
            
            if( 
iTemp )
            {
                
message_begin(MSG_TYPE_ALLSVC_TEMPENTITY);
                
write_byte(TE_BEAMFOLLOW);
                
write_short(iGrenId);
                
write_short(g_iSpriteLine);
                
write_byte(15);
                
write_byte(1);
                switch( 
cs_get_user_team(iPlrId) )
                {
                    case 
CS_TEAM_T:
                    {
                        
write_byte(255);
                        
write_byte(0);
                        
write_byte(0);
                    }
                    case 
CS_TEAM_CT:
                    {
                        
write_byte(0);
                        
write_byte(0);
                        
write_byte(255);
                    }
                    default:
                    {
                        
write_byte(127);
                        
write_byte(127);
                        
write_byte(127);
                    }
                }
                
write_byte(191);
                
message_end();
            }
        }
    }

Errors:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "MSG_TYPE_ALONE" on line 147
Warning: Expression has no effect on line 147
Warning: Expression has no effect on line 147
Error: Expected token: ";", but found ")" on line 147
Error: Invalid expression, assumed zero on line 147
Error: Too many error messages on one line on line 147

Compilation aborted.
4 Errors.
Could not locate output file D:\AMX Mod X\amxxstudio\Untitled.amx (compile failed).
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-17-2021 , 09:44   Re: Grenade Trail VIP Error
Reply With Quote #2

It should say MSG_TYPE_ONE, not ALONE. Someone failed when replacing it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-17-2021 , 11:45   Re: Grenade Trail VIP Error
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
It should say MSG_TYPE_ONE, not ALONE. Someone failed when replacing it.
Still
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "MSG_TYPE_ONE" on line 147
Warning: Expression has no effect on line 147
Error: Invalid expression, assumed zero on line 147
Error: Invalid expression, assumed zero on line 147
Error: Too many error messages on one line on line 147

Compilation aborted.
4 Errors.
Could not locate output file C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\LOADI NG.amx (compile failed).
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/

Last edited by SHIFT0; 12-17-2021 at 11:47. Reason: FAIL
SHIFT0 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-17-2021 , 13:27   Re: Grenade Trail VIP Error
Reply With Quote #4

MSG_ONE, my bad.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-17-2021 , 13:28   Re: Grenade Trail VIP Error
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
MSG_ONE, my bad.
Good Job !
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/

Last edited by SHIFT0; 12-17-2021 at 13:30. Reason: GreaT
SHIFT0 is offline
Reply



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 10:38.


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