Skip to content

Commit

Permalink
Merge pull request darkerz7#64 from Rushaway/70-css
Browse files Browse the repository at this point in the history
feat(dz70): remove weapons related to csgo
  • Loading branch information
darkerz7 authored Jan 14, 2025
2 parents 7338ece + 3d31da7 commit 92f6c54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
28 changes: 9 additions & 19 deletions addons/sourcemod/scripting/entwatch/function.inc
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ stock bool IsValidClient(int iClient)
// Correct transfer of items to the player
stock void FixedEquipPlayerWeapon(int iClient, int iWeapon)
{
int wSlot = GetSlotCSGO(iWeapon);
int wSlot = GetWeaponSlot(iWeapon);
if((wSlot>=0) && (wSlot<=2))
{
int TargetWInSlot = GetPlayerWeaponSlot(iClient, wSlot);
Expand All @@ -267,7 +267,7 @@ stock int GetCounterValue(int counter) {
}

// Kludge, Getting a weapon slot without using a gamedata
stock int GetSlotCSGO(int eWeapon)
stock int GetWeaponSlot(int eWeapon)
{
/*Slots:
Invalid/Unknown: -1
Expand All @@ -282,30 +282,20 @@ stock int GetSlotCSGO(int eWeapon)

// Old function https://hlmod.net/threads/analogi-funkcij-na-bolee-bystrye.49613/
if((strcmp(wClassName,"weapon_elite",false)==0)||(strcmp(wClassName,"weapon_deagle",false)==0)||(strcmp(wClassName,"weapon_fiveseven",false)==0)||
(strcmp(wClassName,"weapon_glock",false)==0)||(strcmp(wClassName,"weapon_revolver",false)==0)||(strcmp(wClassName,"weapon_usp_silencer",false)==0)||
(strcmp(wClassName,"weapon_cz75a",false)==0)||(strcmp(wClassName,"weapon_hkp2000",false)==0)||(strcmp(wClassName,"weapon_p250",false)==0)||
(strcmp(wClassName,"weapon_tec9",false)==0)||(strcmp(wClassName,"weapon_p228",false)==0)||(strcmp(wClassName,"weapon_usp",false)==0))
(strcmp(wClassName,"weapon_glock",false)==0)|| (strcmp(wClassName,"weapon_p228",false)==0)||(strcmp(wClassName,"weapon_usp",false)==0))
return 1;
else if((strcmp(wClassName,"weapon_knife",false)==0)||(strcmp(wClassName,"weapon_knifegg",false)==0)||(strcmp(wClassName,"weapon_taser",false)==0)||
(strcmp(wClassName,"weapon_axe",false)==0)||(strcmp(wClassName,"weapon_hammer",false)==0)||(strcmp(wClassName,"weapon_spanner",false)==0))
else if(strcmp(wClassName,"weapon_knife",false)==0)
return 2;
else if((strcmp(wClassName,"weapon_hegrenade",false)==0)||(strcmp(wClassName,"weapon_decoy",false)==0)||(strcmp(wClassName,"weapon_molotov",false)==0)||
(strcmp(wClassName,"weapon_incgrenade",false)==0)||(strcmp(wClassName,"weapon_flashbang",false)==0)||(strcmp(wClassName,"weapon_smokegrenade",false)==0)||
(strcmp(wClassName,"weapon_tagrenade",false)==0)||(strcmp(wClassName,"weapon_diversion",false)==0)||(strcmp(wClassName,"weapon_snowball",false)==0))
else if((strcmp(wClassName,"weapon_hegrenade",false)==0)|| (strcmp(wClassName,"weapon_flashbang",false)==0)||(strcmp(wClassName,"weapon_smokegrenade",false)==0))
return 3;
else if((strcmp(wClassName,"weapon_p90",false)==0)||(strcmp(wClassName,"weapon_ak47",false)==0)||(strcmp(wClassName,"weapon_m4a1",false)==0)||
(strcmp(wClassName,"weapon_m249",false)==0)||(strcmp(wClassName,"weapon_bizon",false)==0)||(strcmp(wClassName,"weapon_negev",false)==0)||
(strcmp(wClassName,"weapon_m4a1_silencer",false)==0)||(strcmp(wClassName,"weapon_aug",false)==0)||(strcmp(wClassName,"weapon_awp",false)==0)||
(strcmp(wClassName,"weapon_famas",false)==0)||(strcmp(wClassName,"weapon_g3sg1",false)==0)||(strcmp(wClassName,"weapon_galilar",false)==0)||
(strcmp(wClassName,"weapon_scar20",false)==0)||(strcmp(wClassName,"weapon_ssg08",false)==0)||(strcmp(wClassName,"weapon_ump45",false)==0)||
(strcmp(wClassName,"weapon_xm1014",false)==0)||(strcmp(wClassName,"weapon_mac10",false)==0)||(strcmp(wClassName,"weapon_mag7",false)==0)||
(strcmp(wClassName,"weapon_mp7",false)==0)||(strcmp(wClassName,"weapon_mp9",false)==0)||(strcmp(wClassName,"weapon_nova",false)==0)||
(strcmp(wClassName,"weapon_sawedoff",false)==0)||(strcmp(wClassName,"weapon_sg556",false)==0)||(strcmp(wClassName,"weapon_galil",false)==0)||
(strcmp(wClassName,"weapon_m249",false)==0)||(strcmp(wClassName,"weapon_aug",false)==0)||(strcmp(wClassName,"weapon_awp",false)==0)||
(strcmp(wClassName,"weapon_famas",false)==0)||(strcmp(wClassName,"weapon_g3sg1",false)==0)||(strcmp(wClassName,"weapon_ump45",false)==0)||
(strcmp(wClassName,"weapon_xm1014",false)==0)||(strcmp(wClassName,"weapon_mac10",false)==0)||(strcmp(wClassName,"weapon_galil",false)==0)||
(strcmp(wClassName,"weapon_m3",false)==0)||(strcmp(wClassName,"weapon_mp5navy",false)==0)||(strcmp(wClassName,"weapon_scout",false)==0)||
(strcmp(wClassName,"weapon_sg550",false)==0)||(strcmp(wClassName,"weapon_sg552",false)==0)||(strcmp(wClassName,"weapon_tmp",false)==0))
return 0;
else if((strcmp(wClassName,"weapon_c4",false)==0)||(strcmp(wClassName,"weapon_breachcharge",false)==0)||(strcmp(wClassName,"weapon_bumpmine",false)==0)||
(strcmp(wClassName,"weapon_healthshot",false)==0)||(strcmp(wClassName,"weapon_shield",false)==0))
else if(strcmp(wClassName,"weapon_c4",false)==0)
return 4;
else return -1;
}
Expand Down
16 changes: 8 additions & 8 deletions addons/sourcemod/scripting/entwatch_dz.sp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Plugin myinfo =
name = "EntWatch",
author = "DarkerZ[RUS], AgentWesker, notkoen, sTc2201, maxime1907, Cmer, .Rushaway, Dolly",
description = "Notify players about entity interactions.",
version = "3.DZ.69",
version = "3.DZ.70",
url = "dark-skill.ru"
};

Expand Down Expand Up @@ -399,14 +399,14 @@ stock void EWM_Drop_Forward(Handle hEvent)
Call_Finish();
#endif

int iWeaponSlotCSGO = GetSlotCSGO(ItemTest.WeaponID);
if(IsValidEdict(ItemTest.WeaponID) && iWeaponSlotCSGO != -1)
int iWeaponSlot = GetWeaponSlot(ItemTest.WeaponID);
if(IsValidEdict(ItemTest.WeaponID) && iWeaponSlot != -1)
{
#if defined EW_MODULE_CLANTAG
EWM_Clantag_Reset(iClient);
#endif

if(ItemTest.ForceDrop || (!ItemTest.ForceDrop && iWeaponSlotCSGO != 2))
if(ItemTest.ForceDrop || (!ItemTest.ForceDrop && iWeaponSlot != 2))
{
#if defined EW_MODULE_CHAT
if(ItemTest.Chat) EWM_Chat_PlayerDeath_Drop(ItemTest, iClient);
Expand All @@ -416,7 +416,7 @@ stock void EWM_Drop_Forward(Handle hEvent)
}
else
{
if(iWeaponSlotCSGO == 2)
if(iWeaponSlot == 2)
{
#if defined EW_MODULE_CHAT
if(ItemTest.Chat) EWM_Chat_PlayerDeath(ItemTest, iClient);
Expand Down Expand Up @@ -512,8 +512,8 @@ public void Event_ClientDisconnect(Handle event, const char[] name, bool dontBro
Call_Finish();
#endif

int iWeaponSlotCSGO = GetSlotCSGO(ItemTest.WeaponID);
if(IsValidEdict(ItemTest.WeaponID) && iWeaponSlotCSGO != -1)
int iWeaponSlot = GetWeaponSlot(ItemTest.WeaponID);
if(IsValidEdict(ItemTest.WeaponID) && iWeaponSlot != -1)
{
if(ItemTest.ForceDrop)
{
Expand All @@ -524,7 +524,7 @@ public void Event_ClientDisconnect(Handle event, const char[] name, bool dontBro
}
else
{
if(iWeaponSlotCSGO == 2)
if(iWeaponSlot == 2)
{
#if defined EW_MODULE_CHAT
if(ItemTest.Chat) EWM_Chat_Disconnect(ItemTest, iClient);
Expand Down

0 comments on commit 92f6c54

Please sign in to comment.