Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <cstrike>
- #include <colorchat>
- #include <sockets>
- #include <hamsandwich>
- #define PLUGIN "Box Mod"
- #define VERSION "1.0"
- #define AUTHOR "RevCrew"
- new i_gCvarff;
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- RegisterHam(Ham_TakeDamage,"player","ham_TakeDamage",0);
- register_clcmd("say /box","box_m");
- }
- public box_m(id) {
- new menu = menu_create("What would you like to do?", "mHandler");
- menu_additem(menu, "Turn box on");
- menu_additem(menu, "Turn box off");
- if ((cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id)) || (get_user_flags(id) & ADMIN_LEVEL_C))
- {
- menu_display(id, menu);
- }
- else
- {
- ColorChat(id, NORMAL, "%s You have no access to that command");
- }
- }
- public mHandler(id, menu, item) {
- if(item == MENU_EXIT)
- {
- menu_destroy(menu);
- return;
- }
- i_gCvarff = get_cvar_pointer("mp_friendlyfire");
- switch(item)
- {
- case 0:
- {
- if (get_pcvar_num(i_gCvarff) != 0)
- {
- ColorChat(id, NORMAL, "Box mod has ^3already ^1been activated.")
- }
- else
- {
- server_cmd("mp_friendlyfire 1");
- ColorChat(id, NORMAL, "Box mod has been ^3activated^4!");
- set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0)
- show_hudmessage(id, "Box mod has been activated!")
- }
- }
- case 1:
- {
- if (get_pcvar_num(i_gCvarff) == 0)
- {
- ColorChat(id, NORMAL, "Box mod is ^3already ^1deactivated.")
- }
- else
- {
- server_cmd("mp_friendlyfire 0");
- ColorChat(id, NORMAL, "Box mod has been ^3deactivated^1!");
- set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
- show_hudmessage(id, "Box mod has been deactivated!")
- }
- }
- }
- }
- public ham_TakeDamage(const iVictim, const iInfector, const iAttacker)
- {
- if(is_user_alive(iAttacker) && cs_get_user_team(iVictim) == cs_get_user_team(iAttacker) && iVictim != iAttacker && get_cvar_num("mp_friendlyfire") == 1 && cs_get_user_team(iVictim) == CS_TEAM_CT)
- return HAM_SUPERCEDE;
- return HAM_IGNORED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement