View Single Post
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 06-16-2021 , 04:41   [CS:GO] Crash after giving weapon_healthshot
Reply With Quote #1

I have a plugin which sometimes gives a weapon_healthshot item to a random player :
PHP Code:
int item GivePlayerItem(client"weapon_healthshot"); 
A few seconds after using this item my server crashes in about 1 out of 5 cases.

To analyse the problem I added a PlayerRunCmd prehook, where I iterate through m_hMyWeapons[64] of the player and print all not item_* and weapon_* entities.

Here is the log:
PHP Code:
L 06/15/2021 20:34:16: [test.smxGive"weapon_healthshot" with index 138 to player Fin.
L 06/15/2021 20:39:16: [test.smxImproper item "trigger_teleport " with index 138 in the invenory of Fin
The second line is printed in the PlayerRunCmd hook a few seconds after the player uses weapon_healthshot, then the server crashes.
My question is how such random items get to the inventory and why they have the same index as the weapon_healthshot which the plugin gives to players.
Is it caused by GivePlayerItem?

Yesterday I got a lot of "Improper..." for a player before the server crashed. Strange thing was that somewhere in the middle of the messages there were ~2 seconds without these logs and then all the rest "Improper..." were printed with another entity name. So the player at the begining had a weapon_healthshot in the inventory, then it was replaced to trigger_teleport and then to prop_dynamic_glow. The crash happend when the player left the game.

Last edited by kadet.89; 06-16-2021 at 05:42.
kadet.89 is offline
Send a message via Skype™ to kadet.89