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

Hi i want this plugin perfectly working :D


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abdulrazzaq
Member
Join Date: Oct 2019
Location: NZ
Old 08-29-2020 , 08:36   Hi i want this plugin perfectly working :D
Reply With Quote #1

This is a perfect plugin i want i saw 1.5 version here but it is useless and not working lol

https://forums.alliedmods.net/showthread.php?t=244122

but 1.4 version is working fine i need some changes if someone can do
can someone make this plugin explode immediately or add a cvar of timer too atleast i can set how much time it will took to explode ....ppl enjoy this plugin a lot ...in my server ...and they always request to blast it urgent ...bcz they wan't to save themselves by getting knifed







Code:
/*
	Suicide Bomber Information Center:
	
	The 'Suicide Bomber' idea came to me from a
	somewhat old mod that Exolent made (I've
	also made a version myself). Once you've
	gotten enough cash (cvar controlled), you
	will be permitted to purchase a 'Suicide Bomb'.
	You will then be able to activate it and blow
	anyone up in a certain radius of yourself, 
	thus creating an epic death scene.
*/

#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cstrike>

#define PLUGIN	"Suicide Bomb"
#define AUTHOR	"GXLZPGX"
#define VERSION	"1.4"

#define is_player(%1)    (1 <= %1 <= g_iMaxPlayers)
#define BOMB			100

/* Self explanitory private variables */
new g_BombTimer[33];

/* Self explanitory private bools */
new bool:g_HasBomb[33];
new bool:g_BombRemoved[33];

/* Self explanitory public variables */
new pcvar_BombEnable;
new pcvar_BombPrice;
new pcvar_BombRadius;
new pcvar_BombFF;

/* Self explanitory public bools */
new bool:g_RoundEnded;

/* Self explanitory sound path */
new const gszC4[] = "weapons/c4_beep4.wav"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	/* Player commands */
	register_clcmd( "say /buybomb", "Bomb_Buy" )
	register_clcmd( "say /bb", "Bomb_Buy" )
	register_clcmd( "say_team /buybomb", "Bomb_Buy" )
	register_clcmd( "say_team /bb", "Bomb_Buy" )
	
	/* Server vars */
	pcvar_BombEnable	=	register_cvar( "sb_enabled", "1" )
	pcvar_BombPrice		=	register_cvar( "sb_price", "8000" )
	pcvar_BombRadius	=	register_cvar( "sb_radius", "400" )
	pcvar_BombFF		=	register_cvar( "sb_friendlyfire", "0" )
	
	/* Hooking flashlight */
	register_impulse( 100, "Event_Flashlight" )
	
	/* Round beginning */
	register_logevent( "Event_RoundBegin", 2, "1=Round_Start" );
	
	/* Round ending */
	register_logevent( "Event_RoundEnd", 2, "1=Round_End" )
}

public client_disconnect(id)
{
	g_HasBomb[id] = false;
}

public plugin_precache()
{
	precache_sound( gszC4 )
}

public Event_RoundEnd()
{
	g_RoundEnded = true;
}

public Event_RoundBegin()
{
	g_RoundEnded = false;
	
	arrayset( g_HasBomb, false, charsmax(g_HasBomb) )
	arrayset( g_BombRemoved, false, charsmax(g_BombRemoved) )
}

public Bomb_Buy(id)
{
	if( get_pcvar_num(pcvar_BombEnable) == 0 )
	{
		client_print( id, print_chat, "[Suicide Bomb] Suicide bombs are currently disabled." )
		return PLUGIN_HANDLED;
	}
	
	new szBombMenu[104];
	formatex( szBombMenu, charsmax(szBombMenu), "\ySuicide Bomb Shop^n\rCurrent Price:\w %d^n^n\w Are you sure you want to buy a suicide bomb?", get_pcvar_num(pcvar_BombPrice) )
	new menu = menu_create( szBombMenu, "BombMenu_Handler" )
	
	menu_additem( menu, "Yes", "1", 0 )
	menu_additem( menu, "No", "2", 0 )
	
	menu_display( id, menu, 0 )
	menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
	
	return PLUGIN_HANDLED
}

public BombMenu_Handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu );
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo( menu, item, access, data, 6, iName, 63, callback )
	
	new key = str_to_num( data );
	
	switch( key )
	{
		case 1:
		{
			new money = cs_get_user_money(id)
			
			if( (money >= get_pcvar_num(pcvar_BombPrice)) && g_BombRemoved[id] == false )
			{
				cs_set_user_money( id, money - get_pcvar_num(pcvar_BombPrice) )
				client_print( id, print_chat, "[Suicide Bomb] You're now armed with a suicide bomb. Use your flashlight to activate it." )
				g_HasBomb[id] = true;
				g_BombRemoved[id] = true;
			} else {
				client_print( id, print_chat, "[Suicide Bomb] You're not permitted to use that, soldier!" )
			}
		}
	}
	
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public Event_Flashlight(id)
{
	if( !is_user_alive(id) )
	{
		return PLUGIN_HANDLED;
	}
	
	if( g_HasBomb[id] == true && g_RoundEnded == false )
	{
		g_BombTimer[id] = 3;
		
		if( task_exists( BOMB + id ) || g_BombTimer[id] < 3 )
		{
			return PLUGIN_HANDLED;
		}
		
		set_task( 1.0, "CountDownExplode", BOMB + id, _, _, "b" )
	}
	
	return PLUGIN_CONTINUE;
}

public CountDownExplode(id)
{
	id -= BOMB
	
	if( !is_user_alive(id) || g_RoundEnded == true )
	{
		remove_task( id + BOMB )
		return PLUGIN_HANDLED;
	}
	
	if( g_BombTimer[id] > 1 )
	{
		if( g_BombTimer[id] > 2 )
		{
			emit_sound(id, CHAN_AUTO, gszC4, 1.0, ATTN_NORM, 0, PITCH_NORM)
		}
		
		g_BombTimer[id] -= 1
	} else {
		Explode(id)
		
		new iPlayers[32], iNum, plr;
		get_players(iPlayers, iNum, "ah" )
		
		new origin[3];
		
		for( new i = 0; i < iNum; i++ )
		{
			plr = iPlayers[i]
			
			new origin2[3];
			
			get_user_origin( id, origin, 0 )
			get_user_origin( plr, origin2, 0 )
			
			if( get_distance( origin, origin2 ) <= get_pcvar_num(pcvar_BombRadius) && is_user_alive(plr) )
			{
				if( get_pcvar_num(pcvar_BombFF) == 1 )
				{
					user_silentkill(plr)
					
					Create_DeathMsg( plr, id )
				} else {
					if( (cs_get_user_team(id) != cs_get_user_team(plr)) )
					{
						user_silentkill(plr)
						
						Create_DeathMsg( plr, id )
					}
				}
			}
		}
		
		user_silentkill(id)
		
		remove_task( id + BOMB )
	}
	
	return PLUGIN_HANDLED;
}

Explode(id)
{
	new origin[3]
	get_user_origin(id, origin, 0)
	
	message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
	write_byte(TE_TAREXPLOSION)
	write_coord(origin[0])
	write_coord(origin[1])
	write_coord(origin[2])
	message_end()
}

public Create_DeathMsg( Victim, Attacker )
{
	message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"), {0,0,0});
	write_byte(Attacker);
	write_byte(Victim);
	write_byte(1)
	write_string("worldspawn");
	message_end();
}

Last edited by Abdulrazzaq; 08-29-2020 at 08:37.
Abdulrazzaq 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 02:42.


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