Is it possible to catch the player_death and not send the message of who killed who to clients?
Thanks in advance
Edit: Another question i have is would it be possible to access the users ranking stats csgo clients have?
Player_death break before death message?
Much like this post, you can set the bDontBroadcast value to True in player_death:
Players still receive money for kills, but the death notices are not displayed. If you just want to do this to specific clients, it will require a different approach.
As for your other question, we don't have that functionality directly built-in to Source.Python, but you might be able to use dynamic/virtual functions to achieve that.
Syntax: Select all
from memory import get_object_pointer
from memory import make_object
from memory import Convention, Argument, Return
from events import GameEvent
from events.manager import GameEventManager
from memory.hooks import PreHook
from core import PLATFORM
FIRE_EVENT_FUNC = get_object_pointer(
GameEventManager).make_virtual_function(
7 if PLATFORM == 'windows' else 8,
Convention.THISCALL,
(Argument.POINTER, Argument.POINTER, Argument.BOOL),
Return.VOID
)
@PreHook(FIRE_EVENT_FUNC)
def pre_fire_event(arguments):
game_event = make_object(GameEvent, arguments[1])
if game_event.get_name() == 'player_death':
arguments[2] = True
Players still receive money for kills, but the death notices are not displayed. If you just want to do this to specific clients, it will require a different approach.
As for your other question, we don't have that functionality directly built-in to Source.Python, but you might be able to use dynamic/virtual functions to achieve that.
For Q2, couldn't you use this?
https://developer.valvesoftware.com/wiki/Steam_Web_API
There is a pre-made Python wrapper for it here: https://github.com/smiley/steamapi
https://developer.valvesoftware.com/wiki/Steam_Web_API
There is a pre-made Python wrapper for it here: https://github.com/smiley/steamapi
Here's another pre-made Python wrapper for the SteamWebAPI:
https://github.com/michaeljohnbarr/SteamWebAPI-Python
Both should work with Py2 and Py3, since they both require requests.
https://github.com/michaeljohnbarr/SteamWebAPI-Python
Both should work with Py2 and Py3, since they both require requests.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 75 guests