alliedmodders / amxmodx

AMX Mod X - Half-Life 1 Scripting and Administration
http://www.amxmodx.org/
498 stars 202 forks source link

user_kill/user_silentkill flag parameter not working as expected #702

Open OciXCrom opened 5 years ago

OciXCrom commented 5 years ago

Both of these functions have a "flag" parameter with the following description:

If nonzero, the death will not affect the client's score

This doesn't seem to be true. Here's a simple code for testing:

#include <amxmodx>

public plugin_init()
{
    register_plugin("user_(silent)kill test", "1.0", "OciXCrom")
    register_clcmd("say /killme", "Cmd_KillMe")
}

public Cmd_KillMe(id)
{
    user_silentkill(id, 1)
    return PLUGIN_HANDLED
}

Assuming that our score is 0/0 before using the command, it should stay 0/0 after using it as well. That's not the case though. Using the command sets the score to -1/1 and after you respawn it becomes 0/1.

Arkshine commented 5 years ago

After the function to kill the player is called, the original player's frag is restored but no ScoreInfo message is sent to update the client's scoreboard. Likely because this message is going to be called by the game on player's spawn.