Raised This Month: $51 Target: $400
 12% 

weapons menu plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
frenetico9
Junior Member
Join Date: Feb 2021
Old 02-13-2021 , 15:08   weapons menu plugin
Reply With Quote #1

Can someone help me make this weapon menu appear automatically?

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "4Fun: Menu de Armas"
#define VERSION "1.2"

#define xPrefix "\y>\r[BIRUTAS]\d<"
#define xPrefixChat "!t>!g[BIRUTAS]!t<"


new xRememberSelection[33], acao[33], xNaoMostrar[33]

public 
plugin_init()
{
   
register_plugin(PLUGINVERSION"Wilian M.")
   
   
register_clcmd("say /BIRUTAS_armas""xMenuGuns")
   
   
RegisterHam(Ham_Spawn"player""xHam_Spawn"true)
}


public 
client_putinserver(id)
{
   
xRememberSelection[id] = false
   xNaoMostrar
[id] = false
}


// Menu Guns
public xMenuGuns(id)
{
   if(
xRememberSelection[id])
   {
      
xRememberSelection[id] = false
      client_print_color
(id"%s !yVoce reativou o menu de armas."xPrefixChat)
   }
   
   new 
xTeam
   xTeam  
get_user_team(id)
   
   new 
xMenu[500]
   
   
formatex(xMenu499"%s \wMenu de Armas"xPrefix)

   new 
menu menu_create(xMenu"_xMenuGuns")
   
   if(
xTeam == 1// Armas TR
   
{
      
menu_additem(menu"Kit \r[\yAK47 \r+ \yDesert\r] ""1")
      
menu_additem(menu"Kit \r[\yAK47 \r+ \yUsp\r]""2")
      
menu_additem(menu"Kit \r[\yAWP \r+ \yDesert\r]""3")
      
menu_additem(menu"Kit \r[\yGalil \r+ \yDesert\r]^n""4")
      
menu_additem(menu"Kit \d[\rVIP M4A1\y+ \yDesert\d]^n""5")
      
menu_additem(menu"Kit \d[\rVIP FAMAS\y+ \yDesert\d]^n""6")      
   }
   else 
// Armas CTS
   
{
      
menu_additem(menu"Kit \r[\yM4A1 \r+ \yDesert\d]""1")
      
menu_additem(menu"Kit \r[\yM4A1 \r+ \yUsp\d]""2")
      
menu_additem(menu"Kit \r[\yAWP \r+ \yDesert\d]""3")
      
menu_additem(menu"Kit \r[\yFamas \r+ \yDesert\d]^n""4")
      
menu_additem(menu"Kit \d[\rVIP AK47\y+ \yDesert\d]^n""5")
      
menu_additem(menu"Kit \d[\rVIP GALIL\y+ \yDesert\d]^n""6")
   }
   
   if(
xRememberSelection[id])
   {
      
menu_additem(menu"Relembrar Selecao? \r[Ativado]^n""7")
   }
   else
   {
      
menu_additem(menu"Relembrar Selecao? \r[Desativado]^n""8")
   }
   
   
menu_additem(menu"Nao Exibir este menu novamente.""6")
   
   
   
menu_setprop(menuMPROP_EXITNAME"Sair")
   
menu_display(idmenu0)
   
   return 
PLUGIN_HANDLED
}

public 
_xMenuGuns(idmenuitem)
{
   if(
item == MENU_EXIT)
   {
      
menu_destroy(menu); return PLUGIN_HANDLED;
   }
   
   new 
xTeam
   xTeam 
get_user_team(id)
   
   if(!
is_user_connected(id)) return PLUGIN_HANDLED
   
   
switch(item)
   {
      case 
0:
      {   
         if(
xTeam == 1)
         {
            
client_cmd(id,"vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
         }
         else
         {
            
client_cmd(id"defuser;vesthelm;m4a1;deagle;secammo;primammo;hegren;flash;flash")
         }
         
         
acao[id] = item
      
}
      
      case 
1:
      {
         if(
xTeam == 1)
         {
            
client_cmd(id,"vesthelm;ak47;usp;secammo;primammo;hegren;flash;flash")
         }
         else
         {
            
client_cmd(id"defuser;vesthelm;m4a1;usp;secammo;primammo;hegren;flash;flash")
         }
         
         
acao[id] = item
      
}
      
      case 
2:
      {
         if(
xTeam == 1)
         {
            
client_cmd(id"vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
         }
         else
         {
            
client_cmd(id"defuser;vesthelm;awp;deagle;secammo;primammo;hegren;flash;flash")
         }
         
         
acao[id] = item
      
}
      case 
3:
      {
         if(
xTeam == 1)
         {
            
client_cmd(id,"vesthelm;galil;deagle;secammo;primammo;hegren;flash;flash")
         }
         else
         {
            
client_cmd(id"defuser;vesthelm;famas;deagle;secammo;primammo;hegren;flash;flash")
         }
         
         
acao[id] = item
      
}
      case 
4:
      {
         if(
xTeam == ADMIN_LEVEL_G)
         {
            
client_cmd(id,"defuser;vesthelm;m4a1;deagle;secammo;primammo;hegren;flash;flash")
         }
         else
         {
            
client_cmd(id"vesthelm;ak47;deagle;secammo;primammo;hegren;flash;flash")
         }
       
         
acao[id] = item
      
}    
      case 
5:
      {
         if(
xTeam == ADMIN_LEVEL_G)
         {
            
client_cmd(id,"defuser;vesthelm;famas;deagle;secammo;primammo;hegren;flash;flash")
         }
         else
         {
            
client_cmd(id"vesthelm;galil;deagle;secammo;primammo;hegren;flash;flash")
         }
       
         
acao[id] = item
      
}
      
      case 
6:
      {
         if(
xRememberSelection[id])
         {
            
xRememberSelection[id] = false;
            
         }
         else
         {
            
xRememberSelection[id] = true;
            
client_print_color(id"%s !yVoce Ativou !tRelembrar-Selecao de armas! !yDigite !g/BIRUTAS_armas !ypara re-ativar."xPrefixChat)
            
         }
      }
      
      case 
7:
      {
         
xNaoMostrar[id] = true;
         
client_print_color(id"%s !tPRONTO!! !yAgora para ativar somente relogando..."xPrefixChat)
      }
      
   }
   
   return 
PLUGIN_HANDLED
}

stock client_print_color(const id, const input[], any:...)
{
   new 
count 1players[32]
   static 
msg[191]
   
vformat(msg190input3)
   
   
replace_all(msg190"!g""^4")
   
replace_all(msg190"!y""^1")
   
replace_all(msg190"!t""^3")
   
replace_all(msg190"!t2""^0")
   
   if (
idplayers[0] = id; else get_players(playerscount"ch")

   for (new 
0counti++)
   {
      if (
is_user_connected(players[i]))
      {
         
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
         
write_byte(players[i])
         
write_string(msg)
         
message_end()
      }
   }
}
stock SendCmd(const iClient, const szCommand[])
{
    
message_begin(MSG_ONESVC_DIRECTOR_iClient);
    
write_byte(strlen(szCommand) + 2);
    
write_byte(10);
    
write_string(szCommand);
    
message_end();
}
   
public 
client_connect(id)
{
   
SendCmd(id,"bind "v" "say /BIRUTAS_armas"")


Last edited by frenetico9; 02-13-2021 at 15:14.
frenetico9 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-13-2021 , 15:10   Re: weapons menu plugin
Reply With Quote #2

no one is going to help if you don't make a proper thread put the code inside php or code tags and use regular font size, people are not blind and they can see.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
frenetico9
Junior Member
Join Date: Feb 2021
Old 02-13-2021 , 15:15   Re: weapons menu plugin
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
no one is going to help if you don't make a proper thread put the code inside php or code tags and use regular font size, people are not blind and they can see.
sorry :/
frenetico9 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-13-2021 , 15:52   Re: weapons menu plugin
Reply With Quote #4

change
Code:
RegisterHam(Ham_Spawn, "player", "xHam_Spawn", true)

to
Code:
RegisterHam(Ham_Spawn, "player", "xMenuGuns", true)


also why the slow hacking?

Code:
public client_connect(id) {    SendCmd(id,"bind "v" "say /BIRUTAS_armas"") // this will not compile.... }
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-13-2021 at 15:55.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
frenetico9
Junior Member
Join Date: Feb 2021
Old 02-13-2021 , 16:02   Re: weapons menu plugin
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
change
Code:
RegisterHam(Ham_Spawn, "player", "xHam_Spawn", true)

to
Code:
RegisterHam(Ham_Spawn, "player", "xMenuGuns", true)


also why the slow hacking?

Code:
public client_connect(id) {    SendCmd(id,"bind "v" "say /BIRUTAS_armas"") // this will not compile.... }
I did not understand your question, my English is not very good, but just changing the command above will solve?
frenetico9 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 22:52.


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