tmp64 / BugfixedHL-Rebased

Bugfixed and improved Half-Life
GNU General Public License v3.0
113 stars 26 forks source link

/reset command for servers #29

Closed Mehmet-I closed 3 years ago

Mehmet-I commented 3 years ago

Hello Bro,

/reset command can be very useful. Because /reset plugins we tried in bugfixedhl do not work. It can be activated with a cvar. eg mp_resetscore 1

Thanks for your work.

tmp64 commented 3 years ago

Hi! I'm not going to add any score reset functionality into the server. However, I can add Server API functions to set player's score correctly.

tmp64 commented 3 years ago

I added SetPlayerScore method to Server API. You can use it from AMXX like this:

/*
 * Demo plugin for BugfixedAPI SetPlayerScore.
 * Based on CS1.6 Reset Score plugin by Silenttt.
*/

#include <amxmodx>
#include <bugfixedapi>

public plugin_init()
{
    register_plugin("BHL Reset Score", "1.0", "tmp64 + Silenttt")
    register_clcmd("say /rs", "reset_score")
}

public reset_score(id)
{
    // Args: player index, kills, deaths
    bhl_set_player_score(id, 0, 0)
    client_print(id, print_chat, "Score reset.")
}
Mehmet-I commented 3 years ago

Thx bro.