mam plugin
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Spec/Back" #define AUTHOR "kramesa" #define VERSION "v1.1" new bool:TerroristTeam[33]; new CountTime[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /spec", "Spec"); register_clcmd("say /back", "Back"); register_cvar("amx_spectimes", "3"); } public Spec(id) { if(CountTime[id] >= get_cvar_num("amx_spectimes")) { client_print(id, print_chat, "[AMXX] Sorry, you cant use this command more of %d times.", get_cvar_num("amx_spectimes")); return PLUGIN_HANDLED; } if(cs_get_user_team(id) == CS_TEAM_T) { TerroristTeam[id] = true; } else { TerroristTeam[id] = false; } if(cs_get_user_team(id) == CS_TEAM_SPECTATOR) { client_print(id, print_chat, "[AMXX] You already Spectator."); return PLUGIN_HANDLED; } else { cs_set_user_team(id, CS_TEAM_SPECTATOR); user_kill(id, 1); client_print(id, print_chat, "[AMXX] You are now in Spectator."); CountTime[id]++; return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } public Back(id) { if(cs_get_user_team(id) != CS_TEAM_SPECTATOR) { client_print(id, print_chat, "[AMXX] You already Non-Spectator."); return PLUGIN_HANDLED; } if(cs_get_user_team(id) == CS_TEAM_SPECTATOR) { if(TerroristTeam[id] == true) { cs_set_user_team(id, CS_TEAM_T); client_print(id, print_chat, "[AMXX] You are now in Terrorist team."); cs_set_user_deaths(id, 0); ExecuteHam(Ham_CS_RoundRespawn, id); return PLUGIN_HANDLED; } if(TerroristTeam[id] == false) { cs_set_user_team(id, CS_TEAM_CT); client_print(id, print_chat, "[AMXX] You are now in Counter-Terrorist team."); cs_set_user_deaths(id, 0); ExecuteHam(Ham_CS_RoundRespawn, id); return PLUGIN_HANDLED; } } return PLUGIN_HANDLED; }
jak zrobić żeby on nie resetował "zginięć " do zera po wpisaniu /back
Użytkownik City edytował ten post 14.08.2013 16:28