I'm trying to change the score of a player (last column on the scoreboard), but I'm not sure how to do it.
Any ideas?
[CSGO] Getting and setting player score
- L'In20Cible
- Project Leader
- Posts: 1533
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: [CSGO] Getting and setting player score
→ Player.kills/deaths
Syntax: Select all
player = Player(index)
player.kills = 0
player.deaths = 999
print(f'{player.name} is a noob, check the scoreboard!')
Re: [CSGO] Getting and setting player score
Is there no way to directly change the score, without changing the player's kills?
When I change the player's assists, the score doesn't update, so I'm trying to correct that by changing the score itself.
When I change the player's assists, the score doesn't update, so I'm trying to correct that by changing the score itself.
- L'In20Cible
- Project Leader
- Posts: 1533
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: [CSGO] Getting and setting player score
What is your code?
Re: [CSGO] Getting and setting player score
Here's the code:
Syntax: Select all
#assists_test.py
from players.entity import Player
from commands import CommandReturn
from commands.client import ClientCommand
@ClientCommand('add_assist')
def _add_assist(command, index):
player = Player(index)
player.assists += 1
return CommandReturn.BLOCK
Re: [CSGO] Getting and setting player score
I know that the score is based off of kills and assists, but possibly also includes bomb detonations/defusals and hostage rescues. So, I'm not sure that modifying kills or assists would automatically change the score. I have looked into this a little, but I haven't figured out how to get/set the score in a plugin.
Re: [CSGO] Getting and setting player score
I just found this in SourceMod. Although I'm not sure how to do the exact same thing in SP.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 28 guests