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

Secondary weapon menu for CT only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dRiiZ
New Member
Join Date: Sep 2018
Old 09-23-2018 , 04:04   Secondary weapon menu for CT only
Reply With Quote #1

* I want a weapon menu that contains DEAGLE, USP, FIVESEVEN, SCOUT only for the CT team.

HTML Code:
\r[ CS ] \wChoose gun:
1. \wDeagle 
2. \rUSP
3. \yFiveSeven
4. \gScout
- Menus appear at each round start after 5 seconds.
- If the player did not choose the weapon he can open the menu by ordering "/guns"
- The menu can only be used once per round.

* If a Tero writes in the chat command "/guns" a specific message appears.
dRiiZ is offline
dRiiZ
New Member
Join Date: Sep 2018
Old 09-24-2018 , 10:12   Re: Secondary weapon menu for CT only
Reply With Quote #2

Anyone ?
dRiiZ is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 09-24-2018 , 11:22   Re: Secondary weapon menu for CT only
Reply With Quote #3

No bump please if anyone can help than they will
__________________
SED LYF !!!
SHIELD755 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 09-24-2018 , 11:37   Re: Secondary weapon menu for CT only
Reply With Quote #4

ok, by editing some plugins, i get it, but it is not really what you asked for, btw i havent tested it
Code:
#include <amxmodx>
#include <fun>
#include <colorchat>
#include <cstrike>
#include <amxmisc>

#define PLUGIN "gunsmenu"
#define VERSION "0.1"
#define AUTHOR "Nutu."


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd( "say /guns", "gunsmenu" )
	register_clcmd( "say_team /guns", "gunsmenu" )
}
public gunsmenu( id )
{
	if(get_user_team(id) == CS_TEAM_CT)
	{
		new szMenu = menu_create( "\r[ CS ] \wCHOOSE GUNS", "rifles" );
		menu_additem( szMenu, "\yDeagle" );
		menu_additem( szMenu, "\yUSP" );
		menu_additem( szMenu, "\yFiveSeven" );
		menu_additem( szMenu, "\yScout" );
		menu_display( id, szMenu );
	}
	else if (get_user_team(id) == CS_TEAM_T)
	{
		ColorChat(id, GREEN, "Only CT has acces to this menu");
	}
	return PLUGIN_CONTINUE;
}
public rifles( id, szMenu, szItem )
{
	
	if( szItem == MENU_EXIT )
	{
		menu_destroy( szMenu );
		return PLUGIN_CONTINUE;
	}
	menu_display( id, szMenu );
	
	switch( szItem )
	{
		case 0:
		{
			give_item(id, "weapon_deagle");
			cs_set_user_bpammo(id, CSW_DEAGLE, 200);
			ColorChat(id, GREEN,"You've got a deagle.");
		}
		case 1:
		{
			give_item(id, "weapon_usp");
			cs_set_user_bpammo(id, CSW_USP, 200);
			ColorChat(id, GREEN,"You've got an usp.");
		}
		case 2:
		{
			give_item(id, "weapon_fiveseven");
			cs_set_user_bpammo(id, CSW_FIVESEVEN, 200);
			ColorChat(id, GREEN,"You've got a fiveseven");
		}
		case 3:
		{
			give_item(id, "weapon_scout");
			cs_set_user_bpammo(id, CSW_SCOUT, 200);
			ColorChat(id, GREEN,"You've got a scout");
		}
	}
}
Wait for others to make it open after 5 seconds, acually now it opens only if you write /guns
Wait for others to make the menu can be used only once per round
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-24-2018 , 15:02   Re: Secondary weapon menu for CT only
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <fun>
#include <colorchat>
#include <cstrike>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "gunsmenu"
#define VERSION "0.1"
#define AUTHOR "Nutu."

new bool:g_UseMenu[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"say /guns""gunsmenu" )
    
register_clcmd"say_team /guns""gunsmenu" )
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1)
    
register_event("HLTV","EventNewRnd""a""1=0""2=0")
}

public 
EventNewRnd()
{
    new 
iPlayers[32], iNumid
    get_players
(iPlayersiNum"ceh","CT"
    
for(new i;iNumi++)
    {
        
id iPlayers[i]

        
g_UseMenu[id] = false
    
}
}

public 
PlayerSpawn(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT)
        
set_task(5.0"gunsmenu"id)
}

public 
gunsmenuid )
{
    if(
get_user_team(id) == CS_TEAM_CT)
    {
        new 
szMenu menu_create"\r[ CS ] \wCHOOSE GUNS""rifles" );
        
menu_additemszMenu"\yDeagle" );
        
menu_additemszMenu"\yUSP" );
        
menu_additemszMenu"\yFiveSeven" );
        
menu_additemszMenu"\yScout" );
        
menu_displayidszMenu );
    }
    else if (
get_user_team(id) == CS_TEAM_T)
    {
        
ColorChat(idGREEN"Only CT has acces to this menu")
        return 
PLUGIN_HANDLED
    
}
    if(
g_UseMenu[id])
    {
        
ColorChat(idGREEN"Buy is limited 1 by round")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE;
}
public 
riflesidszMenuszItem )
{
    
    if( 
szItem == MENU_EXIT )
    {
        
menu_destroyszMenu );
        return 
PLUGIN_CONTINUE;
    }
    
menu_displayidszMenu );
    
    switch( 
szItem )
    {
        case 
0:
        {
            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE200);
            
ColorChat(idGREEN,"You've got a deagle.");
        }
        case 
1:
        {
            
give_item(id"weapon_usp");
            
cs_set_user_bpammo(idCSW_USP200);
            
ColorChat(idGREEN,"You've got an usp.");
        }
        case 
2:
        {
            
give_item(id"weapon_fiveseven");
            
cs_set_user_bpammo(idCSW_FIVESEVEN200);
            
ColorChat(idGREEN,"You've got a fiveseven");
        }
        case 
3:
        {
            
give_item(id"weapon_scout");
            
cs_set_user_bpammo(idCSW_SCOUT200);
            
ColorChat(idGREEN,"You've got a scout");
        }
        
g_UseMenu[id] = true
    
}
}

public 
client_putinserver(id)
{
    
g_UseMenu[id] = false

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 09-24-2018 at 15:03.
iceeedr is offline
Send a message via Skype™ to iceeedr
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 15:47.


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