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

[CSS/CS:GO] Weapon Restrict


Post New Thread Reply   
 
Thread Tools Display Modes
root88
Senior Member
Join Date: May 2016
Old 12-11-2018 , 03:16   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2111

Quote:
Originally Posted by Dr!fter View Post
No, you just don’t bother to read.
You were very helpful, thanks. So f****** helpful! If you refuse to support your plugin after updates I think it should be unapproved. Am I wrong?
Temp fix in case someone is using new items (tested only with breach charge):
in restrictinc/weapon-tracking.sp change CSWeaponID to:
PHP Code:
CSWeaponID GetWeaponIDFromEnt(int entity)
{
    if(!
IsValidEdict(entity))
        return 
CSWeapon_NONE;
    
    
char classname[64]; 
    
GetEntityClassname(entityclassnamesizeof classname); 
    if(
StrEqual(classname"weapon_melee") || StrEqual(classname"weapon_breachcharge") || StrEqual(classname"weapon_axe") || StrEqual(classname"weapon_hammer") || StrEqual(classname"weapon_spanner") || StrEqual(classname"weapons_fists"))
    {
        return 
CSWeapon_NONE;
    }
    
    
int index hWeaponTracker.FindValue(entityTracker_EntityIndex);
    
    if(
index != -1)
    {
        return 
hWeaponTracker.Get(indexTracker_WeaponIDIndex);
    }
    
    return 
CSWeapon_NONE;

__________________
root88 is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 12-11-2018 , 04:41   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2112

Quote:
Originally Posted by root88 View Post
You were very helpful, thanks. So f****** helpful! If you refuse to support your plugin after updates I think it should be unapproved. Am I wrong?
Temp fix in case someone is using new items (tested only with breach charge):
in restrictinc/weapon-tracking.sp change CSWeaponID to:
PHP Code:
CSWeaponID GetWeaponIDFromEnt(int entity)
{
    if(!
IsValidEdict(entity))
        return 
CSWeapon_NONE;
    
    
char classname[64]; 
    
GetEntityClassname(entityclassnamesizeof classname); 
    if(
StrEqual(classname"weapon_melee") || StrEqual(classname"weapon_breachcharge") || StrEqual(classname"weapon_axe") || StrEqual(classname"weapon_hammer") || StrEqual(classname"weapon_spanner") || StrEqual(classname"weapons_fists"))
    {
        return 
CSWeapon_NONE;
    }
    
    
int index hWeaponTracker.FindValue(entityTracker_EntityIndex);
    
    if(
index != -1)
    {
        return 
hWeaponTracker.Get(indexTracker_WeaponIDIndex);
    }
    
    return 
CSWeapon_NONE;

Since you want to be a smart ass. The error you posted doesn’t match the SM 1.9 version. So if you are using the sm 1.9 version fucking mention that. Also, considering the update happened less than a week ago and I didn’t update it I wonder what other plugins should be unapproved. I’ve maintained this plugin for over 9 years so clearly I must update it within 24 hours.

Oh, yea, https://github.com/alliedmodders/sourcemod/pull/929

Shockingly i already was working on it.

The error if you’re actually using SM 1.9 version is in csweapons_isvalidid since it doesn’t check against the enum to see if the id is greater than the max.

Last edited by asherkin; 12-11-2018 at 07:58. Reason: :3
Dr!fter is offline
root88
Senior Member
Join Date: May 2016
Old 12-18-2018 , 06:10   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2113

Temp fix in case someone is using this version in CSGO and also weapon_snowball / sv_holiday_mode 2 or from last update and have logs spammed:
in restrictinc/weapon-tracking.sp change CSWeaponID to:
PHP Code:
CSWeaponID GetWeaponIDFromEnt(int entity)
{
    if(!
IsValidEdict(entity))
        return 
CSWeapon_NONE;
    
    
char classname[64]; 
    
GetEntityClassname(entityclassnamesizeof classname); 
    if(
StrEqual(classname"weapon_snowball"))
    {
        return 
CSWeapon_NONE;
    }
    
    
int index hWeaponTracker.FindValue(entityTracker_EntityIndex);
    
    if(
index != -1)
    {
        return 
hWeaponTracker.Get(indexTracker_WeaponIDIndex);
    }
    
    return 
CSWeapon_NONE;

__________________
root88 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-18-2018 , 07:10   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2114

@root88 root88...

What if you use some cstrike natives ? https://sm.alliedmods.net/new-api/cstrike

hmmm like
Code:
#include <sdktools>
#include <cstrike>

public void OnPluginStart()
{
	RegConsoleCmd("sm_test", test);
}

public Action test(int client, int args)
{

	char classname[MAX_NAME_LENGTH];
	char alias[MAX_NAME_LENGTH];
	int entity = -1;

	while( (entity = FindEntityByClassname(entity, "*")) != -1 ) // Loop all entities
	{
		GetEntityClassname(entity, classname, sizeof(classname));

		CS_GetTranslatedWeaponAlias(classname, alias, sizeof(alias));
		CSWeaponID weaponid = CS_AliasToWeaponID(alias);

		if(!CS_IsValidWeaponID(weaponid)) continue; // skip invalid weapon and continue loop

		PrintToServer("entity '%i' classname '%s' alias '%s' weaponid '%i'", entity, classname, alias, weaponid);

	}

	return Plugin_Handled;
}
I got this output
Code:
entity '529' classname 'weapon_knife' alias 'knife' weaponid '28'
entity '532' classname 'weapon_hkp2000' alias 'hkp2000' weaponid '41'
entity '165' classname 'weapon_snowball' alias 'snowball' weaponid '84'
*edit
Or do you still get errors from weapon restrict plugin ?? :S
__________________
Do not Private Message @me

Last edited by Bacardi; 12-18-2018 at 07:20.
Bacardi is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 12-18-2018 , 12:41   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2115

If you use the latest 1.9 version you should get no error with snowball. I updated it last weekend.
Dr!fter is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-19-2018 , 11:41   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2116

Quote:
Originally Posted by Dr!fter View Post
If you use the latest 1.9 version you should get no error with snowball. I updated it last weekend.
errors after update csgo:
PHP Code:
L 12/19/2018 00:00:07SourceMod error session started
L 12
/19/2018 00:00:07Info (map "de_dust2") (file "errors_20181219.log")
L 12/19/2018 00:00:07: [SMException reported: Array index out-of-bounds (index 84limit 69)
L 12/19/2018 00:00:07: [SMBlamingAddons_weapon_restrict.smx
L 12
/19/2018 00:00:07: [SMCall stack trace:
L 12/19/2018 00:00:07: [SM]   [1Line 393restrictinc/natives.sp::Native_GetRestrictValue
L 12
/19/2018 00:00:07: [SM]   [3Restrict_GetRestrictValue
L 12
/19/2018 00:00:07: [SM]   [4Line 652restrictinc/natives.sp::Native_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [6Restrict_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [7Line 74restrictinc/events.sp::OnWeaponCanUse
L 12
/19/2018 00:00:07: [SMException reportedStack leak detectedsp:92700 should be 92732!
L 12/19/2018 00:00:07: [SMBlamingAddons_weapon_restrict.smx
L 12
/19/2018 00:00:07: [SMCall stack trace:
L 12/19/2018 00:00:07: [SM]   [0Restrict_GetRestrictValue
L 12
/19/2018 00:00:07: [SM]   [1Line 652restrictinc/natives.sp::Native_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [3Restrict_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [4Line 74restrictinc/events.sp::OnWeaponCanUse
L 12
/19/2018 00:00:07: [SMException reportedWeapon slot index -1 is invalid.
L 12/19/2018 00:00:07: [SMBlamingAddons_weapon_restrict.smx
L 12
/19/2018 00:00:07: [SMCall stack trace:
L 12/19/2018 00:00:07: [SM]   [0ThrowNativeError
L 12
/19/2018 00:00:07: [SM]   [1Line 510restrictinc/natives.sp::Native_GetWeaponIDFromSlot
L 12
/19/2018 00:00:07: [SM]   [3Restrict_GetWeaponIDFromSlot
L 12
/19/2018 00:00:07: [SM]   [4Line 365restrictinc/natives.sp::Native_GetTeamWeaponCount
L 12
/19/2018 00:00:07: [SM]   [6Restrict_GetTeamWeaponCount
L 12
/19/2018 00:00:07: [SM]   [7Line 653restrictinc/natives.sp::Native_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [9Restrict_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [10Line 74restrictinc/events.sp::OnWeaponCanUse 

Last edited by Dr.Mohammad; 12-19-2018 at 11:42.
Dr.Mohammad is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 12-20-2018 , 06:22   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2117

Quote:
Originally Posted by Dr.Mohammad View Post
errors after update csgo:
PHP Code:
L 12/19/2018 00:00:07SourceMod error session started
L 12
/19/2018 00:00:07Info (map "de_dust2") (file "errors_20181219.log")
L 12/19/2018 00:00:07: [SMException reported: Array index out-of-bounds (index 84limit 69)
L 12/19/2018 00:00:07: [SMBlamingAddons_weapon_restrict.smx
L 12
/19/2018 00:00:07: [SMCall stack trace:
L 12/19/2018 00:00:07: [SM]   [1Line 393restrictinc/natives.sp::Native_GetRestrictValue
L 12
/19/2018 00:00:07: [SM]   [3Restrict_GetRestrictValue
L 12
/19/2018 00:00:07: [SM]   [4Line 652restrictinc/natives.sp::Native_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [6Restrict_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [7Line 74restrictinc/events.sp::OnWeaponCanUse
L 12
/19/2018 00:00:07: [SMException reportedStack leak detectedsp:92700 should be 92732!
L 12/19/2018 00:00:07: [SMBlamingAddons_weapon_restrict.smx
L 12
/19/2018 00:00:07: [SMCall stack trace:
L 12/19/2018 00:00:07: [SM]   [0Restrict_GetRestrictValue
L 12
/19/2018 00:00:07: [SM]   [1Line 652restrictinc/natives.sp::Native_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [3Restrict_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [4Line 74restrictinc/events.sp::OnWeaponCanUse
L 12
/19/2018 00:00:07: [SMException reportedWeapon slot index -1 is invalid.
L 12/19/2018 00:00:07: [SMBlamingAddons_weapon_restrict.smx
L 12
/19/2018 00:00:07: [SMCall stack trace:
L 12/19/2018 00:00:07: [SM]   [0ThrowNativeError
L 12
/19/2018 00:00:07: [SM]   [1Line 510restrictinc/natives.sp::Native_GetWeaponIDFromSlot
L 12
/19/2018 00:00:07: [SM]   [3Restrict_GetWeaponIDFromSlot
L 12
/19/2018 00:00:07: [SM]   [4Line 365restrictinc/natives.sp::Native_GetTeamWeaponCount
L 12
/19/2018 00:00:07: [SM]   [6Restrict_GetTeamWeaponCount
L 12
/19/2018 00:00:07: [SM]   [7Line 653restrictinc/natives.sp::Native_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [9Restrict_CanPickupWeapon
L 12
/19/2018 00:00:07: [SM]   [10Line 74restrictinc/events.sp::OnWeaponCanUse 
sm plugins list
Dr!fter is offline
Razvann.
Senior Member
Join Date: Jul 2012
Old 01-04-2019 , 08:43   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2118

L 01/04/2019 - 15:163: [SM] Exception reported: Array index out-of-bounds (index 63, limit 55)
L 01/04/2019 - 15:163: [SM] Blaming: weapon_restrict.smx
L 01/04/2019 - 15:163: [SM] Call stack trace:
L 01/04/2019 - 15:163: [SM] [1] Line 202, restrictinc/events.sp::CS_OnBuyCommand
L 01/04/2019 - 15:23:09: Error log file session closed.

Default server with few plugins like Reset, rank and last sm 1.9

Last edited by Razvann.; 01-04-2019 at 08:46.
Razvann. is offline
Send a message via Yahoo to Razvann.
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-05-2019 , 03:39   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2119

Quote:
Originally Posted by Razvann. View Post
L 01/04/2019 - 15:163: [SM] Exception reported: Array index out-of-bounds (index 63, limit 55)
L 01/04/2019 - 15:163: [SM] Blaming: weapon_restrict.smx
L 01/04/2019 - 15:163: [SM] Call stack trace:
L 01/04/2019 - 15:163: [SM] [1] Line 202, restrictinc/events.sp::CS_OnBuyCommand
L 01/04/2019 - 15:23:09: Error log file session closed.

Default server with few plugins like Reset, rank and last sm 1.9
if game is CSGO, zip pack in first post is old.
Update fixed one is into link https://bitbucket.org/Drifter321/wea...tip/?at=SM-1.9

- Get plugin from compiled folder
- Place WeaponRestrict.phrases.txt file in your server translations folder


-
https://bitbucket.org/Drifter321/wea.../?tab=branches

Last edited by Bacardi; 01-08-2019 at 06:39.
Bacardi is offline
r3v
Senior Member
Join Date: Feb 2016
Location: Lithuania, Vilnius
Old 01-05-2019 , 07:00   Re: [CSS/CS:GO] Weapon Restrict
Reply With Quote #2120

CS:GO Windows/Linux server, last SM and WR 4.0.0-b5 version.

Everything is good, but command "sm_restrict Grenades 0" or "sm_restrict Grenades 0 both" gives this error on a new round...

PHP Code:
L 01/05/2019 13:47:04SourceMod error session started
L 01
/05/2019 13:47:04Info (map "workshop/1224991873/$2000$") (file "errors_20190105.log")
L 01/05/2019 13:47:04: [SMException reportedWeapon id 81 is not a grenade.
L 01/05/2019 13:47:04: [SMBlamingweapon_restrict.smx
L 01
/05/2019 13:47:04: [SMCall stack trace:
L 01/05/2019 13:47:04: [SM]   [0ThrowNativeError
L 01
/05/2019 13:47:04: [SM]   [1Line 488restrictinc/natives.sp::Native_GetClientGrenadeCount
L 01
/05/2019 13:47:04: [SM]   [3Restrict_GetClientGrenadeCount
L 01
/05/2019 13:47:04: [SM]   [4Line 356restrictinc/natives.sp::Native_GetTeamWeaponCount
L 01
/05/2019 13:47:04: [SM]   [6Restrict_GetTeamWeaponCount
L 01
/05/2019 13:47:04: [SM]   [7Line 842restrictinc/natives.sp::Native_CheckPlayerWeapons
L 01
/05/2019 13:47:04: [SM]   [9Restrict_CheckPlayerWeapons
L 01
/05/2019 13:47:04: [SM]   [10Line 188restrictinc/events.sp::EventRoundStart
L 01
/05/2019 13:47:56: [SMException reportedWeapon id 81 is not a grenade.
L 01/05/2019 13:47:56: [SMBlamingweapon_restrict.smx
L 01
/05/2019 13:47:56: [SMCall stack trace:
L 01/05/2019 13:47:56: [SM]   [0ThrowNativeError
L 01
/05/2019 13:47:56: [SM]   [1Line 488restrictinc/natives.sp::Native_GetClientGrenadeCount
L 01
/05/2019 13:47:56: [SM]   [3Restrict_GetClientGrenadeCount
L 01
/05/2019 13:47:56: [SM]   [4Line 356restrictinc/natives.sp::Native_GetTeamWeaponCount
L 01
/05/2019 13:47:56: [SM]   [6Restrict_GetTeamWeaponCount
L 01
/05/2019 13:47:56: [SM]   [7Line 842restrictinc/natives.sp::Native_CheckPlayerWeapons
L 01
/05/2019 13:47:56: [SM]   [9Restrict_CheckPlayerWeapons
L 01
/05/2019 13:47:56: [SM]   [10Line 188restrictinc/events.sp::EventRoundStart
L 01
/05/2019 13:48:11: [SMException reportedWeapon id 81 is not a grenade.
L 01/05/2019 13:48:11: [SMBlamingweapon_restrict.smx
L 01
/05/2019 13:48:11: [SMCall stack trace:
L 01/05/2019 13:48:11: [SM]   [0ThrowNativeError
L 01
/05/2019 13:48:11: [SM]   [1Line 488restrictinc/natives.sp::Native_GetClientGrenadeCount
L 01
/05/2019 13:48:11: [SM]   [3Restrict_GetClientGrenadeCount
L 01
/05/2019 13:48:11: [SM]   [4Line 356restrictinc/natives.sp::Native_GetTeamWeaponCount
L 01
/05/2019 13:48:11: [SM]   [6Restrict_GetTeamWeaponCount
L 01
/05/2019 13:48:11: [SM]   [7Line 842restrictinc/natives.sp::Native_CheckPlayerWeapons
L 01
/05/2019 13:48:11: [SM]   [9Restrict_CheckPlayerWeapons
L 01
/05/2019 13:48:11: [SM]   [10Line 188restrictinc/events.sp::EventRoundStart
L 01
/05/2019 13:48:23Error log file session closed

Last edited by r3v; 01-05-2019 at 07:05.
r3v 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 12:40.


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