Raised This Month: $45 Target: $400
 11% 

[req] mod menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
paniniskull
Junior Member
Join Date: Mar 2016
Old 04-19-2016 , 20:48   [req] mod menu
Reply With Quote #1

guys can you help me doing this plugin in sma??

http://prntscr.com/auec0v
paniniskull is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-19-2016 , 21:12   Re: [req] mod menu
Reply With Quote #2

Try

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
 
#define PLUGIN "Menu"
#define VERSION "1.0"
#define AUTHOR "EFFx"
 
new bool:godmode[33],bool:noclip[33]
new 
BlockTeams
new bool:ff false
 
new AdminName[32]
 
new const 
szPrefixo[] = "!g[SMenu]!y"
 
public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
BlockTeams register_cvar("block_teams","0")
 
 
RegisterHam(Ham_Spawn,"player","Reset",1)
 
 
register_clcmd("jointeam 2","Block")
 
register_clcmd("jointeam 5","Block")
 
 
register_clcmd("say /menu","ShowMenu")
}
public 
Reset(id)
{
 if(
is_user_alive(id))
 {
  
godmode[id] = false
  noclip
[id] = false
  set_user_noclip
(id,0)
  
set_user_godmode(id,0)
 }
}
public 
Block(id)
{
 if(
get_pcvar_num(BlockTeams) == 1)
 {
  
console_print(id,"[AMXX]: O ADMIN %s bloqueou o JoinTeam!",AdminName)
  return 
PLUGIN_HANDLED
 
}
 return 
PLUGIN_CONTINUE
}
public 
ShowMenu(id)
{
 if(
get_user_flags(id) & ADMIN_BAN)
 {
  new 
szMenu menu_create("Menu de Mod","menu_de_mod_handler")
  
menu_additem(szMenu,"FF")
  
menu_additem(szMenu,"Revive")
  
menu_additem(szMenu,"No Clip")
  
menu_additem(szMenu,"GodMode")
  
menu_additem(szMenu,"Transferir")
  
menu_additem(szMenu,"Bloquear Equipas")
  
  
menu_display(id,szMenu)
 }
 else
  
ChatColor(id,"%s Tu nao tens acesso ao menu!",szPrefixo)
  
 return 
PLUGIN_HANDLED
}
public 
menu_de_mod_handler(id,menu,item)
{
 if(
item == MENU_EXIT)
 {
  
menu_destroy(menu)
  return 
PLUGIN_HANDLED
 
}
 new 
szAdminName[32]
 
get_user_name(id,szAdminName,31)
 switch(
item)
 {
  case 
0:
  {
   switch(
ff)
   {
    case 
0:
    {
     
server_cmd("mp_friendlyfire 1")
     
ff true
     ChatColor
(id,"%s O staff!t %s!g ativou!y o!t FF",szPrefixo,szAdminName)
    }
    case 
1:
    {
     
server_cmd("mp_friendlyfire 0")
     
ff false
     ChatColor
(id,"%s O staff!t %s!g desativou!y o!t FF",szPrefixo,szAdminName)
    }
   }
  }
  case 
1:
  {
    
ShowRevive(id)
  }
  case 
2:
  {
   
ShowNoClip(id)
  }
  case 
3:
  {
   
ShowGodMenu(id)
  }
  case 
4:
  {
   
client_cmd(id,"amx_teammenu")
  }
  case 
5:
  {
   switch(
get_pcvar_num(BlockTeams))
   {
    case 
0:
    {
     
set_pcvar_num(BlockTeams,1)
     
ChatColor(id,"%s O staff!t %s!g desbloqueou!y o!t JoinTeam",szPrefixo,szAdminName)
     
copy(AdminName,charsmax(AdminName),szAdminName)
    }
    case 
1:
    {
     
set_pcvar_num(BlockTeams,0)
     
ChatColor(id,"%s O staff!t %s!g bloqueou!y o!t JoinTeam",szPrefixo,szAdminName)
     
copy(AdminName,charsmax(AdminName),szAdminName)
    }
   }
  }
 }
 return 
PLUGIN_HANDLED
}
public 
ShowGodMenu(id)
{
 new 
menu menu_create("GodMode Menu","godmode_handler");
 
 new 
players[32], pnumtempid;
 new 
szName[32], szTempid[10];
 
 
get_players(playerspnum);
 
 for( new 
ii<pnumi++ )
 {
  
tempid players[i];
  
  
get_user_name(tempidszName31);
  
num_to_str(tempidszTempid9);
  
  new 
menutxt[256]
  
formatex(menutxt,255,"%s %s",szName,godmode[tempid] ? "\rdesativar" "\yativar")
  
menu_additem(menumenutxtszTempid0);
  
  
menu_setprop(menuMPROP_EXITMEXIT_ALL)
  
 }
 
menu_display(idmenu0);
 return 
PLUGIN_HANDLED;
}
public 
godmode_handler(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 
 new 
tempid str_to_num(data);
 
 if(
is_user_alive(tempid))
 {
  switch(
godmode[tempid])
  {
   case 
0:
   {
    
set_user_godmode(tempid,1)
    
godmode[tempid] = true
    
new szName[32],szName2[32]
    
get_user_name(id,szName,31)
    
ChatColor(id,"%s O staff!t %s!g ativou!y o godmode do!t %s",szPrefixo,szName,szName2)
   }
   case 
1:
   {
    
set_user_godmode(tempid,0)
    
godmode[tempid] = false
    
new szName[32],szName2[32]
    
get_user_name(id,szName,31)
    
ChatColor(id,"%s O staff!t %s!g desativou!y o godmode do!t %s",szPrefixo,szName,szName2)
   }
  }
 }
 return 
PLUGIN_HANDLED;
}
public 
ShowNoClip(id)
{
 new 
menu menu_create("NoClip Menu","noclip_handler");
 
 new 
players[32], pnumtempid;
 new 
szName[32], szTempid[10];
 
 
get_players(playerspnum);
 
 for( new 
ii<pnumi++ )
 {
  
tempid players[i];
  
  
get_user_name(tempidszName31);
  
num_to_str(tempidszTempid9);
  
  new 
menutxt[256]
  
formatex(menutxt,255,"%s %s",szName,noclip[tempid] ? "\rdesativar" "\yativar")
  
menu_additem(menumenutxtszTempid0);
  
  
menu_setprop(menuMPROP_EXITMEXIT_ALL)
  
 }
 
menu_display(idmenu0);
 return 
PLUGIN_HANDLED;
}
public 
noclip_handler(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 
 new 
tempid str_to_num(data);
 
 if(
is_user_alive(tempid))
 {
  switch(
noclip[tempid])
  {
   case 
0:
   {
    
set_user_noclip(tempid,1)
    
noclip[tempid] = true
    
new szName[32],szName2[32]
    
get_user_name(id,szName,31)
    
get_user_name(tempid,szName2,31)
    
ChatColor(id,"%s O staff!t %s!g ativou!y o noclip do!t %s",szPrefixo,szName,szName2)
   }
   case 
1:
   {
    
set_user_noclip(tempid,0)
    
noclip[tempid] = false
    
new szName[32],szName2[32]
    
get_user_name(id,szName,31)
    
ChatColor(id,"%s O staff!t %s!g desativou!y o noclip do!t %s",szPrefixo,szName,szName2)
   }
  }
 }
 return 
PLUGIN_HANDLED;
}
public 
ShowRevive(id)
{
 new 
menu menu_create("Revive Menu","revive_handler");
 
 new 
players[32], pnumtempid;
 new 
szName[32], szTempid[10];
 
 
get_players(playerspnum);
 
 for( new 
ii<pnumi++ )
 {
  
tempid players[i];
  
  
get_user_name(tempidszName31);
  
num_to_str(tempidszTempid9);
  
  
menu_additem(menuszNameszTempid0);
  
  
menu_setprop(menuMPROP_EXITMEXIT_ALL)
  
 }
 
menu_display(idmenu0);
 return 
PLUGIN_HANDLED;
}
public 
revive_handler(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 
 new 
tempid str_to_num(data);
 
 if(
is_user_alive(tempid))
 {
  
ExecuteHam(Ham_CS_RoundRespawn,id)
  new 
szName[32],szName2[32]
  
get_user_name(id,szName,31)
  
get_user_name(tempid,szName2,31)
  
ChatColor(id,"%s O staff!t %s!g reviveu!y o!t %s",szPrefixo,szName,szName2)
 }
 return 
PLUGIN_HANDLED;
}
stock ChatColor(const id, const input[], any:...) 
{
 new 
count 1players32 ]
 static 
msg191 ]
 
vformatmsg190input)
   
 
replace_allmsg190"!g""^4" )
 
replace_allmsg190"!y""^1" )
 
replace_allmsg190"!t""^3" )
   
 if(
idplayers] = id; else get_playersplayerscount"ch" )
 {
  for(new 
0counti++)
  {
   if( 
is_user_connectedplayers] ) )
   {
    
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players] )  
    
write_byteplayers] )
    
write_stringmsg )
    
message_end( )
   }
  }
 }

__________________

Last edited by EFFx; 04-20-2016 at 22:14.
EFFx is offline
Send a message via Skype™ to EFFx
paniniskull
Junior Member
Join Date: Mar 2016
Old 04-20-2016 , 14:04   Re: [req] mod menu
Reply With Quote #3

thx dude, but you can put this menssage?? http://prntscr.com/auobs0 and i only want block CT team and AutoTeam
paniniskull is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-20-2016 , 22:10   Re: [req] mod menu
Reply With Quote #4

Try again, updated
__________________
EFFx is offline
Send a message via Skype™ to EFFx
Reply


Thread Tools
Display Modes

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 12:39.


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