sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Add weapon_bayonet to the list of blocked knives

Open TrueProfesional opened this issue 2 years ago • 5 comments

TrueProfesional avatar Apr 23 '22 18:04 TrueProfesional

This needs a description with the reason for the change.

asherkin avatar Apr 23 '22 19:04 asherkin

This needs a description with the reason for the change.

Using GiveNamedItem (GivePlayerItem) for giving players items that are not in their inventory is not allowed in CS:GO.

It's said in the Game Server Operation Guidelines.

– Allowing players to claim temporary ownership of CS:GO items that are not in their inventory (Weapon skins, knives, etc.).

The code in which I made a change is used to block giving those items if you don't set "FollowCSGOServerGuidelines" to "no" in the core.cfg SourceMod config.

@psychonic made that check in #486, at https://github.com/alliedmodders/sourcemod/pull/486/commits/b65de29c920701b48310bd7bff579a0c3689cbe3 (here) so people wouldn't get banned.

His comments say that the knives that aren't allowed follow the pattern weapon_knife_*, however that's not true for one knife - weapon_bayonet, so that's why I added it.

TrueProfesional avatar Apr 23 '22 20:04 TrueProfesional

You might want to add weapon_karambit too.

Vauff avatar Apr 24 '22 14:04 Vauff

You might want to add weapon_karambit too.

But that.. doesn't exist (?) I don't see it defined anywhere and it doesn't work.

Attempted to create unknown entity type weapon_karambit! NULL Ent in GiveNamedItem!

TrueProfesional avatar Apr 24 '22 15:04 TrueProfesional

But that.. doesn't exist (?) I don't see it defined anywhere and it doesn't work.

Yeah I searched a bit and it seems I was mistaken. I could've sworn it was similar to the bayonet, as I had similar issues doing weapon_knife_* matching on a karambit before.

Vauff avatar Apr 28 '22 07:04 Vauff

Hello @asherkin @psychonic @peace-maker etc. etc.

I want inform that between these build:

DEV SM 1.12 - 6958
DEV SM 1.12 - 6954

...server crash when use SDKTools DispatchSpawn("weapon_hegrenade") on version 6958. Again, it works fine on version 6954 and on other previous build, included STABLE SM 1.11

Plugin Weapon Restrict would cause that crash. And I managed to follow code to DispatchSpawn("weapon_hegrenade")

Here is simple problematic code.

#include <sdktools>

public void OnConfigsExecuted()
{
	CreateTimer(10.0, delay)
}

public Action delay(Handle timer)
{
	int iEnt = CreateEntityByName("weapon_hegrenade");

	if(iEnt)
	{
		DispatchSpawn(iEnt);
		//iGrenadeAmmoIndex[i] = GetEntProp(iEnt, Prop_Send, "m_iPrimaryAmmoType");
		//AcceptEntityInput(iEnt, "Kill");
	}

	return Plugin_Continue;
}
  • I tested on Windows.
  • This person mentioned Linux #2247

Hope you find this bug. Good day!

*edit Could it be this ? ...nope

https://github.com/alliedmodders/sourcemod/compare/0d61792...174bf30

ambaca avatar Jan 20 '23 06:01 ambaca

From a quick look, we're crashing in CBaseCombatWeapon::GetWorldDroppedModel because CCSWeaponSystem::WeaponData(defidx) returns null and the game tries to dereference it. Wasn't there some problem with creating weapon entities using CreateEntityByName vs. GivePlayerItem ever since csgo introduced the ECON system? @Drifter321

I don't see how that would behave differently between build 6954 and 6958. The hl2sdk-csgo wasn't changed in between, but I think the buildbot was updated to build against metamod 1.12. Only the MCV changes could be a problem, but I don't see how? We'd have to bisect a bit to be sure.

peace-maker avatar Jan 20 '23 15:01 peace-maker

https://github.com/alliedmodders/sourcemod/pull/1887/files#diff-839ccf13838a98272d4e89028f66b030ae541f6206118f1d59be7cee5557f9d8

Line 1023 in vnatives.cpp should have been an && instead of ||

psychonic avatar Jan 20 '23 15:01 psychonic

Fixed in d5a26adc.

psychonic avatar Jan 20 '23 15:01 psychonic