Raised This Month: $32 Target: $400
 8% 

Crash with CS_OnCSWeaponDrop


Post New Thread Reply   
 
Thread Tools Display Modes
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-13-2021 , 15:59   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #21

Good!

... though I started to create whole plugin instead fixing original one

But good to hear.
Bacardi is offline
_EverGreen_
Junior Member
Join Date: Feb 2021
Old 02-13-2021 , 16:17   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #22

The plugin is very good function, when T dropped bomb, any CT are be able to defuse on ground, i added morecolors.inc to the plugin for a better aspect on say etc but i stuck when any plugin fail because my little knowments . I uploaded the original one (not touched) from the autor here.
_EverGreen_ is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-14-2021 , 05:12   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #23

There's also a SDK_Hook function for weapon drop:

PHP Code:

public void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_WeaponDropPostSDK_OnWeaponDrop_Post);
}

public 
void SDK_OnWeaponDrop_Post(int clientint weapon)
{
    if (!
IsValidEntity(weapon))
    {
        return;
    }

    
char classname[256];
    
GetEntityClassname(weaponclassnamesizeof(classname));

    if (
StrEqual(classname"weapon_c4"true))
    {
        
// you should save the weapon reference here
        
g_C4Reference EntIndexToEntRef(weapon);
    }

__________________
Ilusion9 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-14-2021 , 06:14   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #24

I forgot that that totally, and even skip line to see that

I just was thinking, if C4 entity index is only thing to get, why not use simple event and use FindEntityByClassName.
+ Not need hook all players. Less plugin activity.

Either way, if only works, good.
Bacardi is offline
_EverGreen_
Junior Member
Join Date: Feb 2021
Old 02-14-2021 , 20:22   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #25

Quote:
Originally Posted by Bacardi View Post
I forgot that that totally, and even skip line to see that

I just was thinking, if C4 entity index is only thing to get, why not use simple event and use FindEntityByClassName.
+ Not need hook all players. Less plugin activity.

Either way, if only works, good.
Without a loop, your code above looks better.

If you want i be able to test the code above with SDK_Hook. But my server is 24/7 empty hahaha SAD!!! for test any performance issues.

Last edited by _EverGreen_; 02-14-2021 at 20:23.
_EverGreen_ is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-15-2021 , 06:20   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #26

Quote:
Originally Posted by _EverGreen_ View Post
If you want i be able to test the code above with SDK_Hook. But my server is 24/7 empty hahaha SAD!!! for test any performance issues.
you cannot see the difference between the two codes, it's not like players drop their weapons every frame.
and even if you do things every frame, in some cases you cannot see the difference.
__________________
Ilusion9 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-16-2021 , 01:29   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #27

@asherkin
I build SourceMod by this instruction https://wiki.alliedmods.net/Building_sourcemod (Python 3.9.1 + Visual Studio 2019 community FREE)
I tested again like in my previous posts and there is no crash anymore.

But when I unloaded my new 'game.cstrike.ext.2.css.dll' extension and replaced it with "original" from 1.11 - build 6655 pack, load test plugin again, crash happened again.

Also there is huge difference with file size with 'game.cstrike.ext.2.css.dll'
- My build 'game.cstrike.ext.2.css.dll': 630 kt
- From 1.11 - build 6655 zip 'game.cstrike.ext.2.css.dll': 229 kt

Here pic: Sourcemod extensions files vs. My build extensions files
https://drive.google.com/file/d/1QX7...ew?usp=sharing

Am I nut ?
__________________
Do not Private Message @me

Last edited by Bacardi; 02-16-2021 at 02:06.
Bacardi is offline
_EverGreen_
Junior Member
Join Date: Feb 2021
Old 02-17-2021 , 19:55   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #28

Quote:
Originally Posted by Bacardi View Post
@asherkin
I build SourceMod by this instruction https://wiki.alliedmods.net/Building_sourcemod (Python 3.9.1 + Visual Studio 2019 community FREE)
I tested again like in my previous posts and there is no crash anymore.

But when I unloaded my new 'game.cstrike.ext.2.css.dll' extension and replaced it with "original" from 1.11 - build 6655 pack, load test plugin again, crash happened again.

Also there is huge difference with file size with 'game.cstrike.ext.2.css.dll'
- My build 'game.cstrike.ext.2.css.dll': 630 kt
- From 1.11 - build 6655 zip 'game.cstrike.ext.2.css.dll': 229 kt

Here pic: Sourcemod extensions files vs. My build extensions files
https://drive.google.com/file/d/1QX7...ew?usp=sharing

Am I nut ?
Im little confused. You make new sourcemod build and check plugin again with CS_OnCSWeaponDrop and no more crashes?

Because with HookEvent you suggested previously, server crash no more.
_EverGreen_ is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-17-2021 , 21:19   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #29

@_EverGreen_ you can ignore that post. I was tracking the bug.
It continue on github page.
https://github.com/alliedmodders/sourcemod/issues/1427
__________________
Do not Private Message @me

Last edited by Bacardi; 02-17-2021 at 21:19.
Bacardi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-23-2021 , 02:42   Re: Crash with CS_OnCSWeaponDrop
Reply With Quote #30

Fixed

stable SourceMod 1.10 - build 6521
dev SourceMod 1.11 - build 6779
Bacardi 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 18:11.


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