Raised This Month: $ Target: $400
 0% 

!rr !gag !ct !t !spec !gag !kick commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shaleval1
Junior Member
Join Date: May 2021
Old 06-04-2021 , 19:11   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #1

Quote:
Originally Posted by Supremache View Post
Untested:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Commands menu" #define VERSION "1.0" #define AUTHOR "Supremache" #define MenuTitle(%1)  formatex(szTitle,charsmax(szTitle), %1) enum _:eCommandSettings {     iMenuType,     iCommands[32],     iFlags }; new const g_iCommandSettings[][eCommandSettings] = {     /*     * Dont touch this, Commands , Cmd Flags     */     { 1, "kick", ADMIN_ALL},     { 2, "gag" , ADMIN_RCON },     { 3, "t" , ADMIN_RCON },     { 4, "ct" , ADMIN_RCON },     { 5, "spec" , ADMIN_RCON } } new const iCommandsSymbols[] = { "/", "!" } new szUserName[33], g_iPlayerMenu[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd( "Gag", "Gag");     register_clcmd("say", "CommandSay") } public client_authorized(id) {     get_user_name( id, szUserName[id], charsmax(szUserName[])); } public CommandSay(id) {     new szArgs[192]         read_args(szArgs, charsmax(szArgs))     remove_quotes(szArgs)     trim(szArgs)     new szCmd[35]     parse(szArgs, szCmd, charsmax(szCmd))     trim(szCmd)         for(new  i = 0; i <= charsmax(iCommandsSymbols); i++)         if (szCmd[0] != iCommandsSymbols[i])             return PLUGIN_CONTINUE         new iMenu = -1         for(new  i = 0; i <= charsmax(g_iCommandSettings); i++)     {         if (equali(szCmd[1], g_iCommandSettings[i][iCommands]))         {             iMenu = g_iCommandSettings[i][iMenuType]                         if (iMenu == -1)                 return PLUGIN_CONTINUE                         g_iPlayerMenu[id] = iMenu             Player(id, g_iCommandSettings[i][iFlags])             break;         }     }     return PLUGIN_HANDLED } public Player(id, iFlag) {     if(!access(id, iFlag))     {         client_print( id, print_chat, "You dont have access.");         return PLUGIN_HANDLED     }                 new iPlayers[32], iPnum, szUserID[32], szTitle[128], iMenu         switch ( g_iPlayerMenu[id] )     {         case 1: MenuTitle("\yKick Menu:")         case 2: MenuTitle("\yBan Players")         case 3: MenuTitle("\yTransfer: \rTerrorist")         case 4: MenuTitle("\yTransfer: \rCounter-Terrorist")         case 5: MenuTitle("\yTransfer: \rSpectator")     }         iMenu = menu_create(szTitle, "Handler")     get_players(iPlayers, iPnum, "ch");         for(new iPlayer, i; i < iPnum; i++)     {         iPlayer = iPlayers[i]         formatex( szUserID, charsmax(szUserID), "%d", get_user_userid(iPlayer))         menu_additem(iMenu, szUserName[iPlayer], szUserID)     }         menu_setprop(iMenu, MPROP_BACKNAME, "Previous page")     menu_setprop(iMenu, MPROP_NEXTNAME, "Next page")     menu_setprop(iMenu, MPROP_EXITNAME, "\rClose")     menu_display(id, iMenu)     return PLUGIN_HANDLED } public Handler(id, iMenu, iItem) {     if(iItem != MENU_EXIT)     {         new iAccess, iCallback, iData[6],iName[64];         menu_item_getinfo(iMenu, iItem, iAccess, iData, charsmax(iData), iName, charsmax(iName), iCallback);             new iPlayer = str_to_num(iData);                 switch ( g_iPlayerMenu[id] )         {             case 1:             {                 server_cmd("kick #%d ^"kicked by %s^"", iPlayer, szUserName[id] )                 client_print( 0, print_chat, "[ AMXX ] ADMIN: %s Kicked %s", szUserName[id], szUserName[iPlayer] );             }             case 2:             {                 set_hudmessage(255, 255, 85, 0.01, 0.18, 2, 0.5, 6.0, 0.05, 0.05, -1);                 show_hudmessage(id, "Type <name or #userid> <minutes> [reason]");                                 client_cmd( id, "messagemode Gag" );             }             case 3:             {                   if(is_user_alive(iPlayer)) user_silentkill( iPlayer );                                 cs_set_user_team( iPlayer, CS_TEAM_T );                 ExecuteHamB( Ham_CS_RoundRespawn, iPlayer );                                 client_print( 0, print_chat, "[ AMXX ] ADMIN: %s transfer %s to the terrorist team", szUserName[id], szUserName[iPlayer] );             }             case 4:             {                   if(is_user_alive(iPlayer)) user_silentkill( iPlayer );                                 cs_set_user_team( iPlayer, CS_TEAM_CT );                 ExecuteHamB( Ham_CS_RoundRespawn, iPlayer );                                 client_print( 0, print_chat, "[ AMXX ] ADMIN: %s transfer %s to the counter-terrorist team", szUserName[id], szUserName[iPlayer] );             }             case 5:             {                   if(is_user_alive(iPlayer)) user_silentkill( iPlayer );                                 cs_set_user_team( iPlayer, CS_TEAM_SPECTATOR );                                 client_print( 0, print_chat, "[ AMXX ] ADMIN: %s transfer %s to the spectator", szUserName[id], szUserName[iPlayer] );             }         }     }     menu_destroy(iMenu)     return PLUGIN_HANDLED } public Gag(id) {     new cTarget[32], iTarget, cGagTime[6], iGagTime, cReason[64]         read_argv( 1, cTarget, charsmax(cTarget));     read_argv( 2, cGagTime, charsmax(cGagTime));     read_argv( 3, cReason, charsmax(cReason))         iGagTime = str_to_num(cGagTime);     iTarget = cmd_target( id, cTarget, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS );                     server_cmd("amx_gag ^"#%d^" ^"%d^" ^"%s^" ^"Gagned by %s^"", iTarget, iGagTime, cReason, szUserName[id])     client_print( 0, print_chat, "[ AMXX ] ADMIN: %s Gagned %s minutes(%d) reason(%s)", szUserName[id], szUserName[iTarget], iGagTime, cReason); }
here is what happens when I try to use !gag
https://i.imgur.com/PmGIuuf.png

Last edited by shaleval1; 06-04-2021 at 19:16.
shaleval1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-04-2021 , 20:05   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #2

Quote:
Originally Posted by shaleval1 View Post
here is what happens when I try to use !gag
https://i.imgur.com/PmGIuuf.png
Fixed #2
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
shaleval1
Junior Member
Join Date: May 2021
Old 06-04-2021 , 20:27   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #3

Quote:
Originally Posted by Supremache View Post
Fixed #2
Thanks! I just use / or ! and the cmd?
Like /gag or !gag?
shaleval1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-04-2021 , 20:36   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #4

Quote:
Originally Posted by shaleval1 View Post
Thanks! I just use / or ! and the cmd?
Like /gag or !gag?
i added this ! symbol

PHP Code:
if (szCmd[0] != '!')
        return 
PLUGIN_CONTINUE 
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
shaleval1
Junior Member
Join Date: May 2021
Old 06-04-2021 , 20:36   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
Fixed #2
Edit: It works bro. i use !gag then it open menu, I choose the player and then it let me only choose minute to gag and no reason. After 1 min of the gag it doesn't say on chat "XXX is no longer gagged" or something, possible to do it?


TY sooo much btw.
shaleval1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-04-2021 , 20:38   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #6

Quote:
Originally Posted by shaleval1 View Post
Edit: It works bro. i use !gag then it open menu, I choose the player and then it let me only choose minute to gag and no reason. After 1 min of the gag it doesn't say on chat "XXX is no longer gagged" or something, possible to do it?


TY sooo much btw.
Yes, it possible but later, i am tired now
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
shaleval1
Junior Member
Join Date: May 2021
Old 06-04-2021 , 20:38   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
Yes, it possible but later, i am tired now
No worries! Thank you sooo much tho.

You can also add !rr command and when I use !rr it restart the round and say in chat " [AMXX] Admin XXX restarted the round"? :X I'm sorry for bothering but you're legend xd

Last edited by shaleval1; 06-04-2021 at 20:39.
shaleval1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-04-2021 , 21:05   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #8

Quote:
Originally Posted by shaleval1 View Post
No worries! Thank you sooo much tho.

You can also add !rr command and when I use !rr it restart the round and say in chat " [AMXX] Admin XXX restarted the round"? :X I'm sorry for bothering but you're legend xd
Added #2
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
shaleval1
Junior Member
Join Date: May 2021
Old 06-05-2021 , 10:30   Re: !rr !gag !ct !t !spec !gag !kick commands
Reply With Quote #9

Quote:
Originally Posted by Supremache View Post
Added #2
Thanks A LOT bro! It works great! U a real legend mate.

Really last 2 things, can you please add a message that says "XXX is no longer gagged" if someone's gag over? xd
and if possible to also add !ungag menu that shows people gagged

Last edited by shaleval1; 06-05-2021 at 10:33.
shaleval1 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 19:58.


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