Награди за терористите (бм точки , хп)

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 93
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 10 пъти
Получена благодарност: 1 път

Награди за терористите (бм точки , хп)

Мнение от tom1k » 05 Апр 2021, 23:59

Възможно ли е да се направи плъгин който когато Терорист остане сам примерно срещу (1,2,3,4 или 5 полицая) и спечели рунда да дава награди на целия отбор? Примерно, само аз съм жив от отбора ми и съм срещу 3 полицая, ако успея да издържа до края на рунда и да даде на целия отбор 3 Blockmaker точки и 30 XP? Примерно ако съм срещу 2ма, да даде 2 Blockmaker точки и 20XP и така до от 1 БМ точка/10XP до 5 БМ точки/50 XP? И ако може да се активира само сме 10 или над 10 човека.

Blockmaker Shop плъгина който ползвам:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>
#include <colorchat>
#include <nvault>

new const P[] = "HNS Shop Edited"
new const A[] = "xPaw & Grim"
new const V[] = "1.0"

new const prefix[] = "^3International-Gaming^4"

//Natives for Anti-Frost and XP
native add_user_immune( id );
native remove_user_immune( id );

native hnsxp_get_user_xp(client);
native hnsxp_set_user_xp(client, xp);

stock hnsxp_add_user_xp(client, xp) {
	return hnsxp_set_user_xp(client, hnsxp_get_user_xp(client) + xp);
}
//End Natives

new bm_points[33], AwpReward, HeadshotReward, NormalReward, KillMessage, g_vault

// Cost of items
new deaglecost, m3cost, awpcost, hecost;
new healthcost, healthammount, armorcost, armorammount;
new noflashcost, nofrostcost;
new xpcost, xpamount;
new respawncost;

//Used or not?
new userhealth[33], userarmor[33], userawp[33], usernoflash[33], usernofrost[33], userxp[33];
new userrespawn[33], userm3[33], userdeagle[33], userhe[33]


//Floats
new Float:g_gametime2;
new Float:g_gametime, g_owner;

//For Anti-Flash
new grenade[32];
new bool:g_track_enemy;
new bool:g_track[33];
new g_msgScreenFade, last;
new g_sync_check_data;

//Plugin init
public plugin_init( )
{
	register_plugin(P,V,A)
	register_clcmd( "say /shop", "bm_hns_shop" )
	register_clcmd( "say_team /shop", "bm_hns_shop" )
	register_clcmd( "say /hnsshop", "bm_hns_shop" )
	register_clcmd( "say_team /hnsshop", "bm_hns_shop" )
	register_clcmd( "say /bmshop", "bm_hns_shop" )
	register_clcmd( "say_team /bmshop", "bm_hns_shop")
	register_clcmd( "say /points", "MyPoints" )
	register_clcmd( "say_team /points", "MyPoints" )
	
	// admin command to give bm points
	register_concmd("amx_give_bm_points", "cmd_give_bmpoints", ADMIN_RCON, "<Name> <BM Points Amount>")
	register_concmd("amx_take_bm_points", "cmd_take_bmpoints", ADMIN_RCON, "<Name> <BM Points Amount>")
	register_concmd("amx_give_bm_points_all", "cmd_give_bmpoints_all", ADMIN_RCON, "<BM Points Amount>")
	
	// events 
	RegisterHam(Ham_Spawn, "player", "fwPlayerSpawn", 1)
	register_event("DeathMsg", "eDeath", "a");
	register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199");
	register_event("TextMsg", "fire_in_the_hole", "b", "2&#Game_radio", "4&#Fire_in_the_hole");
	register_event("TextMsg", "fire_in_the_hole2", "b", "3&#Game_radio", "5&#Fire_in_the_hole");
	register_event("99", "grenade_throw", "b");
	
	// shop cvars
	hecost = register_cvar( "bm_shop_hecost", "25" )
	healthammount = register_cvar( "bm_shop_healthammount", "100" )
	healthcost = register_cvar( "bm_shop_healthcost", "15" )
	armorammount = register_cvar( "bm_shop_armorammount", "100" )
	armorcost = register_cvar( "bm_shop_armorcost", "10" )
	awpcost = register_cvar( "bm_shop_awpcost", "75" )
	respawncost = register_cvar( "bm_shop_respawncost", "100" )
	m3cost = register_cvar( "bm_shop_m3cost", "60" )
	deaglecost = register_cvar( "bm_shop_deaglecost", "60" )
	noflashcost = register_cvar( "bm_shop_noflashcost", "40" )
	nofrostcost = register_cvar( "bm_shop_nofrostcost", "40" )
	xpcost = register_cvar( "bm_shop_xpcost", "20" )
	xpamount = register_cvar( "bm_shop_xpamount", "1000" )
	
	AwpReward = register_cvar("bm_shop_awp_kill_reward", "5")
	HeadshotReward = register_cvar("bm_shop_headshot_kill_reward", "3")
	NormalReward = register_cvar("bm_shop_normal_kill_reward", "2")
	KillMessage = register_cvar("bm_shop_kill_message", "1")
	
	//tasks
	set_task( 2.0, "flash",_,_,_, "b" );
	g_msgScreenFade = get_user_msgid("ScreenFade");
	
	g_vault = nvault_open("BmPointsShop")
	
}

//hackera457 Code
///////////////////////////
public plugin_natives()
{
	register_library("bmshop_edit");
	register_native("bm_get_user_points", "_get_points");
	register_native("bm_set_user_points", "_set_points");
}

public _set_points(iPlugin,iParams)
{
	new iUser = get_param(1), iPoints = get_param(2);
	
	bm_points[iUser] = iPoints;
	SaveData(iUser);
}

public _get_points(iPluign,iParams)
{
	new iUser = get_param(1);
	return bm_points[iUser];
}
////////////////////////////////////

public fwPlayerSpawn(id) {
	if(is_user_alive(id)) {
		userhe[id] = 0;
		userhealth[id] = 0;
		userarmor[id] = 0;
		userawp[id] = 0;
		usernoflash[id] = 0;
		usernofrost[id]	 = 0;
		userxp[id] = 0;
		userm3[id] = 0;
		userdeagle[id] = 0;
		userrespawn[id] = 0;
		
		remove_user_immune(id);
	}
}
//When player connects
public client_connect( id ) {
	userhe[id] = 0;
	userhealth[id] = 0;
	userarmor[id] = 0;
	userawp[id] = 0;
	usernoflash[id] = 0;
	usernofrost[id]	 = 0;
	userxp[id] = 0;
	userm3[id] = 0;
	userdeagle[id] = 0;
	userrespawn[id] = 0;
	
	remove_user_immune(id);
	
	LoadData(id);
}

public client_disconnected( id ) {
	userhealth[id] = 0;
	userarmor[id] = 0;
	userhe[id] = 0;
	usernoflash[id] = 0;
	usernofrost[id]	 = 0;
	userawp[id] = 0;
	userm3[id] = 0;
	userdeagle[id] = 0;
	userxp[id] = 0;
	userrespawn[id] = 0;
	
	remove_user_immune(id);
	SaveData(id);
}
public client_putinserver(id) {
	LoadData(id);
}
public eDeath( id ) {
	new killer = read_data(1);
	new victim = read_data(2);
	
	if(!is_user_connected(killer) || !is_user_connected(victim) || killer == victim)
		return PLUGIN_HANDLED;
	
	new headshot = read_data(3)
	
	new weapon[32]
	read_data(4, weapon, charsmax(weapon))
	
	new award
	
	if(equali(weapon, "awp")) award = get_pcvar_num(AwpReward)
	else if(headshot) award = get_pcvar_num(HeadshotReward)
		else award = get_pcvar_num(NormalReward)
	bm_points[killer] += award
	
	if(get_pcvar_num(KillMessage) == 1) {
		new name_victim[32]
		get_user_name(victim, name_victim, 31)
		
		ColorChat(killer, NORMAL, "^4[%s] ^1You got^3 %i^1 points for killing^4 %s", prefix, award, name_victim)
	}
	
	return PLUGIN_CONTINUE;
}
public MyPoints(id) {
	ColorChat(id, GREY, "^4[%s]^3 BM Credits:^4 %d", prefix, bm_points[id])
}
public bm_hns_shop(id) {
	if(cs_get_user_team(id) == CS_TEAM_CT) {
		hns_shop(id)
	} else { 
		ColorChat(id, BLUE, "^4[%s]^1 This menu is avaliable only for^3 CT's^1.", prefix)
	}
}
public hns_shop( id ) {
	new szShop[200], szHE[200], szHealth[200], szDeagle[200], szM3[200], szArmor[200], szAwp[200], szRespawn[200], szNoFrost[200], szXP[200], szNoFlash[200];
	
	formatex( szShop, charsmax( szShop ), "\w[\rInternational-Gaming\w] \wBlockmaker Shop^n\rYour BM Credits: \y%d\d", bm_points[id] );
	formatex( szHealth, charsmax( szHealth ), "\w%d Health Points  - \d(\r%d \wBM Credits)", get_pcvar_num( healthammount ), get_pcvar_num( healthcost ) );
	formatex( szArmor, charsmax( szArmor ), "\w%d Armor Points - \d(\r%d \wBM Credits)", get_pcvar_num( armorammount ), get_pcvar_num( armorcost ) );
	formatex( szHE, charsmax( szHE ), "\w1 HE Grenade - \d(\r%d \wBM Credits)", get_pcvar_num( hecost ) );
	formatex( szNoFrost, charsmax( szNoFrost ), "\wNo Frost (\r1 \wROUND) - \d(\r%d \wBM Credits)", get_pcvar_num( nofrostcost ) );
	formatex( szNoFlash, charsmax( szNoFlash ), "\wNo Flash (\r1 \wROUND) - \d(\r%d \wBM Credits)", get_pcvar_num(noflashcost));
	formatex( szAwp, charsmax( szAwp ), "\wAWP - \d(\r%d \wBM Credits)", get_pcvar_num( awpcost ) );
	formatex( szM3, charsmax( szM3 ), "\wM3 Shotgun - \d(\r%d \wBM Credits)", get_pcvar_num( m3cost ) );
	formatex( szDeagle, charsmax( szDeagle ), "\wDeagle - \d(\r%d \wBM Credits)", get_pcvar_num(deaglecost));
	formatex( szXP, charsmax( szXP ), "\w%d XP - \d(\r%d \wBM Credits)", get_pcvar_num(xpamount), get_pcvar_num( xpcost ) );
	formatex( szRespawn, charsmax( szRespawn ), "\wRespawn - \d(\r%d \wBM Credits)", get_pcvar_num( respawncost ) );
	
	
	new shop = menu_create( szShop, "shop_handler" );
	menu_additem( shop, szHealth, 	"1", 0 );
	menu_additem( shop, szArmor, 	"2", 0 );
	menu_additem( shop, szHE, 	"3", 0 );
	menu_additem( shop, szNoFrost, 	"4", 0 );
	menu_additem( shop, szNoFlash, 	"5", 0 );
	menu_additem( shop, szAwp, 	"6", 0 );
	menu_additem( shop, szM3, 	"7", 0 );
	menu_additem( shop, szDeagle, 	"8", 0 );
	menu_additem( shop, szXP, 	"9", 0 );
	menu_additem( shop, szRespawn, 	"10", 0 );
	
	menu_setprop( shop, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( shop, MPROP_NUMBER_COLOR, "\r")
	menu_display( id, shop, 0 );
}

public shop_handler( id, shop, item ) {
	if( item == MENU_EXIT ) {
		menu_destroy( shop );
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo( shop, item, access, data, 6, iName, 63, callback )
	
	new key = str_to_num( data );
	
	switch( key )
	{
		case 1: // Health
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead!", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userhealth[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before!", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id]>= get_pcvar_num( healthcost ) ) {
				bm_points[id] -= get_pcvar_num( healthcost )
				new userhp = get_user_health( id )
				new health = get_pcvar_num( healthammount )
				set_user_health( id, userhp + health )
				userhealth[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought^3 %d Health!", prefix , get_pcvar_num( healthammount ) )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy^3 %d Health!", prefix , get_pcvar_num( healthammount ) )
			}
		}
		case 2: // Armor
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead!", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userarmor[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before!", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num( armorcost ) ) {
				bm_points[id] -= get_pcvar_num( armorcost )
				new playerarmor = get_user_armor( id )
				new armor = get_pcvar_num( armorammount )
				set_user_armor( id, playerarmor + armor )
				userarmor[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought^3 %d Armor!", prefix, get_pcvar_num( armorammount ) )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy^3 %d Armor!", prefix, get_pcvar_num( armorammount ) )
			}
		}
		case 3: // 1 HE
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userhe[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num( hecost ) ) {
				bm_points[id] -= get_pcvar_num( hecost )
				give_item( id, "weapon_hegrenade" )
				userhe[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought a^3 HE Grenade!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy a^3 HE Grenade!", prefix )
			}
		}
		case 4: // No Frost
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(usernofrost[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num( nofrostcost ) ) {
				bm_points[id] -= get_pcvar_num( nofrostcost )
				add_user_immune( id );
				usernofrost[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought^3 Anti-Frost!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy^3 Anti-Frost!", prefix )
			}
		}
		case 5: // No Flash
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(usernoflash[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num(noflashcost) ) {
				bm_points[id] -= get_pcvar_num(noflashcost)
				usernoflash[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought^3 Anti-Flash!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy^3 Anti-Flash!", prefix )
			}
		}
		case 6: // AWP 1 Bullet
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userawp[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num(awpcost) ) {
				bm_points[id] -= get_pcvar_num(awpcost)
				fm_give_item( id, "weapon_awp" )
				cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_awp", id ), 1 )
				cs_set_user_bpammo(id, CSW_AWP, 0)
				new awpname[42]
				get_user_name(id, awpname, 32)
				set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 4.0)
				show_hudmessage(0, "%s bought an Awp! Watch out!", awpname)
				userawp[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought an^3 AWP!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy an^3 AWP!", prefix )
			}
		}
		case 7: // M3 1 Bullet
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userm3[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >=get_pcvar_num(m3cost) ) {
				bm_points[id] -= get_pcvar_num(m3cost)
				fm_give_item( id, "weapon_m3" )
				cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_m3", id ), 1 )
				cs_set_user_bpammo(id, CSW_M3, 0)
				new m3name[42]
				get_user_name(id, m3name, 32)
				set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 4.0)
				show_hudmessage(0, "%s bought an M3! Watch out!", m3name)
				userm3[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought an^3 M3!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy an^3 M3!", prefix )
			}
		}
		case 8: // Deagle 1 Bullets
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userdeagle[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num(deaglecost) ) {
				bm_points[id] -= get_pcvar_num(deaglecost)
				fm_give_item( id, "weapon_deagle" )
				cs_set_weapon_ammo( find_ent_by_owner( 1, "weapon_deagle", id ), 1 )
				cs_set_user_bpammo(id, CSW_DEAGLE, 0)
				userdeagle[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought an^3 Deagle!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy an^3 Deagle!", prefix )
			}
		}
		case 9: // XP
		{
			if( !is_user_alive( id ) ) {
				ColorChat( id, NORMAL,"^4[%s]^3 You cannot buy items when your dead.", prefix );
				return PLUGIN_HANDLED; 
			}
			if(userxp[id] > 0) {
				ColorChat( id, NORMAL, "^4[%s]^3 You've already bought this before.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num(xpcost) ) {
				bm_points[id] -= get_pcvar_num(xpcost)
				new xp_amount = get_pcvar_num(xpamount)
				hnsxp_add_user_xp(id, xp_amount);
				userxp[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought^3 %d XP!", prefix, xp_amount )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy^3 %d XP!", prefix, get_pcvar_num(xpamount) )
			}
		}
		case 10: // Respawn
		{
			if(is_user_alive(id)) {
				ColorChat( id, NORMAL, "^4[%s]^1 You cannot buy a^3 Respawn^4 while you are alive.", prefix );
				return PLUGIN_HANDLED;
			}
			if( bm_points[id] >= get_pcvar_num(respawncost) ) {
				bm_points[id] -= get_pcvar_num(respawncost)
				ExecuteHamB(Ham_CS_RoundRespawn, id);
				new respawnname[42]
				get_user_name(id, respawnname, 32)
				set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 4.0)
				show_hudmessage(0, "%s bought a respawn! Kill him!", respawnname)
				userrespawn[id]++;
				ColorChat( id, NORMAL, "^4[%s]^1 You've bought a^3 Respawn!", prefix )
				} else {
				ColorChat( id, NORMAL, "^4[%s]^1 You need more BM Credits to buy a^3 Respawn!", prefix )
			}
		}
		
	}
	
	menu_destroy( shop );
	return PLUGIN_HANDLED;
}
// Anti-Flash - Start
public flash() {
	new Float:gametime = get_gametime();
	if(gametime - g_gametime2 > 2.5)
		for(new i = 0; i < 32; i++)
		grenade[i] = 0;
}

public eventFlash( id ) {
	new Float:gametime = get_gametime();
	if(gametime != g_gametime) { 
		g_owner = get_grenade_owner();
		g_gametime = gametime;
		for(new i = 0; i < 33; i++) 
			g_track[i] = false;
		g_track_enemy = false;
	}    
	if(is_user_connected(g_owner) && usernoflash[id] > 0) {
		g_track_enemy = true;
		
		message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id);
		write_short(1);
		write_short(1);
		write_short(1);
		write_byte(0);
		write_byte(0);
		write_byte(0);
		write_byte(255);
		message_end();
	}
}
public flash_delay() {
	if(g_track_enemy == false) {
		for(new i = 0; i < 33; i++) {
			if(g_track[i] == true && is_user_connected(i)) {
				message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, i) ;
				write_short(1);
				write_short(1);
				write_short(1);
				write_byte(0);
				write_byte(0);
				write_byte(0);
				write_byte(255);
				message_end();
			}
		}
	}
}

public grenade_throw() {
	if(g_sync_check_data == 0)
		return PLUGIN_CONTINUE;
	g_sync_check_data--;
	if(read_datanum() < 2)
		return PLUGIN_HANDLED_MAIN;
	
	if(read_data(1) == 11 && (read_data(2) == 0 || read_data(2) == 1))
		add_grenade_owner(last);
	
	return PLUGIN_CONTINUE;
}
public fire_in_the_hole() {
	new name[32];
	read_data(3, name, 31);
	new temp_last = get_user_index(name);
	new junk;
	if((temp_last == 0) || (!is_user_connected(temp_last)))
		return PLUGIN_CONTINUE;
	if(get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) {
		last = temp_last;
		g_sync_check_data = 2; 
	}
	return PLUGIN_CONTINUE;
}

public fire_in_the_hole2() {
	new name[32];
	read_data(4, name, 31);
	new temp_last = get_user_index(name);
	new junk;
	if((temp_last == 0) || (!is_user_connected(temp_last)))
		return PLUGIN_CONTINUE;
	if(get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) {    
		last = temp_last;
		g_sync_check_data = 2;
	}
	return PLUGIN_CONTINUE;
}
add_grenade_owner(owner) {
	new Float:gametime = get_gametime();
	g_gametime2 = gametime;
	for(new i = 0; i < 32; i++) {
		if(grenade[i] == 0) {
			grenade[i] = owner;
			return;
		}
	}
}
get_grenade_owner() {
	new which = grenade[0];
	for(new i = 1; i < 32; i++)  
		grenade[i-1] = grenade[i];
	grenade[31] = 0;
	return which;
}

// from XxAvalanchexX "Flashbang Dynamic Light"
public fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch) {
	if(!equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav"))
		return FMRES_IGNORED;
	
	new Float:gametime = get_gametime();
	
	//in case no one got flashed, the sound happens after all the flashes, same game time
	if(gametime != g_gametime) {
		g_owner = get_grenade_owner();
		return FMRES_IGNORED;
	}
	return FMRES_IGNORED;
}
// NoFlash Blinding - End 

// Cmd Give/Take BM Points
public cmd_give_bmpoints(id, level,cid) {
	if(!cmd_access (id, level, cid, 3))
		return PLUGIN_HANDLED;
	
	new target[32], amount[32], reason[32]
	
	read_argv(1, target, charsmax(target))
	read_argv(2, amount, charsmax(amount))
	read_argv(3, reason, charsmax(reason))
	
	new player = cmd_target(id, target, 8)
	
	if( ! player ) 
		return PLUGIN_HANDLED;
	
	new admin_name[32], target_name[32]
	get_user_name(id, admin_name, charsmax(admin_name))
	get_user_name(player, target_name, charsmax(target_name))
	
	new points = str_to_num(amount)
	
	bm_points[player] += points
	ColorChat(player, GREY, "^4[%s]^1 ADMIN:^4 %s^1 gave you^3 %s ^4 %i BM Credits^1. Now you have:^4 %d BM Credits!",prefix, admin_name, target_name, points, bm_points[player])
	SaveData(id)
	
	return PLUGIN_CONTINUE;
}

public cmd_take_bmpoints(id, level,cid) {
	if(!cmd_access (id, level, cid, 3))
		return PLUGIN_HANDLED;
	
	new target[32], amount[32], reason[32]
	
	read_argv(1, target, charsmax(target))
	read_argv(2, amount, charsmax(amount))
	read_argv(3, reason, charsmax(reason))
	
	new player = cmd_target(id, target, 8)
	
	if(!player) 
		return PLUGIN_HANDLED;
	
	new admin_name[32], target_name[32]
	get_user_name(id, admin_name, charsmax(admin_name))
	get_user_name(player, target_name, charsmax(target_name))
	
	new points = str_to_num(amount)
	
	if(bm_points[player] < points) {
		console_print(id, "Player %s doesn't even have %d BM Points! He has: %d BM Points.", target_name, points, bm_points[player])
		return PLUGIN_HANDLED
	}
	bm_points[player] -= points
	ColorChat(player, TEAM_COLOR, "^4[%s]^1 ADMIN:^4 %s^1 took from you^3 %s ^4 %i BM Credits^1. Now you have:^4 %d BM Credits^1!", prefix, admin_name, target_name, points, bm_points[player])
	SaveData(id)
	
	return PLUGIN_CONTINUE;
}
public cmd_give_bmpoints_all(id, level, cid) {
	if(!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new amount[32]
	
	read_argv(1, amount, charsmax(amount))
	
	new admin_name[32]
	get_user_name(id, admin_name, charsmax(admin_name))
	
	new points = str_to_num(amount)
	
	new players[32], num
	get_players(players, num, "ch")
	
	for(new i; i < num; i++)
		bm_points[players[i]] += points
	
	ColorChat(0,NORMAL, "^4[%s]^1 ADMIN ^4%s: ^1gave ^4%i^1 BM Credits to ^4all ^1players", prefix, admin_name, points)
	SaveData(id)
	
	return PLUGIN_CONTINUE
}

// Nvault
public SaveData(id) {
	new name[32]
	get_user_name(id, name, charsmax(name))
	new vaultkey[64], vaultdata[256]
	
	format(vaultkey, charsmax(vaultkey), "%s", name)
	format(vaultdata, charsmax(vaultdata), "%i", bm_points[id])
	nvault_set(g_vault, vaultkey, vaultdata)
	
	return PLUGIN_CONTINUE
}

LoadData(id) {
	new name[32]
	get_user_name(id, name, charsmax(name))
	new vaultkey[64], vaultdata[256]
	
	format(vaultkey, charsmax(vaultkey), "%s", name)
	format(vaultdata, charsmax(vaultdata), "%i", bm_points[id])
	nvault_get(g_vault, vaultkey, vaultdata, charsmax(vaultdata))
	
	new points_user[10]
	parse(vaultdata, points_user, charsmax(points_user))
	
	new points_set = str_to_num(points_user)
	bm_points[id] = points_set
	
	return PLUGIN_CONTINUE
}
International-Gaming ~ HNS Blockmaker
185.148.145.233:27019


International-Gaming ~ D2 Only
185.148.145.236:27017

Аватар
tom1k
Извън линия
Потребител
Потребител
Мнения: 93
Регистриран на: 29 Сеп 2020, 23:50
Местоположение: Добрич
Се отблагодари: 10 пъти
Получена благодарност: 1 път

Награди за терористите (бм точки , хп)

Мнение от tom1k » 07 Апр 2021, 23:23

Още ми трябва, благодаря!
International-Gaming ~ HNS Blockmaker
185.148.145.233:27019


International-Gaming ~ D2 Only
185.148.145.236:27017

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Yandex [Bot] и 7 госта