Raised This Month: $32 Target: $400
 8% 

How to make admin commands start with a !?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ces
Junior Member
Join Date: Oct 2017
Old 10-14-2017 , 19:26   How to make admin commands start with a !?
Reply With Quote #1

Hey, does anyone know how to make admins be able to execute commands with just a !? For example for UAIO, specifically which is what I want, !glow ces cyan, !kick ces reason, etc.
ces is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-14-2017 , 19:44   Re: How to make admin commands start with a !?
Reply With Quote #2

Search for admin slash plugin and edit it to use "!" instead of "/".
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
ces
Junior Member
Join Date: Oct 2017
Old 10-14-2017 , 19:46   Re: How to make admin commands start with a !?
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Search for admin slash plugin and edit it to use "!" instead of "/".
If I do so, its only for amx, but I specifically want it for UAIO. How do I change it to be for UAIO?
ces is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 10-15-2017 , 01:50   Re: How to make admin commands start with a !?
Reply With Quote #4

do the same for that "uaio" plugin aswell...
__________________
retired chump
DjSoftero is offline
ces
Junior Member
Join Date: Oct 2017
Old 10-15-2017 , 04:15   Re: How to make admin commands start with a !?
Reply With Quote #5

I'm new to all of this, can you tell me how man? Sorry if I seem stupid.
ces is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 10-15-2017 , 04:37   Re: How to make admin commands start with a !?
Reply With Quote #6

find lines like that:
PHP Code:
register_clcmd"say /menu","main_menu" 
and change the "/menu" to "!menu". Respectively do the same to all of the commands
__________________
retired chump

Last edited by DjSoftero; 10-15-2017 at 04:38.
DjSoftero is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-15-2017 , 05:05   Re: How to make admin commands start with a !?
Reply With Quote #7

Or you can hook orphue to register clcmd and replace all

And reformat the say commands


Which it will be more easy to do as they told u
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-15-2017 at 05:05.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
ces
Junior Member
Join Date: Oct 2017
Old 10-15-2017 , 05:21   Re: How to make admin commands start with a !?
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
Or you can hook orphue to register clcmd and replace all

And reformat the say commands


Which it will be more easy to do as they told u
Yeah, how can I do that?

Atm, I only have this. I've tried editing the admin_slash plugin.
The thing is, I wan't it only to be for the UAIO commands, such as uaio_slap uaio_rocket etc. I don't know how to change that.

Quote:
#include <amxmodx>
#include <amxmisc>

#define VERBOSE
#define MAX_NAME_LENGTH 32
#define MAX_TEXT_LENGTH 80
#define MAX_PLAYERS 32
new PLUGIN[] = "Super Admin Slash"

new sMessage[MAX_TEXT_LENGTH], Array:repeatStorage, Array:repeatIDs, repeaters[MAX_PLAYERS+1]

enum {
GET_TEAM_TARGET_ISNOBODY,
GET_TEAM_TARGET_ISALL,
GET_TEAM_TARGET_ISTEAMCT,
GET_TEAM_TARGET_ISTERRORIST
}

enum {
GET_TEAM_TARGET_SKIPNOBODY,
GET_TEAM_TARGET_SKIPBOTS,
GET_TEAM_TARGET_SKIPDEADPEOPLE
}

stock tokenlen(string[]){
for(new i; i < strlen(string)+1; i++){
if(string[i] < 33) return i
}
return 0
}

stock get_team_target(arg[],players[32],&pnum,skipMode=GET_TEAM_TARGET_SKIPNOBODY) {
//Modular Tea m Targeting code by Sid 6.7
new whoTeam
new cmdflags[4]
switch(skipMode){
case GET_TEAM_TARGET_SKIPBOTS: cmdflags = "ce"
case GET_TEAM_TARGET_SKIPNOBODY: cmdflags = "e"
case GET_TEAM_TARGET_SKIPDEADPEOPLE: cmdflags = "ae"
}
if(equali(arg[1],"ALL",tokenlen(arg[1]))) {
switch(skipMode){
case GET_TEAM_TARGET_SKIPBOTS: cmdflags = "c"
case GET_TEAM_TARGET_SKIPNOBODY: cmdflags = ""
case GET_TEAM_TARGET_SKIPDEADPEOPLE: cmdflags = "a"
}
whoTeam = GET_TEAM_TARGET_ISALL
get_players(players,pnum,cmdflags)
}

if(equali(arg[1],"TERRORIST",tokenlen(arg[1]))) {
whoTeam = GET_TEAM_TARGET_ISTERRORIST
get_players(players,pnum,cmdflags,"TERRORIST" )
}
if(equali(arg[1],"CT",2) || equali(arg[1],"C",1)) {
whoTeam = GET_TEAM_TARGET_ISTEAMCT
get_players(players,pnum,cmdflags,"CT")
}
return whoTeam
}

public admin_slash(id){
if(!is_user_admin(id)) return PLUGIN_CONTINUE
new sArg[MAX_NAME_LENGTH]
read_argv(1,sArg,charsmax(sArg))

// Check for '!' char
if ( sArg[0] == '!' ){
read_args(sMessage,charsmax(sMessage))
remove_quotes(sMessage)
replace(sMessage,charsmax(sMessage),"!","")
process(id,sMessage)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

process(id,line[sizeof sMessage]){
if(equal(line,"")){
new menu = menu_create("Wipe Repeaters","imh")
menu_additem(menu,"Wipe All","wipe0")
new pnum, p[32], n[24], c[32]
get_players(p,pnum,"c")
for(new i; i < pnum; i++){
get_user_name(p[i],n,charsmax(n))
formatex(c,charsmax(c),"[%d] %s",repeaters[p[i]],n)
formatex(n,6,"wipe%d",p[i])
menu_additem(menu,c,n)
}
menu_display(id,menu)
return
}
new a = contain(line,"@")
if(a != -1 && !isalnum(line[a+1])) intellimenu(id,line)
else {
//check for @Xall @XT @XCT, these are manual controls for commands not supporting @ symbol
new line2[sizeof line]
copy(line2,charsmax(line2),line)
if(line[0] == 'R') {
replace(line2,charsmax(line2),"R","")
addrepeater(id,line2)
client_print(id,print_chat,"[%s] Command set for repeat on new rounds",PLUGIN)
return
}
a = contain(line,"@X")
if(a == -1) client_cmd(id,"amx_%s",line)
else {
new teammates[32], pnum
//start cycling thru targets
client_print(id,print_chat,"[%s] Emulation called for @%s",PLUGIN,line[a+2])
replace(line2,charsmax(line2),"@X","@")
if(get_team_target(line2[a],teammates,pnum) == GET_TEAM_TARGET_ISNOBODY)
client_print(id,print_chat,"[%s] No clients on team",PLUGIN)
else {
new r[16], j[2]
strtok(line2[a],r,charsmax(r),j,1)
replace(line2,charsmax(line2),r,"#%d")
#if defined VERBOSE
server_print(line2,12345)
#endif
}
new line3[sizeof line]
for(new i; i < pnum; i++){
formatex(line3,charsmax(line3),line2,get_user _userid(teammates[i]))
#if defined VERBOSE
server_print(line3)
#endif
client_cmd(id,"amx_%s",line3)
}
}
}
}

intellimenu(id,const line[sizeof sMessage]){
new players[32], pnum, commandlabel[48], gumstick[sizeof line], userid[8]
get_players(players,pnum)
new menu = menu_create("AMXX Super Slash Users Menu","imh")
new targets[][] = {"@ALL","@CT","@T"}
if(cstrike_running()){
if(line[0] == 'R'){
copy(gumstick,charsmax(gumstick),line[1])
commandlabel = "Repeat\R\yON"
} else {
formatex(gumstick,charsmax(gumstick),"R%s",li ne)
commandlabel = "Repeat\R\dOFF"
}
menu_additem(menu,commandlabel,gumstick)
for(new i; i < sizeof targets; i++){
copy(gumstick,charsmax(gumstick),line)
replace(gumstick,charsmax(gumstick),"@",targe ts[i])
menu_additem(menu,targets[i],gumstick)
}
}
menu_addblank(menu,0)
for(new i; i < pnum; i++){
copy(gumstick,charsmax(gumstick),line)
formatex(userid,charsmax(userid),"#%d",get_us er_userid(players[i]))
replace(gumstick,charsmax(gumstick),"@",useri d)
get_user_name(players[i],commandlabel,charsmax(commandlabel))
if(cstrike_running())
if(get_user_flags(players[i]) & ADMIN_IMMUNITY) strcat(commandlabel,"\R\yIMMUNITY",charsmax(c ommandlabel))
menu_additem(menu,commandlabel,gumstick)
}
menu_addblank(menu,0)
new Xtargets[][] = {"@XALL","@XCT","@XT"}
for(new i; cstrike_running() ? i < sizeof Xtargets : i < 1; i++){
copy(gumstick,charsmax(gumstick),line)
replace(gumstick,charsmax(gumstick),"@",Xtarg ets[i])
menu_additem(menu,Xtargets[i],gumstick)
}
menu_display(id,menu)
}

public imh(id, menu, item){
if(item <= MENU_EXIT) {
menu_destroy(menu)
return PLUGIN_HANDLED
}
new a, bubblegum[MAX_TEXT_LENGTH], name[32]
menu_item_getinfo(menu, item, a, bubblegum, charsmax(bubblegum),name,sizeof(name)-1, a)
menu_destroy(menu)
if(equal(bubblegum,"wipe",4)) wiperepeaters(str_to_num(bubblegum[4]))
else process(id,bubblegum)
return PLUGIN_HANDLED
}

public plugin_init(){
register_plugin(PLUGIN,"2008","mike_cao & Sid 6.7")
register_clcmd("say","admin_slash",0,"say !command < params >")
if(cstrike_running()) register_logevent("logevent_round_start", 2, "1=Round_Start")
repeatStorage = ArrayCreate(MAX_TEXT_LENGTH)
repeatIDs = ArrayCreate()
}

public logevent_round_start(){
for(new i; i < ArraySize(repeatIDs); i++){
ArrayGetString(repeatStorage,i,sMessage,chars max(sMessage))
process(ArrayGetCell(repeatIDs,i),sMessage)
}
}

addrepeater(id, r[]){
ArrayPushCell(repeatIDs,id)
ArrayPushString(repeatStorage,r)
repeaters[id]++
}

//id 0 = all
wiperepeaters(id){
for(new i; i < ArraySize(repeatIDs); i++){
if(!id || ArrayGetCell(repeatIDs,i) == id){
repeaters[ArrayGetCell(repeatIDs,i)]--
ArrayDeleteItem(repeatIDs,i)
ArrayDeleteItem(repeatStorage,i)
i--
}
}
}

public client_disconnect(id){
wiperepeaters(id)
}

Last edited by ces; 10-15-2017 at 05:27.
ces is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 10-15-2017 , 06:36   Re: How to make admin commands start with a !?
Reply With Quote #9

You have to edit your plugin UAIO, not the Admin Slash plugin. And DjSoftero already told you what to do...

Last edited by KiLLeR.; 10-15-2017 at 06:36.
KiLLeR. 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 07:15.


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