Yo, i made this plugin for switch all dead CT to T on last round before change map for basebuilder
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <csstats>
#include <csx>
#include <xs>
public plugin_init() {
register_plugin("Switch Dead CT to T on Last Round", "1.0", "Ace67");
register_event("Round_End", "round_end_event", "a", "1=1");
}
public round_end_event(id) {
if (cs_get_user_team(id) == CS_TEAM_CT && !is_user_alive(id)) {
cs_set_user_team(id, CS_TEAM_T);
client_print(id, print_chat, "You have been moved to the Terrorist team for the last round.");
Respawn_Zombie(id);
}
}
public Respawn_Zombie(id) {
if (is_user_connected(id) && cs_get_user_team(id) == CS_TEAM_T) {
if (get_user_health(id) == 6500 || !is_user_alive(id)) {
ExecuteHamB(Ham_CS_RoundRespawn, id);
} else {
client_print(id, print_center, "%L", LANG_SERVER, "FAIL_RESPAWN");
}
}
}
Got error:
PHP Code:
L 11/02/2023 - 15:17:54: Invalid event (name "Round_End") (plugin "lastround.amxx")
L 11/02/2023 - 15:17:54: [AMXX] Displaying debug trace (plugin "lastround.amxx", version "1.0")
L 11/02/2023 - 15:17:54: [AMXX] Run time error 10: native error (native "register_event")
L 11/02/2023 - 15:17:54: [AMXX] [0] lastround.sma::plugin_init (line 14)
I'm using the function respawn from basebuilder so that's not affecting it.
__________________