Senior Member
Join Date: Apr 2021
Location: Palestine
|
12-17-2021
, 08:30
Grenade Trail VIP Error
|
#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_NAME, PLUGIN_VERSION, PLUGIN_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(), 1, 32);
}
public client_connect(iPlrId)
{
ClearPlayerBit(g_iConnectedUsers, iPlrId);
ClearPlayerBit(g_iDeadUsers, iPlrId);
}
public client_putinserver(iPlrId)
{
if( !is_user_bot(iPlrId) )
{
SetPlayerBit(g_iConnectedUsers, iPlrId);
if( is_user_alive(iPlrId) )
ClearPlayerBit(g_iDeadUsers, iPlrId);
else
SetPlayerBit(g_iDeadUsers, iPlrId);
}
}
public client_disconnect(iPlrId)
{
ClearPlayerBit(g_iConnectedUsers, iPlrId);
ClearPlayerBit(g_iDeadUsers, iPlrId);
}
public Event_ResetHUD(iPlrId)
{
if( CheckPlayerBit(g_iConnectedUsers, iPlrId) )
{
if( is_user_alive(iPlrId) )
ClearPlayerBit(g_iDeadUsers, iPlrId);
else
SetPlayerBit(g_iDeadUsers, iPlrId);
}
}
public Event_Health(iPlrId)
{
if( CheckPlayerBit(g_iConnectedUsers, iPlrId) )
{
if( is_user_alive(iPlrId) )
ClearPlayerBit(g_iDeadUsers, iPlrId);
else
SetPlayerBit(g_iDeadUsers, iPlrId);
}
}
public plugin_unpause()
{
g_iConnectedUsers = 0;
g_iDeadUsers = 0;
for( new iPlrId=1; iPlrId<=g_iMaxPlayers; iPlrId++ )
{
if( is_user_connected(iPlrId) )
{
if( !is_user_bot(iPlrId) )
{
SetPlayerBit(g_iConnectedUsers, iPlrId);
if( !is_user_alive(iPlrId) )
SetPlayerBit(g_iDeadUsers, iPlrId);
}
}
}
}
public grenade_throw(iPlrId, iGrenId, iWeaponType)
{
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_SMOKEGRENADE: iTemp = 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), 0, 1);
switch( clamp(get_pcvar_num(g_iCvar_TrailStatus), 0, 3) )
{
case 1:
{
new CsTeams:iOwnerTeam = cs_get_user_team(iPlrId);
for( new iPlayer=1; iPlayer<=g_iMaxPlayers; iPlayer++ )
{
if( CheckPlayerBit(g_iConnectedUsers, iPlayer) )
{
if( cs_get_user_team(iPlayer)==iOwnerTeam )
{
message_begin(MSG_TYPE_ALONE, SVC_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_ALONE, SVC_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=1; iPlayer<=g_iMaxPlayers; iPlayer++ )
{
if( CheckPlayerBit(g_iConnectedUsers, iPlayer) )
{
if( CheckPlayerBit(g_iDeadUsers, iPlayer) || cs_get_user_team(iPlayer)==iOwnerTeam )
{
message_begin(MSG_TYPE_ALONE, SVC_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_ALONE, SVC_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_ALL, SVC_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_ALL, SVC_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).
__________________
|
|