Raised This Month: $ Target: $400
 0% 

Spectating admin menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
No FuN
Member
Join Date: Mar 2004
Location: Bordeaux
Old 11-19-2011 , 06:13   Spectating admin menu
Reply With Quote #1

Hello,
I come to you because at the time I was using amx and there was a small handy menu.
When it was given freely and we target a player or that one was a spectator on a player, you just activate the menu and it offered to kick, ban etc. .. directly.
It was very convenient because we avoided spending much time looking for the player in the original menu.
I searched but I have not found.
I do not know if you see what I mean is, or if you can help me.
Sorry for my english, google translation.

Original plugin for amx
Here's why I ask. I am attempting to use a script for AMX called spectating_admin. Basically you just point at a player and you get all kinds of options (like slap, slay, kick, ban) makes it much easier to admin. Anyway, it works fine in CS. You point and click, and they die. But for some reason in NS, everytime I try it, it tells me that I'm not pointing at a player.
Code:
/* AMX Mod script.
*
* (c) Copyright 2002, OLO
* This file is provided as is (no warranties).
*
*/

/* admin with flag "m" must point someone (during spectating or when playing)
*  and use "say specmenu" (the best way is just binding the command)
*/


#include <amxmod>

new aspec[33]
new agot[33]

public status_changed(id)
  aspec[id] = read_data(2)

public do_action(id){
  if (!(get_user_flags(id)&ADMIN_LEVEL_A)){
  client_print(id,print_chat,"[AMX] You have no access to that command")
  return PLUGIN_HANDLED
 }
  if (aspec[id] == 0){
   client_print(id,print_chat,"[AMX] You must point at someone")
   return PLUGIN_HANDLED
  }
  if (get_user_flags(aspec[id])&ADMIN_IMMUNITY){
     client_print(id,print_chat,"[AMX] The player has immunity")
     return PLUGIN_HANDLED
  }
  agot[id] = aspec[id]
  new bmenu[256], name[32]
  get_user_name(agot[id],name,32)
  format(bmenu,256,"\ySpec Menu: %s^n\w^n1. Kick^n2. Ban on 5 min.^n3. Slay^n4. Slap^n5. Godmode^n6. Noclip^n7. Store My Origin^n8. Teleport^n^n0. Exit",name)
  show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<9),bmenu)
  return PLUGIN_CONTINUE
}

public action_menu(id,key){
  if (!is_user_connected(agot[id])){
     client_print(id,print_chat,"[AMX] This client has already exit the server")
     return PLUGIN_CONTINUE
  }
  switch(key){
     case 0: server_cmd("kick # %d",get_user_userid(agot[id]))
     case 1: {
        new temp[32]
        get_user_authid(agot[id],temp,32)
        server_cmd("banid 5.0 %s kick",temp)
     }
     case 2: user_kill(agot[id])
     case 3: user_slap(id,5)
     case 4: {
         if(get_user_godmode(agot[id]))
                 set_user_godmode(agot[id],0)
         else
                 set_user_godmode(agot[id],1)
      }
     case 5: {
         if(get_user_noclip(agot[id]))
                 set_user_noclip(agot[id],0)
         else
                 set_user_noclip(agot[id],1)
      }
      case 6: {
          client_cmd(id,"amx_myorigin")
          client_print(0,print_chat,"[AMX] Storing your origin....")
      }
      case 7: {
            new name[32+1]
            get_user_name(agot[id],name,32)
            client_cmd(id,"amx_teleport %s",name)
      }

  }
  return PLUGIN_CONTINUE
}

public amx_point(id) {
 if (!(get_user_flags(id)&ADMIN_LEVEL_A)){
  client_print(id,print_chat,"[AMX] You have no access to that command")
  return PLUGIN_HANDLED
 }
 if (aspec[id] == 0){
  client_print(id,print_chat,"[AMX] You must point at someone")
  return PLUGIN_HANDLED
 }
 if (get_user_flags(aspec[id])&ADMIN_IMMUNITY){
    client_print(id,print_chat,"[AMX] The player has immunity")
    return PLUGIN_HANDLED
 }
 new name[32+1]
 get_user_name(aspec[id],name,32)
 new cmd[128]
 read_args(cmd,128)
 client_cmd(id,cmd,name)
 return PLUGIN_HANDLED
}

public plugin_init() {
  register_plugin("Spectating Admin","0.61","default")
  register_event("StatusValue","status_changed","b","1=2")
  register_menucmd(register_menuid("\ySpec Menu: "),1023,"action_menu")
  register_clcmd("say specmenu","do_action",ADMIN_LEVEL_A,"say specmenu")
  register_clcmd("amx_point","amx_point",ADMIN_LEVEL_A,"amx_point < %s > < command >")
  return PLUGIN_CONTINUE
}
__________________

Last edited by No FuN; 11-19-2011 at 06:18.
No FuN is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-19-2011 , 07:30   Re: Spectating admin menu
Reply With Quote #2

You could create/add menu options in a menu for admins with a certain flag and add the following commands to execute:

sm_slay @aim
sm_kick @aim "reason"
sm_ban @aim time "reason"
sm_slay @aim damage

Not sure if those are the exact commands but you get the jist after @aim.

Code:
	"Quick Actions"
	{
		"Aim Slap"
		{
			"cmd"		"sm_slap @aim"
			"admin"		"sm_slay"
		}
		"Aim Slay"
		{
			"cmd"		"sm_slay @aim"
			"admin"		"sm_slay"
		}
		"Aim Kick"
		{
			"cmd"		"sm_kick @aim"
			"admin"		"sm_kick"
		}
		"Aim Mute"
		{
			"cmd"		"sm_mute @aim"
			"admin"		"sm_kick"
		}
		"Aim Ban"
		{
			"cmd"		"sm_ban @aim"
			"admin"		"sm_ban"
		}
	}

Last edited by Drixevel; 11-19-2011 at 07:35.
Drixevel is offline
No FuN
Member
Join Date: Mar 2004
Location: Bordeaux
Old 11-19-2011 , 08:46   Re: Spectating admin menu
Reply With Quote #3

Thank you for your answer but in fact the goal and avoid looking in the player menu.
You just a spectator to target a player or be on his sight. For orders or directly to the players.


player x

1 - Slap
2 - Slay
3 - Kick
4 - Ban 5min
5 - Ban Perm
6 - Drop C4
7 - noclip
8 - Exit
__________________
No FuN is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-19-2011 , 08:55   Re: Spectating admin menu
Reply With Quote #4

Code:
bind 1 "sm_slap @aim"
bind 2 "sm_slay @aim"
bind 3 "sm_Kick @aim"
bind 4 "sm_ban @aim 5 reason"
bind 5 "sm_ban @aim reason"
bind 6 "sm_command @aim" Whatever the drop C4 plugin command is for the plugin required.
bind 7 "sm_noclip @aim"
http://wiki.alliedmods.net/Admin_Commands_(SourceMod)

Change 1 to the key you want to hit and it will execute that command for you so admins can all set the keys they want to do what. Sorry if this is no help either.

Last edited by Drixevel; 11-19-2011 at 08:56.
Drixevel is offline
No FuN
Member
Join Date: Mar 2004
Location: Bordeaux
Old 11-19-2011 , 09:04   Re: Spectating admin menu
Reply With Quote #5

del me
__________________

Last edited by No FuN; 11-19-2011 at 09:25.
No FuN is offline
No FuN
Member
Join Date: Mar 2004
Location: Bordeaux
Old 11-19-2011 , 09:38   Re: Spectating admin menu
Reply With Quote #6

Sorry, i misunderstood. It's exactly what i need, however, i dont know how to create a menu.

I need to know how to bring up the menu ingame (which key, etc), also, i could you tell me which file type it needs to be saved in, and where to put the file in SM

thank you very much
__________________
No FuN is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-19-2011 , 12:43   Re: Spectating admin menu
Reply With Quote #7

To open the menu in-game, you can find the menu to open when you press a key on your keyboard.

I use this:
Code:
bind F1 "sm_admin"
That will open the admin menu by the F1 Key.


Regarding the admin menu, save it as adminmenu_custom.txt in the config folder in sourcemod. Just copy and paste/edit accordingly for the commands and flags you want it to use.
Drixevel is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode