Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <cstrike>
- #include <hamsandwich>
- #include <fakemeta_util>
- #define PLUGIN "RESPAWN"
- #define VERSION "0.1b"
- #define AUTHOR "amx-x.ru DEV-team"
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- RegisterHam(Ham_Spawn, "player", "SPAWN_POST", 1)
- register_event("DeathMsg", "EVENT_Death", "a")
- register_clcmd("say /respawn", "TASK_RESPAWNN")
- register_clcmd("say_team /respawn", "TASK_RESPAWNN")
- }
- public client_putinserver(id)
- set_task(5.0, "TASK_RESPAWN", id)
- public SPAWN_POST(id) {
- if(is_user_connected(id) && is_user_alive(id) && get_user_team(id) != 3) {
- new Item[256],
- ItemLen = charsmax(Item)
- formatex(Item, ItemLen, "%s", get_user_team(id) == 1 ? "weapon_glock18" : "weapon_usp")
- fm_give_item(id, Item)
- fm_give_item(id, "weapon_knife")
- cs_set_user_bpammo(id, CSW_USP, 90)
- cs_set_user_bpammo(id, CSW_GLOCK18, 90)
- }
- }
- public EVENT_Death() {
- new Killer = read_data(1),
- Victim = read_data(2)
- if(is_user_connected(Killer) && is_user_connected(Victim))
- set_task(1.0, "TASK_RESPAWN", Victim)
- }
- public TASK_RESPAWNN(id) {
- if(is_user_connected(id))
- ExecuteHamB(Ham_CS_RoundRespawn,id);
- }
- public TASK_RESPAWN(id) {
- if(is_user_connected(id) && !is_user_alive(id)) {
- if(get_user_team(id) == 3) {
- switch(random_num(1,2)) {
- case 1:
- cs_set_user_team(id, CS_TEAM_T)
- case 2:
- cs_set_user_team(id, CS_TEAM_CT)
- }
- }
- ExecuteHamB(Ham_CS_RoundRespawn,id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement