added amx_clexec and amx_nick
This commit is contained in:
parent
0338fe0343
commit
b409769f2b
|
@ -57,10 +57,12 @@ public plugin_init(){
|
||||||
register_concmd("amx_cvar","cmdCvar",ADMIN_CVAR,"<cvar> [value]")
|
register_concmd("amx_cvar","cmdCvar",ADMIN_CVAR,"<cvar> [value]")
|
||||||
register_concmd("amx_plugins","cmdPlugins",ADMIN_ADMIN)
|
register_concmd("amx_plugins","cmdPlugins",ADMIN_ADMIN)
|
||||||
register_concmd("amx_modules","cmdModules",ADMIN_ADMIN)
|
register_concmd("amx_modules","cmdModules",ADMIN_ADMIN)
|
||||||
register_clcmd("amx_map","cmdMap",ADMIN_MAP,"<mapname>")
|
register_concmd("amx_map","cmdMap",ADMIN_MAP,"<mapname>")
|
||||||
register_clcmd("pauseAck","cmdLBack")
|
register_concmd("amx_cfg","cmdCfg",ADMIN_CFG,"<fliename>")
|
||||||
register_clcmd("amx_cfg","cmdCfg",ADMIN_CFG,"<fliename>")
|
register_concmd("amx_clexec","cmdClExec",ADMIN_RCON,"<name or #userid> <command>")
|
||||||
|
register_concmd("amx_nick","cmdNick",ADMIN_SLAY,"<name or #userid> <new nick>")
|
||||||
register_clcmd("amx_rcon","cmdRcon",ADMIN_RCON,"<command line>")
|
register_clcmd("amx_rcon","cmdRcon",ADMIN_RCON,"<command line>")
|
||||||
|
register_clcmd("pauseAck","cmdLBack")
|
||||||
}
|
}
|
||||||
|
|
||||||
public plugin_cfg() {
|
public plugin_cfg() {
|
||||||
|
@ -276,8 +278,9 @@ public cmdSlap(id,level,cid){
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
|
||||||
public chMap(map[])
|
public chMap(map[]) {
|
||||||
server_cmd("changelevel %s",map)
|
server_cmd("changelevel %s",map)
|
||||||
|
}
|
||||||
|
|
||||||
public cmdMap(id,level,cid) {
|
public cmdMap(id,level,cid) {
|
||||||
if (!cmd_access(id,level,cid,2))
|
if (!cmd_access(id,level,cid,2))
|
||||||
|
@ -364,8 +367,7 @@ public cmdCvar(id,level,cid){
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
|
||||||
public cmdPlugins(id,level,cid)
|
public cmdPlugins(id,level,cid) {
|
||||||
{
|
|
||||||
if (!cmd_access(id,level,cid,1))
|
if (!cmd_access(id,level,cid,1))
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
|
|
||||||
|
@ -407,8 +409,7 @@ public cmdPlugins(id,level,cid)
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
|
||||||
public cmdModules(id,level,cid)
|
public cmdModules(id,level,cid) {
|
||||||
{
|
|
||||||
if (!cmd_access(id,level,cid,1))
|
if (!cmd_access(id,level,cid,1))
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
|
|
||||||
|
@ -437,8 +438,7 @@ public cmdModules(id,level,cid)
|
||||||
for (new i=0;i<num;i++)
|
for (new i=0;i<num;i++)
|
||||||
{
|
{
|
||||||
get_module(i,name,31,author,31,version,31,status)
|
get_module(i,name,31,author,31,version,31,status)
|
||||||
switch (status)
|
switch (status) {
|
||||||
{
|
|
||||||
case module_loaded: copy(sStatus,15,"running")
|
case module_loaded: copy(sStatus,15,"running")
|
||||||
default: copy(sStatus,15,"error")
|
default: copy(sStatus,15,"error")
|
||||||
}
|
}
|
||||||
|
@ -602,3 +602,71 @@ public cmdLeave(id,level,cid){
|
||||||
|
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public cmdClExec(id,level,cid) {
|
||||||
|
if (!cmd_access(id,level,cid,3))
|
||||||
|
return PLUGIN_HANDLED
|
||||||
|
|
||||||
|
new arg0[32],arg1[32],command[128],authid[32],name[32],authid2[32],name2[32]
|
||||||
|
|
||||||
|
read_argv(0,arg0,31)
|
||||||
|
read_argv(1,arg1,31)
|
||||||
|
read_args(command,127)
|
||||||
|
replace(command,127,arg0,"")
|
||||||
|
replace(command,127,arg1,"")
|
||||||
|
trim(command)
|
||||||
|
|
||||||
|
new player = cmd_target(id,arg1,1)
|
||||||
|
if (!player) return PLUGIN_HANDLED
|
||||||
|
|
||||||
|
client_cmd(player,command)
|
||||||
|
|
||||||
|
get_user_authid(id,authid,31)
|
||||||
|
get_user_name(id,name,31)
|
||||||
|
get_user_authid(player,authid2,31)
|
||||||
|
get_user_name(player,name2,31)
|
||||||
|
|
||||||
|
log_amx("Cmd: ^"%s<%d><%s><>^" execute ^"%s^" on ^"%s<%d><%s><>^"",
|
||||||
|
name,get_user_userid(id),authid,command,name2,get_user_userid(player),authid2 )
|
||||||
|
|
||||||
|
switch (get_cvar_num("amx_show_activity")) {
|
||||||
|
case 2: client_print(0,print_chat,"ADMIN %s: execute a command on %s",name,name2)
|
||||||
|
case 1: client_print(0,print_chat,"ADMIN: execute a command on %s",name2)
|
||||||
|
}
|
||||||
|
|
||||||
|
console_print(id,"[AMXX] Executed ^"%s^" on %s",command,name2)
|
||||||
|
|
||||||
|
return PLUGIN_HANDLED
|
||||||
|
}
|
||||||
|
|
||||||
|
public cmdNick(id,level,cid) {
|
||||||
|
if (!cmd_access(id,level,cid,3))
|
||||||
|
return PLUGIN_HANDLED
|
||||||
|
|
||||||
|
new arg1[32],arg2[32],authid[32],name[32],authid2[32],name2[32]
|
||||||
|
|
||||||
|
read_argv(1,arg1,31)
|
||||||
|
read_argv(2,arg2,31)
|
||||||
|
|
||||||
|
new player = cmd_target(id,arg1,1)
|
||||||
|
if (!player) return PLUGIN_HANDLED
|
||||||
|
|
||||||
|
get_user_authid(id,authid,31)
|
||||||
|
get_user_name(id,name,31)
|
||||||
|
get_user_authid(player,authid2,31)
|
||||||
|
get_user_name(player,name2,31)
|
||||||
|
|
||||||
|
client_cmd(player,"name ^"%s^"",arg2)
|
||||||
|
|
||||||
|
log_amx("Cmd: ^"%s<%d><%s><>^" change nick to ^"%s^" ^"%s<%d><%s><>^"",
|
||||||
|
name,get_user_userid(id),authid,arg2,name2,get_user_userid(player),authid2 )
|
||||||
|
|
||||||
|
switch (get_cvar_num("amx_show_activity")) {
|
||||||
|
case 2: client_print(0,print_chat,"ADMIN %s: change nick of %s to ^"%s^"",name,name2,arg2)
|
||||||
|
case 1: client_print(0,print_chat,"ADMIN: change nick of %s to ^"%s^"",name2,arg2)
|
||||||
|
}
|
||||||
|
|
||||||
|
console_print(id,"[AMXX] Changed nick of %s to ^"%s^"",name2,arg2)
|
||||||
|
|
||||||
|
return PLUGIN_HANDLED
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user