Raised This Month: $ Target: $400
 0% 

add CT


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
jonny1990
Senior Member
Join Date: Apr 2020
Old 05-16-2020 , 05:43   add CT
Reply With Quote #1

Hello! help add even and CT here, that would him, too, a grenade was issued if he remained one

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN 	"New Nades"
#define VERSION 	"0.1"
#define AUTHOR 	"GloOm"

#define MENU_KEYS ( 1<<0 | 1<<1 )

new g_pNewNades;
new g_pFlashbangs;
new g_pSmokeGrenade;
new g_pHeGrenade;

new g_szNadeMenu[ 64 ];


public plugin_init()
{
   	register_plugin( PLUGIN, VERSION, AUTHOR );
	g_pNewNades = register_cvar( "hns_newnades", "1" );
	g_pFlashbangs = register_cvar( "hns_flashbangs", "2" );
	g_pHeGrenade = register_cvar( "hns_hegrenade", "0" );
	g_pSmokeGrenade = register_cvar( "hns_smokegrenade", "1" );
	
	register_event( "DeathMsg", "eventDeathMsg", "a" );
}

public plugin_cfg()
{
	new iLen = charsmax( g_szNadeMenu );
	
	add( g_szNadeMenu, iLen, "\yНужна граната?^n^n" );
	add( g_szNadeMenu, iLen, "\r1. \wДа^n" );
	add( g_szNadeMenu, iLen, "\r2. \wНет" );
		
	register_menucmd( register_menuid( "NadesMenu" ), MENU_KEYS, "HandleNadeMenu" );
}

public eventDeathMsg()
{	
	if( g_pNewNades )
	{
		new iPlayers[ 32 ], iNum;
		get_players( iPlayers, iNum, "ae", "TERRORIST" );
			
		if( iNum == 1 )
		{
			show_menu( iPlayers[ 0 ], MENU_KEYS, g_szNadeMenu, 7, "NadesMenu" );
		}
	}
}

public HandleNadeMenu( id, iKey )
{
	if( !iKey )
	{
		GiveGrenades( id );
	}
}

GiveGrenades( const id )
{
	if( get_pcvar_num( g_pFlashbangs ) )
	{
		give_item( id, "weapon_flashbang" );
		cs_set_user_bpammo( id, CSW_FLASHBANG, get_pcvar_num( g_pFlashbangs ) );
	}
				
	new iCvar = get_pcvar_num( g_pSmokeGrenade ); 
			
	if( iCvar == 1 || iCvar == 3 )
	{
		give_item( id, "weapon_smokegrenade" );
	}
			
	iCvar = get_pcvar_num( g_pHeGrenade );
			
	if( iCvar == 1 || iCvar == 3 )
	{
		give_item( id, "weapon_hegrenade" );
	}
}

Last edited by jonny1990; 05-16-2020 at 06:39.
jonny1990 is offline
 



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 17:10.


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