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

[Solucionado] Bazoka no mata al team contrario.


  
 
 
Thread Tools Display Modes
Author Message
twiister
Senior Member
Join Date: Mar 2013
Location: Argentina
Old 04-21-2013 , 15:44   [Solucionado] Bazoka no mata al team contrario.
#1

Hola, he buscado en todos los temas para ver si habia alguna solucion y nada. El plugins anda perfecto pero no mata al team contrario, pero eso si te mata a vos mismo :/
Alguno sabe como arreglarlo por favor? es para un sv comun.

Muchas gracias de ante mano.

Code:
/* AMX Mod X script

:: Bazooka ::

Commands:

amx_bazooka | spawn a bazooka in front of you (works in spectator mode too, admin only)

amx_bazooka_give <@all or name/id> <amount> | give someone a bazooka (admin only)

amx_bazooka_startarena <mode restrictions> <round restart 1|0> | start the bazooka arena (admin only)

amx_bazooka_endarena <set ammo> | specify new ammo for everyone and end bazooka arena (set to -1 to leave everyone's ammo alone, admin only)

Say buybazooka in chat to open a buy menu. (everyone)

Say bazookahelp in chat to open the help file. (everyone)

Cvars:

amx_bazooka_dropping :: can a player drop his bazooka?? (default: 1)

amx_bazooka_ammo :: how much ammo has the bazooka?? (default: 3)

amx_bazooka_arena :: If set to 1 every player will recieve a bazooka with unlimited ammo
at the start of the next round. While this mode is activated it requires
a direct hit to kill someone. It is also advisable to restrict the other modes.

amx_bazooka_cost :: how much does the bazooka cost to buy it? (default: 8000)

amx_bazooka_buyable :: is it possible to buy the bazooka? (default: 1)

amx_bazooka_damageradius :: How big the damage radius is (default: 250)

amx_bazooka_maxdamage :: when you are in the center, how much HP do you lose? (default: 150)

amx_bazooka_restrict :: resrict certain modes: a = Normal, b = Heat-Seeking, c = User-Guided, d = No restrictions

amx_bazooka_reloadtime :: how much time (in seconds) it takes to reload the bazooka (default: 2.5)

amx_bazooka_trailtime :: How long the bazooka trails stay in the air (best at 30)

amx_bazooka_velocity :: This only affects how fast the heat-seeking and normal rockets go (best at 700)

amx_bazooka_teamcolors :: set to 1 to use team colors (CT = blue, T = red) or set to 2 to have random colors

amx_bazooka_gib :: set to 1 to cause gib explosion if the damage is > 100 and also enough to kill the person

Special thanks to:

-=STN=- MaGe
KaOs
RadidEskimo
Freecode
EJL
JTP10181
PaintLancer
Kaddar
Vexd
twistedeuphoria
XxAvalanchexX
pimp daddy
Ronkkrop
More for making the original bazooka plugin
mike_cao for his awesome gore plugin
BAILOPAN

Notes:
1. From what i've tested on my server people seem to like team colors better than random colors.
2. I've bound some keys to bazooka arena like so:
bind "PGDN" "amx_bazooka_arena 0;amx_bazooka_maxdamage 150;amx_bazooka_damageradius 250;amx_bazooka_restrict 1;sv_gravity 800;amx_say Bazooka Arena OFF"
bind "PGUP" "amx_bazooka_arena 1;amx_bazooka_maxdamage 999999;amx_bazooka_damageradius 40;amx_bazooka_restrict 1;sv_gravity 150;amx_bazooka_give @all 1;amx_say Bazooka Arena ON;amx_say say 'bazookahelp' for more information on Bazookas"
3. When you have Bazooka arena enabled it's fun to change the reload times.
Skill mode: reloadtime is 2.5
Rapid Fire mode: reloadtime is 0
This has gotten good feedback on my test server.
4. people are intrigued by a bazooka in CS 1.6, advertise this in your server name.
*/

// Set this value to 1 if you are using Condition Zero
// I have NOT tested this plugin with CZ so I do not know if it will work
//this switch was part of Mike Cao's Gore plugin
//I believe it makes sure that the correct sprite indexes are used
#define CZERO 0


#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <fun>
#include <cstrike>
#include <amxmisc>
#include <entity_maths> //this has the function for the "heat-seeking" rockets

#define TE_EXPLOSION 		3
#define TE_EXPLFLAG_NONE 	0
#define TE_SMOKE 		5
#define TE_BLOODSPRITE		115
#define	TE_BLOODSTREAM		101
#define TE_MODEL		106
#define TE_WORLDDECAL		116
#define BA_NORMAL 		(1<<0) // "a"
#define BA_HEAT	 		(1<<1) // "b"
#define BA_USER	 		(1<<2) // "c"
#define SEQ_IDLE 		0
#define SEQ_FIDGET 		1
#define SEQ_RELOAD 		2
#define SEQ_FIRE 		3
#define BAZOOKA_MENUKEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)



new g_sModelIndexFireball, g_sModelIndexSmoke, rocketsmoke
new bool:CanShoot[32], Munni[32], mode[32], bool:allow_shooting, user_controll[32], bool:hasBazooka[32]
new mdl_gib_flesh, mdl_gib_head, mdl_gib_legbone, mdl_gib_lung, mdl_gib_meat, mdl_gib_spine, spr_blood_drop, spr_blood_spray
new gHealthIndex[33], bool:cantplantbomb, bool:cantswitch, iFlags, modetext[32]
new hand[33],newhand[33],bazookamenu,seq_animation[32]

public plugin_init() {
	register_plugin("BazookaAdvanced", "1.3c", "Major Victory")
	register_concmd("amx_bazooka", "drop_rpg", ADMIN_LEVEL_A)
	register_concmd("amx_bazooka_give", "cmdBazooka_give", ADMIN_LEVEL_A, "<@all or name/id> <amount>")
	register_concmd("amx_bazooka_startarena", "cmdBazooka_StartArena", ADMIN_LEVEL_A, "<mode restrictions> <restart time, 0 = no restart>")

	register_concmd("amx_bazooka_endarena", "cmdBazooka_EndArena", ADMIN_LEVEL_A, "<set ammo>")
	
	register_cvar("amx_bazooka_dropping", "1")// can a player drop a bazooka
	register_cvar("amx_bazooka_ammo", "1")// how much ammo per bazooka
	register_cvar("amx_bazooka_damageradius", "250") //NOTE: damagradius is not affected by walls
	register_cvar("amx_bazooka_maxdamage", "150")
	register_cvar("amx_bazooka_cost", "2500")// how much one bazooka costs
	register_cvar("amx_bazooka_arena", "0")// requires direct hit to kill
	register_cvar("amx_bazooka_buyable", "1")//disables/enables the buy menu
	register_cvar("amx_bazooka_restrict", "bc") // a = Normal | b = Heat-Seeking | c = User-Guided | d = None
	register_cvar("amx_bazooka_reloadtime", "3.1")// in seconds
	register_cvar("amx_bazooka_trailtime", "30")// roughly 3 seconds
	register_cvar("amx_bazooka_velocity", "700") //I don't know the units for this, just try numbers
	register_cvar("amx_bazooka_teamcolors", "1")// 0 = white, 1 = team colors, 2 = random
	register_cvar("amx_bazooka_gib", "1")// set to 1 for gib deaths (may cause lag on slower computers)
	register_cvar("amx_bazooka_autohands", "1")// 1 = on, 0 = off
	//autohands is experimental, it makes the bazooka appear in the correct hand by setting the client's cl_righthand cvar
	
	
	//test cvars
	register_cvar("amx_bazooka_menu4num", "7") //set ammo amount for menuitem 4
	
	
	register_clcmd("say", "handle_say")
	register_clcmd("say_team", "handle_say")
	
	register_event("DeathMsg", "player_die", "a")
	register_event("CurWeapon", "check_model", "be")
	register_event("TextMsg", "bomb_msg", "b", "2=#C4_Plant_At_Bomb_Spot")
	register_event("ResetHUD","event_respawn","be","1=1")  
	register_logevent("round_end", 2, "1=Round_End")
	register_logevent("round_start", 2, "1=Round_Start")
	register_logevent("bombplant",3,"2=Planted_The_Bomb")
	
	register_clcmd("drop", "handle_drop")
	
	register_forward(FM_PlayerPreThink, "player_bazooka")
	register_forward(FM_SetModel, "forward_setmodel")
	/***************************************/
	//register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1)
	/***************************************/

	bazookamenu = menu_create("Bazooka Menu", "do_bazookamenu")
	menu_additem(bazookamenu, "Buy Bazooka", "1", ADMIN_ALL)
	menu_additem(bazookamenu, "Buy 2 Rockets", "2", ADMIN_ALL)
	menu_additem(bazookamenu, "Buy 3 Rockets", "3", ADMIN_ALL)
	menu_additem(bazookamenu, "Temp", "4", ADMIN_ALL)
	/*Notes on Menu System:
	bazookamenu is the id of our custom menusystem
	by using menu_additem() I've added 3 entries to start with
	
	later in the Showmenu_Bazooka() function below I use the cvar
	amx_bazooka_menu4num to set the ammunition number in slot four,
	format the slot four text, find slot four's id,
	and then change the text in slot four
	hopefully this can be refined to make a dynamic menu system for admins
	*/
}

public plugin_precache() {
	precache_model("models/rpgrocket.mdl")
	precache_model("models/w_rpg.mdl")
	precache_model("models/v_rpg.mdl")
	precache_model("models/p_rpg.mdl")
	precache_sound("weapons/rocketfire1.wav")
	precache_sound("items/gunpickup4.wav")
	precache_sound("weapons/nuke_fly.wav")// <-- this is the only non-game sound file, make sure you have it
	precache_sound("weapons/dryfire1.wav")
	spr_blood_drop = precache_model("sprites/blood.spr")
	spr_blood_spray = precache_model("sprites/bloodspray.spr")
	mdl_gib_flesh = precache_model("models/Fleshgibs.mdl")
	mdl_gib_head = precache_model("models/GIB_Skull.mdl")
	mdl_gib_legbone = precache_model("models/GIB_Legbone.mdl")
	mdl_gib_lung = precache_model("models/GIB_Lung.mdl")
	mdl_gib_meat = precache_model("models/GIB_B_Gib.mdl")
	mdl_gib_spine = precache_model("models/GIB_B_Bone.mdl")
	g_sModelIndexFireball = precache_model("sprites/zerogxplode.spr")
	g_sModelIndexSmoke  = precache_model("sprites/steam1.spr")
	rocketsmoke = precache_model("sprites/smoke.spr")
}
/*****************************
WIP commands Section
******************************/

//Notes:
//I'm trying to improve on the old menu system by allowing to buy ammo
//maybe in the future I could add sell?

//BCost = bazooka price
//ACost = rocket price, which is half of Bcost, or Bcost/2

//Buy Bazooka
// 1. Bazooka (BCost)
// 2. Buy 1 Rocket (ACost)
// 3. Buy 2 Rockets (ACost*2)
// 4. Buy 4 Rockets (ACost*4)

// 5. Sell 1 Rocket (ACost*0.75) -- prevents money gain
// 6. Sell 2 Rockets ((ACost*0.75)*2) -- same here

// 0. Exit

public Showmenu_Bazooka(id) {
	new menu_item4text[51], ammonum, menu_item4id
	ammonum = get_cvar_num("amx_bazooka_menu4num") //get the ammonum for slot 4
	format(menu_item4text, 50,"Buy %i Rockets", ammonum) //format text
	menu_item4id = menu_find_id(bazookamenu, 0, MENU_KEY_4); //find the id for menuitem 4
	menu_item_setname(bazookamenu, menu_item4id, menu_item4text); //set the text
	menu_display(id,bazookamenu,0) //show the new menu
	//btw using menu_additem() here causes the menu to get bigger everytime the menu is called
	
	/*new MenuBody_b[256]
	new len = format(MenuBody_b, 255, "\yBuy Item^n^n")
	len = len + format(MenuBody_b[len], 255 - len, "\w1. Bazooka\R$%d^n", get_cvar_num("amx_bazooka_cost"))
	len = len + format(MenuBody_b[len], 255 - len, "^n\w0. Exit^n")
	register_menuid("Bazooka_Buymenu")
	show_menu(id, BAZOOKA_MENUKEYS, MenuBody_b, -1, "Bazooka Menu")*/
	menu_display(id,bazookamenu,0)
	return PLUGIN_HANDLED
}

public do_bazookamenu(id, Menu, Item) {
	new szCommand[3],  Accesss, Callback, BCost, ACost
	BCost = get_cvar_num("amx_bazooka_cost") // explained in notes section
	ACost = BCost/2
	menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)
	switch(szCommand[0]) {
		case '-': {
			return PLUGIN_HANDLED
		}
		case '1': {
			if (cs_get_user_money(id) >= BCost && !hasBazooka[id]) {
				give_item_bazooka(id,(Munni[id] + get_cvar_num("amx_bazooka_ammo")),1)
				cs_set_user_money(id, cs_get_user_money(id) - BCost)
				client_print(id, print_chat, "[Bazooka] You have successfully bought a bazooka!")
				client_print(id, print_chat, "[Bazooka] What are you going to do now!?")
			}
			if (cs_get_user_money(id) < BCost) {
				client_print(id, print_center, "You need $%i to buy this", BCost)
			}
			if (hasBazooka[id]) {
				client_print(id, print_center, "You already have a bazooka")
			}
		}
		case '2': {
			if (cs_get_user_money(id) >= ACost*2 && hasBazooka[id]) {
				Munni[id] += 2
				cs_set_user_money(id, cs_get_user_money(id) - ACost*2)
				client_print(id, print_chat, "[Bazooka] You now have %i Rockets", Munni[id])
			}
			if (cs_get_user_money(id) < ACost*2) {
				client_print(id, print_center, "You need $%i to buy this", ACost*2)
			}
			if (!hasBazooka[id]) {
				client_print(id, print_center, "You can't buy ammo for a gun you don't have")
			}
		}
		case '3': {
			if (cs_get_user_money(id) >= ACost*4 && hasBazooka[id]) {
				Munni[id] += 4
				cs_set_user_money(id, cs_get_user_money(id) - ACost*4)
				client_print(id, print_chat, "[Bazooka] You now have %i Rockets", Munni[id])
			}
			if (cs_get_user_money(id) < ACost*4) {
				client_print(id, print_center, "You need %i dollars to buy this", ACost*4)
			}
			if (!hasBazooka[id]) {
				client_print(id, print_center, "You can't buy ammo for a gun you don't have")
			}
		}
		case '4': {
			new addnum = get_cvar_num("amx_bazooka_menu4num")
			if (cs_get_user_money(id) >= ACost*addnum && hasBazooka[id]) {
				Munni[id] += addnum
				cs_set_user_money(id, cs_get_user_money(id) - ACost*addnum)
				client_print(id, print_chat, "[Bazooka] You now have %i Rockets", Munni[id])
			}
			if (cs_get_user_money(id) < ACost*addnum) {
				client_print(id, print_center, "You need %i dollars to buy this", ACost*4)
			}
			if (!hasBazooka[id]) {
				client_print(id, print_center, "You can't buy ammo for a gun you don't have")
			}
		}
	}
	return PLUGIN_HANDLED
}

/*****************************
End of WIP Commands Section
******************************/

public bomb_msg(id) {
	if (cs_get_user_plant(id) != 1)
		client_print(id,print_center,"")
}

public bombplant() {	
	cantplantbomb = true //now noone can plant the bomb
}

public round_end() {
	set_task(4.8, "round_prestart")
	set_task(5.0, "player_spawn")
	//set_task(5.2, "bazooka_arena")
	//placing the bazooka_arena task here caused some timing issues
}

public round_prestart() {
	allow_shooting = false
	cantplantbomb = true
	cantswitch = true
}

public round_start() {
	allow_shooting = true
	cantplantbomb = false
	cantswitch = false
	if (get_cvar_num("amx_bazooka_arena") == 1) {
		set_task(0.1, "bazooka_arena")
		//the bazooka_arena task gets more accurately here
	}
}

//this gets rid of the backpack model for bomb carriers, i left it in for reference
/*public forward_setmodel(entity, model[]) {
	if (!is_valid_ent(entity)) {
		return FMRES_IGNORED
	}
	if (equal(model, "models/w_backpack.mdl")) {
		client_print(0, print_center, "")
		new ClassName[32]
		entity_get_string(entity, EV_SZ_classname, ClassName, 31)
		
		if (equal(ClassName, "weaponbox")) {
			
			remove_entity(entity)
			
			return FMRES_SUPERCEDE
		}
	}
	return FMRES_IGNORED
}*/

//this replaces the dropped bomb model with the rpg model
public forward_setmodel(entity , model[]) { 
	if(!is_valid_ent(entity)) { 
		return FMRES_IGNORED; 
	} 
	if(equali(model , "models/w_c4.mdl")) { 
		entity_set_model(entity , "models/w_rpg.mdl"); 
		return FMRES_SUPERCEDE; 
	} 
	return FMRES_IGNORED; 
} 

public client_disconnect(id) {
/* Notes:
i now think that using switch_hands() here is too late to
put the player's cl_righthand cvar back to normal

I think i need to find an event that happens just before the player dc's
*/
	ammo_hud(id, 0)
	if (get_cvar_num("amx_bazooka_autohands") == 1) {
		switch_hands(id,0)
	}
	Munni[id] = 0
	user_controll[id] = 0
	hasBazooka[id] = false
	if ((cs_get_user_plant(id) == 1) || cantswitch) {
		cs_set_user_plant(id,0,0)
		cantswitch  = false
		//if this person had the bomb out and dc'ed then the other players can now access the bomb
	}
}

public client_connect(id) {
	CanShoot[id] = true
	Munni[id] = 0
	mode[id] = 1
	modetext[id] = 1
	hasBazooka[id] = false
	//required information for the switch_hands() function
	//go see the function for notes on its use
	hand[id] = get_cvar_num("cl_righthand")
	if (hand[id]==1) {
			newhand[id] = 0
	}
	else if (hand[id]==0) {
			newhand[id] = 1
	}
}

public player_die(id) {
	new victim
	victim = read_data(2)
	ammo_hud(victim, 0)
	if (get_cvar_num("amx_bazooka_autohands") == 1) {
		switch_hands(victim,0)
		//set their "hands" back to normal
	}
	Munni[victim] = 0
	user_controll[victim] = 0
	hasBazooka[victim] = false
	if ((cs_get_user_plant(victim) == 1) || cantswitch) {
		cs_set_user_plant(victim,0,0)
		cantswitch  = false
		//if they had c4 out and died, reenable c4 for other players
	}
}

public player_spawn() {
	new players[32], count
	get_players(players, count)
	for (new i = 0; i < count; i++) {
		if (is_user_alive(players[i])) {
			new v_oldmodel[64], p_oldmodel[64]
			entity_get_string(players[i], EV_SZ_viewmodel, v_oldmodel, 63)
			entity_get_string(players[i], EV_SZ_weaponmodel, p_oldmodel, 63)
			if (equal(v_oldmodel, "models/v_rpg.mdl") || equal(p_oldmodel, "models/p_rpg.mdl")) {
				if (!hasBazooka[players[i]]) {
					new weaponid, clip, ammo
					weaponid = get_user_weapon(players[i], clip, ammo)
					
					new weaponname[64]
					get_weaponname(weaponid, weaponname, 63)
					
					new v_model[64], p_model[64]
					format(v_model, 63, "%s", weaponname)
					format(p_model, 63, "%s", weaponname)
					
					replace(v_model, 63, "weapon_", "v_")
					format(v_model, 63, "models/%s.mdl", v_model)
					entity_set_string(players[i], EV_SZ_viewmodel, v_model)
					
					replace(p_model, 63, "weapon_", "p_")
					format(p_model, 63, "models/%s.mdl", p_model)
					entity_set_string(players[i], EV_SZ_weaponmodel, p_model)
				}
			}
		}
	}
	
	new TempRocket = find_ent_by_class(-1, "rpgrocket")
	while (TempRocket > 0) {
		remove_entity(TempRocket)
		TempRocket = find_ent_by_class(TempRocket, "rpgrocket")
	}
	
	new TempRPG = find_ent_by_class(-1, "rpg_temp")
	while (TempRPG > 0) {
		remove_entity(TempRPG)
		TempRPG = find_ent_by_class(TempRPG, "rpg_temp")
	}
	return PLUGIN_CONTINUE	
}

public cmdBazooka_StartArena(id,level,cid) {
	/*Notes:
	client_print() functions with "//DEBUG INFO" directly before them
	are just that, debug info, they can be removed or commented when testing is done
	
	also this function could prolly stand to be cleaned up a bit
	a bit meaning alot :P
	*/
	if (!cmd_access(id, level, cid, 3)) {
		return PLUGIN_HANDLED
	}
	//DEBUG INFO
	//client_print(id, print_chat, "[Bazooka] cmdBazooka_StartArena has been called")
	new arg[6],arg2[2],argument2,players[32], count
	read_argv(1,arg,5)
	read_argv(2,arg2,1)
	argument2 = str_to_num(arg2)
	set_cvar_string("amx_bazooka_arena", "1")
	console_cmd(id, "amx_bazooka_arena 1")
	console_cmd(id, "amx_bazooka_restrict %s",arg)
	set_task(0.1, "bazooka_arena")
	get_players(players, count)
	for (new i = 0; i < count; i++) {
		//nice little warning to the players
		console_cmd(players[i],"spk ^"attention.explosion system activated^"")
	}
	if (argument2 > 0) {
		console_cmd(id, "sv_restartround %s",argument2)
	}
	return PLUGIN_HANDLED
}

public cmdBazooka_EndArena(id,level,cid) {
	if (!cmd_access(id, level, cid, 2)) {
		return PLUGIN_HANDLED
	}
	//DEBUG INFO
	//client_print(id, print_chat, "[Bazooka] cmdBazooka_EndArena has been called")
	new arg[5],argument1,players[32], count
	read_argv(1,arg,4)
	argument1 = str_to_num(arg)
	console_cmd(id, "amx_bazooka_arena 0")
	if (argument1 >= 0) {
		get_players(players, count)
		for (new i = 0; i < count; i++) {
			Munni[players[i]] = argument1
			ammo_hud(players[i], 0)
			ammo_hud(players[i], 1)
			//a double notice that Bazooka Arena is OFF
			//it's real easy to miss a text announcement in the heat of battle
			client_print(players[i], print_chat, "[Bazooka] Bazooka Arena has been turned OFF")
			console_cmd(players[i],"spk ^"attention.explosion system deactivated^"")
		}
	}
	return PLUGIN_HANDLED
}

/*Notes:
Around here i was trying to make the rpg animations work
seq_animation[id] sets the animation sequence for a specific id
the animation numbers for the bazooka are listed as constants at
the top and are as follows:
SEQ_IDLE 		0
SEQ_FIDGET 		1
SEQ_RELOAD 		2
SEQ_FIRE 		3

i don't remember how well i got animations to work,
but i remember that at best, you had to be holding the
fire button for the fire animation to work
*/
public rpg_reloaddone(data[]) {
	CanShoot[data[0]] = true
	seq_animation[data[0]] = SEQ_IDLE
}

public rpg_reloadstart(data[]) {
	seq_animation[data[0]] = SEQ_RELOAD
}

public fire_rocket(id) {
	ammo_hud(id, 0)
	ammo_hud(id, 1)
	//those two functions above effectively refresh the custom hud info for the bazooka
	CanShoot[id] = false
	seq_animation[id] = SEQ_FIRE
	new data[1]
	data[0] = id
	new rtime = get_cvar_num("amx_bazooka_reloadtime")
	//Note: since rtime must be a float i made the cvar a whole number for convienence
	//but then i added 0.0 to make it a float for later
	if (cs_get_user_plant(id) != 1){ //if they DON'T have the bomb out
		set_task((rtime+0.0), "rpg_reloaddone", id+9477, data, 1) //when can i shoot again?
		//set_task(0.0, "rpg_reloadstart", id+9478, data, 1) //start reload animation
		if ((Munni[id] <= 0) && (get_cvar_num("amx_bazooka_arena") != 1)) {
			//no ammo, do empty click
			emit_sound(id, CHAN_WEAPON, "weapons/dryfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
			return PLUGIN_HANDLED
		}
		else {
			//ammo, start up the math
			//don't touch most of this unless you know your vectors and ents
			new Float:StartOrigin[3], Float:Angle[3]
			
			new PlayerOrigin[3]
			get_user_origin(id, PlayerOrigin, 1)
			
			StartOrigin[0] = float(PlayerOrigin[0])
			StartOrigin[1] = float(PlayerOrigin[1])
			StartOrigin[2] = float(PlayerOrigin[2])
			
			entity_get_vector(id, EV_VEC_v_angle, Angle)
			Angle[0] = Angle[0] * -1.0
			new RocketEnt = create_entity("info_target")
			entity_set_string(RocketEnt, EV_SZ_classname, "rpgrocket")
			entity_set_model(RocketEnt, "models/rpgrocket.mdl")
			entity_set_origin(RocketEnt, StartOrigin)
			entity_set_vector(RocketEnt, EV_VEC_angles, Angle)
			
			new Float:MinBox[3] = {-1.0, -1.0, -1.0}
			new Float:MaxBox[3] = {1.0, 1.0, 1.0}
			entity_set_vector(RocketEnt, EV_VEC_mins, MinBox)
			entity_set_vector(RocketEnt, EV_VEC_maxs, MaxBox)
			
			entity_set_int(RocketEnt, EV_INT_solid, 2)
			entity_set_int(RocketEnt, EV_INT_movetype, 5)
			entity_set_edict(RocketEnt, EV_ENT_owner, id)
			
			new Float:Velocity[3]
			new myvelocity = get_cvar_num("amx_bazooka_velocity") //custom velocity
			VelocityByAim(id, myvelocity, Velocity)
			entity_set_vector(RocketEnt, EV_VEC_velocity, Velocity)
			
			emit_sound(RocketEnt, CHAN_WEAPON, "weapons/rocketfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
			emit_sound(RocketEnt, CHAN_VOICE, "weapons/nuke_fly.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
			
			if (get_cvar_num("amx_bazooka_arena") != 1) {
				//if bazooka_arena is off then subtract from ammo
				//and refresh the custom hud
				ammo_hud(id, 0)
				Munni[id]--
				ammo_hud(id, 1)
			}
			//here we do the trail colors
			new CsTeams:iTeam =cs_get_user_team(id)
			new trailtime =get_cvar_num("amx_bazooka_trailtime")
			new colorr =random_num(0,255)
			new colorg =random_num(0,255)
			new colorb =random_num(0,255)
			new colora =100+random_num(0,155)
			//i've never seen a black smoke trail in CS, are they possible?...
			if (get_cvar_num("amx_bazooka_teamcolors") == 0){ // white
				message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
				write_byte(22)
				write_short(RocketEnt)
				write_short(rocketsmoke)
				write_byte(trailtime)
				write_byte(3)
				write_byte(255)
				write_byte(255)
				write_byte(255)
				write_byte(255)
				message_end()
			}
			else if (get_cvar_num("amx_bazooka_teamcolors") == 1) {
				switch(iTeam) {
					case CS_TEAM_T: { //if team T color=red
						message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
						write_byte(22)
						write_short(RocketEnt)
						write_short(rocketsmoke)
						write_byte(trailtime)
						write_byte(3)
						write_byte(255)
						write_byte(0)
						write_byte(0)
						write_byte(255)
						message_end() 
					}
					case CS_TEAM_CT: { // if team CT color=blue
						message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
						write_byte(22)
						write_short(RocketEnt)
						write_short(rocketsmoke)
						write_byte(trailtime)
						write_byte(3)
						write_byte(0)
						write_byte(0)
						write_byte(255)
						write_byte(255)
						message_end()
					}
				}
			}
			else  if (get_cvar_num("amx_bazooka_teamcolors") == 2){ // random colors anyone?
				message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
				write_byte(22)
				write_short(RocketEnt)
				write_short(rocketsmoke)
				write_byte(trailtime)
				write_byte(3)
				write_byte(colorr)
				write_byte(colorg)
				write_byte(colorb)
				write_byte(colora)
				message_end()
			}
			
			if (mode[id] == 2) {
				//mmmmm heat-seeking
				new info[1]
				info[0] = RocketEnt
				set_task(1.0, "find_and_follow", 0, info, 1)
			}
			else if (mode[id] == 3) {
				//user-guided
				entity_set_int(RocketEnt, EV_INT_rendermode, 1)
				attach_view(id, RocketEnt)
				user_controll[id] = RocketEnt
			} 
			return PLUGIN_HANDLED
		}
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public find_and_follow(info[]) {
	new RocketEnt = info[0]
	new Float:shortestDist = 10000.0
	new nearestPlayer = 0
	
	if (is_valid_ent(RocketEnt)) {
		new players[32], count
		get_players(players, count)
		for (new i = 0; i < count; i++) {
			if (is_user_alive(players[i]) && (entity_get_edict(RocketEnt, EV_ENT_owner) != players[i]) && (get_user_team(players[i]) != get_user_team(entity_get_edict(RocketEnt, EV_ENT_owner)))) {
				new Float:PlayerOrigin[3], Float:RocketOrigin[3]
				entity_get_vector(players[i], EV_VEC_origin, PlayerOrigin)
				entity_get_vector(RocketEnt, EV_VEC_origin, RocketOrigin)
				
				new Float:distance = vector_distance(PlayerOrigin, RocketOrigin)
				
				if (distance <= shortestDist) {
					shortestDist = distance
					nearestPlayer = players[i]
				}
			}
		}
	}
	
	if (nearestPlayer > 0) {
		new data[2]
		data[0] = RocketEnt
		data[1] = nearestPlayer
		set_task(0.1, "follow_and_catch", RocketEnt, data, 2, "b")
	}
	else {
		pfn_touch(RocketEnt, 0)
	}
}

public follow_and_catch(data[]) {
	new RocketEnt = data[0]
	new target = data[1]
	new myvelocity = get_cvar_num("amx_bazooka_velocity")
	
	if (is_user_alive(target) && is_valid_ent(RocketEnt)) {
		entity_set_follow(RocketEnt, target, (myvelocity+0.0))
		
		new Float:Velocity[3]
		new Float:NewAngle[3]
		entity_get_vector(RocketEnt, EV_VEC_velocity, Velocity)
		vector_to_angle(Velocity, NewAngle)
		entity_set_vector(RocketEnt, EV_VEC_angles, NewAngle)
	}
	else {
		remove_task(RocketEnt)
		new info[1]
		info[0] = RocketEnt
		set_task(0.1, "find_and_follow", 0, data, 1)
	}
}

public pfn_touch(ptr, ptd) {
	new ClassName[32]
	new ClassNameptd[32]
	//here i grab the classname of each item for debugging and advanced collisions later
	if ((ptr > 0) && is_valid_ent(ptr)) {
		entity_get_string(ptr, EV_SZ_classname, ClassName, 31)
	}
	if ((ptd > 0) && is_valid_ent(ptd)) {
		entity_get_string(ptd, EV_SZ_classname, ClassNameptd, 31)
	}
	if (equal(ClassName, "rpgrocket")) {
		remove_task(ptr)
		new Float:EndOrigin[3]//x,y,z
		entity_get_vector(ptr, EV_VEC_origin, EndOrigin)
		
		message_begin( MSG_BROADCAST, SVC_TEMPENTITY)  // Explosion
		write_byte(TE_EXPLOSION)
		write_coord(floatround(EndOrigin[0]))
		write_coord(floatround(EndOrigin[1]))
		write_coord(floatround(EndOrigin[2])+5)
		write_short(g_sModelIndexFireball)
		write_byte(random_num(0,20) + 20)
		write_byte(12) // framerate
		write_byte(TE_EXPLFLAG_NONE)
		message_end()
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)  // Smoke
		write_byte(TE_SMOKE)
		write_coord(floatround(EndOrigin[0]))
		write_coord(floatround(EndOrigin[1]))
		write_coord(floatround(EndOrigin[2])+15)
		write_short(g_sModelIndexSmoke)
		write_byte(60)
		write_byte(10)
		message_end()
		
		/*message_begin(MSG_BROADCAST,SVC_TEMPENTITY) // Explosion Decal
		write_byte(28) //grenade explotion mark
		write_coord(floatround(EndOrigin[0]))
		write_coord(floatround(EndOrigin[1]))
		write_coord(floatround(EndOrigin[2]))
		write_short(spr_blood_spray)
		write_short(spr_blood_drop)
		write_byte(229) // color index
		write_byte(15) // size
		message_end()*/
		
		new maxdamage = get_cvar_num("amx_bazooka_maxdamage")
		new damageradius = get_cvar_num("amx_bazooka_damageradius")
		if (equal(ClassNameptd, "func_breakable")) {
			//new Float:ptrhealth = entity_get_float(ptr,EV_FL_health);
			//new Float:ptdhealth = entity_get_float(ptd,EV_FL_health);
			//DEBUG INFO
			//client_print(0, print_console, "Entity ptr health is: %i",ptrhealth)
			//client_print(0, print_console, "Entity ptd health is: %i",ptdhealth)
			
			//entity_set_float(ptr,EV_FL_health,100.0); //i don't remember why this is here
			//the functions below break ANY breakables and kill the rocket
			//and when i say ANY breakables i mean ANY breakables
			//it will destroy even trigger only breakables, bad for mapmakers
			force_use(ptr,ptd)
			remove_task(ptr)
		}
		/*Notes: Here i tried to make it so that if a breakable entity was within the damage
		radius it would recieve it's share of damage
		this is very experimental as I couldn't get it to work after two or three days of tinkering
		*/
		/*if (equal(ClassNameptd, "func_breakable")) {
			client_print(0, print_console, "got classname %s",ClassNameptd)
			new Float:orig1[3], origin1[3],NonFloatEndOrigin[3]
			entity_get_vector(ptd, EV_VEC_origin, orig1)
			for(new a = 0; a < 3; a++) {
				origin1[a] = floatround(orig1[a])
			}
			for(new a = 0; a < 3; a++) {
				NonFloatEndOrigin[a] = floatround(EndOrigin[a])
			}
			new ptddistance = get_distance(origin1, NonFloatEndOrigin)
			client_print(0, print_console, "got distance %i",ptddistance)
			if (ptddistance <= damageradius) {
				client_print(0, print_console, "is in damage radius")
				new damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(ptddistance), float(damageradius))))
				if (damage > 25) {
					client_print(0, print_console, "damage > 25")
					force_use(ptr,ptd)
					remove_task(ptr)
				}
					else {
					client_print(0, print_console, "damage < 25")
					remove_task(ptr)
				}
			}
			return PLUGIN_CONTINUE
		}*/
		
		new PlayerPos[3], distance, damage
		for (new i = 1; i < 32; i++) {
			if (is_user_alive(i) == 1) {
				get_user_origin(i, PlayerPos)
				
				new NonFloatEndOrigin[3]
				for(new a = 0; a < 3; a++) {
						NonFloatEndOrigin[a] = floatround(EndOrigin[a])
				}
				distance = get_distance(PlayerPos, NonFloatEndOrigin)
				if (distance <= damageradius) {  // Screenshake Radius
					message_begin(MSG_ONE, get_user_msgid("ScreenShake"), {0,0,0}, i)  // Shake Screen
					write_short(1<<14)
					write_short(1<<14)
					write_short(1<<14)
					message_end()
					
					damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius))))
					new attacker = entity_get_edict(ptr, EV_ENT_owner)
					
					if (!get_user_godmode(i)) {
						
						if (get_user_team(attacker) != get_user_team(i)) {
							
							if (damage < get_user_health(i)) {
								set_user_health(i, get_user_health(i) - damage)
							}
							else {
								set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
								user_kill(i, 1)
								set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
								
								message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))  // Kill-Log oben rechts
								write_byte(attacker)  // Attacker
								write_byte(i)  // Victim
								write_byte(0)  // Headshot
								write_string("bazooka")
								message_end()
								if (damage > 100 && get_cvar_num("amx_bazooka_gib") == 1) { //begin gibs and effects (made by mike_cao)
									new iOrigin[3]
									get_user_origin(i,iOrigin) // Effects
									fx_trans(i,0)
									fx_gib_explode(iOrigin,3)
									fx_blood_large(iOrigin,5)
									fx_blood_small(iOrigin,15)
									iOrigin[2] = iOrigin[2]-20 // Hide body
									set_user_origin(i,iOrigin)
								} //end gibs and effects
								set_user_frags(attacker, get_user_frags(attacker) + 1)
								if (get_cvar_num("amx_bazooka_gib") == 1) {
									client_print(attacker, print_center, "LOLERS! You just splattered that guy's guts everywhere!")
								}
								
							}
						}
						if (get_user_team(attacker) == get_user_team(i)) {
							
							if (attacker == i) {
								
								if (damage < get_user_health(i)) {
									set_user_health(i, get_user_health(i) - damage)
								}
								else {
									set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
									user_kill(i, 1)
									set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
									
									message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts
									write_byte(attacker)  // Attacker
									write_byte(i)  // Victim
									write_byte(0)  // Headshot
									write_string("bazooka")
									message_end()
									if ((damage > 100) && get_cvar_num("amx_bazooka_gib") == 1) { //begin gibs and effects (made by mike_cao)
										new iOrigin[3]
										get_user_origin(i,iOrigin)// Effects
										fx_trans(i,0)
										fx_gib_explode(iOrigin,3)
										fx_blood_large(iOrigin,5)
										fx_blood_small(iOrigin,15)
										iOrigin[2] = iOrigin[2]-20 // Hide body
										set_user_origin(i,iOrigin)
									} //end gibs and effects
									set_user_frags(attacker, get_user_frags(attacker) - 1)
									if (get_cvar_num("amx_bazooka_gib") == 1){
										client_print(attacker, print_center, "Great! Now everyone knows what you had for supper!")
									}
									else {
										client_print(attacker, print_center, "You do know this thing explodes right?")
									}
									
								}
							}
							else {
								if (get_cvar_num("mp_friendlyfire")) {
									if (damage < get_user_health(i)) {
										set_user_health(i, get_user_health(i) - damage)
										client_print(attacker, print_center, "You injured a teammate! Watch your aim!")
									}
									else {
										set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
										user_kill(i, 1)
										set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)
										
										message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))  // Kill-Log oben rechts
										write_byte(attacker)  // Attacker										write_byte(i)  // Victim
										write_byte(0)  // Headshot
										write_string("bazooka")
										message_end()
										if (damage > 100 && get_cvar_num("amx_bazooka_gib") == 1) { //begin gibs and effects (made by mike_cao)
											new iOrigin[3]
											get_user_origin(i,iOrigin)// Effects
											fx_trans(i,0)
											fx_gib_explode(iOrigin,3)
											fx_blood_large(iOrigin,5)
											fx_blood_small(iOrigin,15)
											iOrigin[2] = iOrigin[2]-20 // Hide body
											set_user_origin(i,iOrigin)
										} //end gibs and effects
										set_user_frags(attacker, get_user_frags(attacker) - 1)
										if (get_cvar_num("amx_bazooka_gib") == 1){
											client_print(attacker, print_center, "OMFG's!! You just splattered a teammate!")
										}
										else{
											client_print(attacker, print_center, "LOL! That teammate is probably not too happy now!")
										}
									}
								}
							}
						}
					}
				}
			}
		}
		attach_view(entity_get_edict(ptr, EV_ENT_owner), entity_get_edict(ptr, EV_ENT_owner))
		user_controll[entity_get_edict(ptr, EV_ENT_owner)] = 0
		remove_entity(ptr)
	}
	
	
	if (equal(ClassName, "rpg") || equal(ClassName, "rpg_temp")) {
		new Picker[32]
		if ((ptd > 0) && is_valid_ent(ptd)) {
			entity_get_string(ptd, EV_SZ_classname, Picker, 31)
		} 
		if (equal(Picker, "player")) {
			give_item_bazooka(ptd,(Munni[ptd] + entity_get_int(ptr, EV_INT_iuser1)),1)
			client_print(ptd, print_chat, "[Bazooka] You have picked up a bazooka!")
			remove_entity(ptr)
		}
	}
	return PLUGIN_CONTINUE
}

public drop_rpg(id, level, cid) {
	if (!cmd_access(id, level, cid, 1)) {
		return PLUGIN_HANDLED
	}	
	new Float:PlayerOrigin[3], Float:End[3], Float:Return[3], Float:TraceDirection[3]
	entity_get_vector(id, EV_VEC_origin, PlayerOrigin)
	VelocityByAim(id, 64, TraceDirection)
	
	End[0] = TraceDirection[0] + PlayerOrigin[0]
	End[1] = TraceDirection[1] + PlayerOrigin[1]
	End[2] = TraceDirection[2] + PlayerOrigin[2]
	
	trace_line(id, PlayerOrigin, End, Return)
	Return[2] = PlayerOrigin[2]
	
	new RPG = create_entity("info_target")
	entity_set_string(RPG, EV_SZ_classname, "rpg")
	entity_set_model(RPG, "models/w_rpg.mdl")
	entity_set_origin(RPG, Return)
	
	new Float:MinBox[3] = {-16.0, -16.0, 0.0}
	new Float:MaxBox[3] = {16.0, 16.0, 16.0}
	entity_set_vector(RPG, EV_VEC_mins, MinBox)
	entity_set_vector(RPG, EV_VEC_maxs, MaxBox)
	
	entity_set_int(RPG, EV_INT_solid, 1)
	entity_set_int(RPG, EV_INT_movetype, 6)
	
	entity_set_int(RPG, EV_INT_iuser1, get_cvar_num("amx_bazooka_ammo"))
	
	return PLUGIN_HANDLED
}
/*Notes:
DON'T SCREW WITH THE MODES. PERIOD!

It took me hours to figure out the logic for each action and make it work.
the modes as they are allow only one player at a time to access the c4
and will also force a player to move to the next mode if the one they are on is restricted
which can happen if the admin changes restrictions during gameplay
*/

public player_bazooka(id) {
	if (is_user_alive(id)) {
		new weaponid, clip, ammo
		weaponid = get_user_weapon(id, clip, ammo)
		if ((weaponid == CSW_C4) && hasBazooka[id]) {
			set_animation(id,seq_animation[id])
			new attack = get_user_button(id) & IN_ATTACK
			new oldattack = get_user_oldbutton(id) & IN_ATTACK
			new attack2 = get_user_button(id) & IN_ATTACK2
			new oldattack2 = get_user_oldbutton(id) & IN_ATTACK2
			new CsTeams:iTeam = cs_get_user_team(id)
			if (attack && !oldattack  && (cs_get_user_plant(id) != 1)) {
				get_restrict_flags()
				if (mode[id] == 1 && iFlags&BA_NORMAL) {
					client_print(id, print_center, "You cannot fire a restricted mode")
					client_cmd(id,"+attack2;wait;-attack2")
				}
				else if (mode[id] == 2 && iFlags&BA_HEAT) {
					client_print(id, print_center, "You cannot fire a restricted mode")
					client_cmd(id,"+attack2;wait;-attack2")
				}
				else if (mode[id] == 3 && iFlags&BA_USER) {
					client_print(id, print_center, "You cannot fire a restricted mode")
					client_cmd(id,"+attack2;wait;-attack2")
				}
				else if (mode[id] == 4 && iTeam&CS_TEAM_CT) {
					client_print(id, print_center, "You cannot plant a bomb!")
					client_cmd(id,"+attack2;wait;-attack2")
				}
				else {
					if (CanShoot[id] && allow_shooting && (user_controll[id] == 0)) {
						fire_rocket(id)
						
					}
				}
				
			}
			else if (attack2 && !oldattack2) {
				check_model(id)
				switch(mode[id]) {
					case 1: {
						get_restrict_flags()
						if ((iFlags&BA_HEAT) != BA_HEAT) {
							mode[id] = 2
							modetext[id] = 2
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							emit_sound(id, CHAN_WEAPON, "items/nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "Heat-Seeking Mode")
						}
						else if ((iFlags&BA_USER) != BA_USER) {
							mode[id] = 3
							modetext[id] = 3							
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							emit_sound(id, CHAN_WEAPON, "items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "User-Guided Mode")
						}
						else {
							if (!cantplantbomb && !cantswitch && iTeam&CS_TEAM_T) {
								cantswitch = true
								mode[id] = 4
								modetext[id] = 4							
								ammo_hud(id, 0)
								ammo_hud(id, 1)
								cs_set_user_plant(id,1,1)
								check_model(id)
								emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
								client_print(id, print_center, "Switching to C4 Bomb")
							}
							else if (cantplantbomb || cantswitch || iTeam&CS_TEAM_CT){
								mode[id] = 1
								modetext[id] = 1
								ammo_hud(id, 0)
								ammo_hud(id, 1)
								check_model(id)
								emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
								client_print(id, print_center, "The other modes are restricted")
							}
						}
					}
					case 2: {
						get_restrict_flags()
						if ((iFlags&BA_USER) != BA_USER) {
							mode[id] = 3
							modetext[id] = 3
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							emit_sound(id, CHAN_WEAPON, "items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "User-Guided Mode")
						}
						else if (iFlags&BA_USER && ((iFlags&BA_NORMAL) != BA_NORMAL)) {
							if (!cantplantbomb && !cantswitch && iTeam&CS_TEAM_T) {
								cantswitch = true
								mode[id] = 4
								modetext[id] = 4
								ammo_hud(id, 0)
								ammo_hud(id, 1)
								cs_set_user_plant(id,1,1)
								check_model(id)
								emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
								client_print(id, print_center, "Switching to C4 Bomb")
							}
							else if (cantplantbomb || cantswitch || iTeam&CS_TEAM_CT){
								mode[id] = 1
								modetext[id] = 1
								ammo_hud(id, 0)
								ammo_hud(id, 1)
								check_model(id)
								emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
								client_print(id, print_center, "Normal Mode")
							}
						}
						else {
							mode[id] = 2
							modetext[id] = 2
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "The other modes are restricted")
						}
					}
					case 3: {
						get_restrict_flags()
						if ((iFlags&BA_NORMAL) != BA_NORMAL) {
							if (!cantplantbomb && !cantswitch && iTeam&CS_TEAM_T) {
								cantswitch = true
								mode[id] = 4
								modetext[id] = 4
								ammo_hud(id, 0)
								ammo_hud(id, 1)
								cs_set_user_plant(id,1,1)
								check_model(id)
								emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
								client_print(id, print_center, "Switching to C4 Bomb")
							}
							else if (cantplantbomb || cantswitch || iTeam&CS_TEAM_CT){
								mode[id] = 1
								modetext[id] = 1
								ammo_hud(id, 0)
								ammo_hud(id, 1)
								check_model(id)
								emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
								client_print(id, print_center, "Normal Mode")
							}
						}
						else if ((iFlags&BA_HEAT) != BA_HEAT){
							mode[id] = 2
							modetext[id] = 2
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							emit_sound(id, CHAN_WEAPON, "items/nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "Heat-Seeking Mode")
						}
						else {
							mode[id] = 3
							modetext[id] = 3
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "The other modes are restricted")
						}
					}
					case 4: {
						get_restrict_flags()
						if ((iFlags&BA_NORMAL) != BA_NORMAL) {
							cantswitch = false
							mode[id] = 1
							modetext[id] = 1
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							cs_set_user_plant(id,0,0)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "Switching to Bazooka")	
						}
						else if ((iFlags&BA_HEAT) != BA_HEAT) {
							cantswitch = false
							mode[id] = 2
							modetext[id] = 2
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							cs_set_user_plant(id,0,0)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							emit_sound(id, CHAN_WEAPON, "items/nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "Heat-Seeking Mode")
						}
						else if ((iFlags&BA_USER) != BA_USER) {
							cantswitch = false
							mode[id] = 3
							modetext[id] = 3
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							cs_set_user_plant(id,0,0)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							emit_sound(id, CHAN_WEAPON, "items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "User-Guided Mode")
						}
						else {
							cantswitch = true
							mode[id] = 4
							modetext[id] = 4
							ammo_hud(id, 0)
							ammo_hud(id, 1)
							cs_set_user_plant(id,1,1)
							check_model(id)
							emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
							client_print(id, print_center, "The other modes are restricted")
						}
					}
				}
			}
		}	
	}	
	if (user_controll[id] > 0) {
		new RocketEnt = user_controll[id]
		if (is_valid_ent(RocketEnt)) {
			new Float:Velocity[3]
			VelocityByAim(id, 500, Velocity)
			entity_set_vector(RocketEnt, EV_VEC_velocity, Velocity)
			new Float:NewAngle[3]
			entity_get_vector(id, EV_VEC_v_angle, NewAngle)
			entity_set_vector(RocketEnt, EV_VEC_angles, NewAngle)
		}
		else {
			attach_view(id, id)
		}
	}
	return FMRES_IGNORED
}
/*Notes
in version 1.3c this function spawned both an rpg and a bomb upon dropping the bazooka,
in version 1.3d i cleaned it up and hopefully fixed this error
...i think i only cleaned it up, will test later...
*/
public handle_drop(id) {
	new weaponid, clip, ammo
	weaponid = get_user_weapon(id, clip, ammo)
	if (weaponid == CSW_C4 && cs_set_user_plant(id,0,0)) {
		if (get_cvar_num("amx_bazooka_dropping") == 1) {
			drop_rpg_temp(id)
			if (get_cvar_num("amx_bazooka_autohands") == 1) {
				switch_hands(id,0)
			}
		}
		else {
			client_print(id, print_center, "This weapon cannot be dropped")
			return PLUGIN_HANDLED
		}
	}
	return PLUGIN_CONTINUE
}

public drop_rpg_temp(id) {
	
	new Float:PlayerOrigin[3], Float:End[3], Float:Return[3], Float:TraceDirection[3], Float:Angles[3]
	entity_get_vector(id, EV_VEC_origin, PlayerOrigin)
	entity_get_vector(id, EV_VEC_angles, Angles)
	VelocityByAim(id, 200, TraceDirection)
	
	End[0] = TraceDirection[0] + PlayerOrigin[0]
	End[1] = TraceDirection[1] + PlayerOrigin[1]
	End[2] = TraceDirection[2] + PlayerOrigin[2]
	
	trace_line(id, PlayerOrigin, End, Return)
	Return[2] = PlayerOrigin[2]
	
	new RPG = create_entity("info_target")
	entity_set_string(RPG, EV_SZ_classname, "rpg_temp")
	entity_set_model(RPG, "models/w_rpg.mdl")
	entity_set_origin(RPG, Return)
	
	Angles[0] = 0.0
	Angles[2] = 0.0
	
	entity_set_vector(RPG, EV_VEC_angles, Angles)
	
	new Float:MinBox[3] = {-16.0, -16.0, 0.0}
	new Float:MaxBox[3] = {16.0, 16.0, 16.0}
	entity_set_vector(RPG, EV_VEC_mins, MinBox)
	entity_set_vector(RPG, EV_VEC_maxs, MaxBox)
	
	entity_set_int(RPG, EV_INT_solid, 1)
	entity_set_int(RPG, EV_INT_movetype, 6)
	
	entity_set_int(RPG, EV_INT_iuser1, Munni[id])
	
	Munni[id] = 0
	hasBazooka[id] = false
	
	return PLUGIN_HANDLED
}

public handle_say(id) {
	new command[32]
	read_argv(1, command, 31)
	
	if (equal(command, "buybazooka")) {
		if (is_user_alive(id)) {
			if (get_cvar_num("amx_bazooka_buyable") == 1) {
				Showmenu_Bazooka(id)
			}
			else {
				client_print(id, print_chat, "[Bazooka] The buymenu is disabled!")
			}
		}
		else {
			client_print(id, print_chat, "[Bazooka] You cannot buy a Bazooka while you are dead!")
		}
	}
	if (equal(command, "bazookahelp"))
		{
		// Display Help File from amxx/configs/bazooka_help.htm
		new szHelpFile[64], szCustomDir[32]
		//i think get_customdir() has been depreciated, not sure though...
		get_customdir( szCustomDir, 31 )
		format( szHelpFile, 63, "%s/bazooka_help.htm", szCustomDir )
		show_motd( id, szHelpFile, "Bazooka - Help" )
		return PLUGIN_CONTINUE
	}
	
	return PLUGIN_HANDLED
}

public cmdBazooka_give(id, level, cid) {
	if (!cmd_access(id, level, cid, 3)) {
		return PLUGIN_HANDLED
	}
	
	new arg[32], arg2[8], name2[32], ammo,argument2
	ammo=get_cvar_num("amx_bazooka_ammo")
	read_argv(1,arg,31)
	read_argv(2,arg2,7)
	argument2 = str_to_num(arg2)
	if ( equali(arg,"@all") )
		{
		new plist[32],pnum
		get_players(plist,pnum,"a")
		if (pnum==0)
			{
			console_print(id,"[Bazooka] This client is invalid")
			return PLUGIN_HANDLED
		}
		for (new i=0; i<pnum; i++)
			{
			give_item_bazooka(plist[i],(argument2*ammo),1)
			client_print(plist[i], print_chat, "[Bazooka] The Admin gave you a bazooka with %d rockets!",argument2*ammo)
			client_print(plist[i], print_chat, "[Bazooka] Switch to the bomb weapon or weapon slot 5 to use it")
			console_print(id,"[Bazooka] Gave all players bazookas with %d rockets",argument2*ammo)
		}
	}
	else
	{
		get_user_name(id,name2,31)
		new player = cmd_target(id,arg,7)
		if (!player)
			{
			console_print(id,"[Bazooka] Give Bazooka Failed") 
			return PLUGIN_HANDLED
		}
		new name[32]
		get_user_name(player,name,31)
		give_item_bazooka(player,(argument2*ammo),1)
		console_print(id,"[Bazooka] Gave %s %d Bazookas",name,argument2*ammo)
		client_print(player, print_chat, "[Bazooka] The Admin gave you a bazooka with %d rockets!",argument2*ammo)
		client_print(player, print_chat, "[Bazooka] Switch to the bomb weapon or weapon slot 5 to use it.")
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public bazooka_arena(id) {
	if (get_cvar_num("amx_bazooka_arena") == 1) {
		//DEBUG INFO
		//client_print(id, print_chat, "[Bazooka] bazooka_arena has been called")
		//console_cmd(id ,"amx_bazooka_give @all 1")
		console_cmd(id ,"amx_bazooka_damageradius 40")
		console_cmd(id ,"amx_bazooka_maxdamage 999999")
		new players[32], count
		get_players(players, count)
		for (new i = 0; i < count; i++) {
			give_item_bazooka(players[i],1,1)
			client_print(players[i], print_chat, "[Bazooka] Bazooka Arena is ON! say ^"bazookahelp^" for more info")
			client_print(players[i], print_center, "Time to make things go BOOM!")
		}
	}
	
	return PLUGIN_HANDLED
}
//this function is more internal than external, it makes giving a bazooka happen in one line instead of 15
public give_item_bazooka(id,ammo,sound) {
	give_item(id, "weapon_c4") // give actual weapon
	hasBazooka[id] = true // the plugin now knows they have a bazooka
	Munni[id] = ammo //set ammunition
	CanShoot[id] = true // they can shoot now
	cs_set_user_plant(id,0,0) //they can't plant unless they switch to bomb
	mode[id] = 1 //mode = normal
	modetext[id] = 1
	check_model(id) // refresh model
	ammo_hud(id, 0)
	ammo_hud(id, 1) // refresh hud info
	if (sound) {
		//audio notification
		emit_sound(id, CHAN_ITEM, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
	}
}

/*Notes:
This function is highly experimental too
It should allow the use of seq_animation[id] in place of the "anim" parameter
to set the current animation of a specific player.

The trick is getting the animation to cycle through the frames
and not stay on the first one in each animation
*/
set_animation(id, anim) {
    set_pev(id, pev_weaponanim, anim)
    message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, id)
    write_byte(anim)
    write_byte(pev(id, pev_body))
    message_end()
}

/*Notes:
This little functions switches the client's cl_righthand cvar
to make the bazooka appear in the correct hand

So far i've implemented it very well except for when a player disconnects
*/
switch_hands(id,mode) {
	if (mode) {
		client_cmd(id,"cl_righthand %i",newhand[id])
	}
	else {
		client_cmd(id,"cl_righthand %i",hand[id])
	}
}

//Yay custom hud!
ammo_hud(id, show) {
	new AmmoHud[65],mode[20]
	if (modetext[id] == 1) {
		mode = "Bazooka"
	}
	else if (modetext[id] == 2) {
		mode = "Heat-Seeking"
	}
	else if (modetext[id] == 3) {
		mode = "User-Guided"
	}
	else if (modetext[id] == 4) {
		mode = "C4"
	}
	if (get_cvar_num("amx_bazooka_arena") == 1) {
		format(AmmoHud, 64, "Rockets: Infinite | Mode: %s",mode)
	}
	else {
		format(AmmoHud, 64, "Rockets: %i | Mode: %s", Munni[id],mode)
	}
	
	if (show) {
		message_begin(MSG_ONE, get_user_msgid("StatusText"), {0,0,0}, id)
		write_byte(0)
		write_string(AmmoHud)
		message_end()
	}
	else {
		message_begin(MSG_ONE, get_user_msgid("StatusText"), {0,0,0}, id)
		write_byte(0)
		write_string("")
		message_end()
	}
}

/*Notes:
I've seen this work on my computer 100% of the time,
but i've not been able to test it online or with multiple players

what this funtion does is check to see if the player has the bazooka weapon out
and then it changes the model accordingly, but if that weapon is not out then it
changes back to what it should be

This is also where switch_hands() is used a lot
*/
public check_model(id) {
	new weaponid, clip, ammo
	new CsTeams:iTeam = cs_get_user_team(id)
	weaponid = get_user_weapon(id, clip, ammo)
	if ((weaponid == CSW_C4) && ((cs_get_user_plant(id) != 1) || (mode[id] != 4))) {
		if (get_cvar_num("amx_bazooka_autohands") == 1) {
			switch_hands(id,1)
		}
		ammo_hud(id, 0)
		ammo_hud(id, 1)
		cs_set_user_plant(id,0,0)
		entity_set_string(id, EV_SZ_viewmodel, "models/v_rpg.mdl")
		entity_set_string(id, EV_SZ_weaponmodel, "models/p_rpg.mdl")
	}
	else if ((weaponid == CSW_C4) && ((cs_get_user_plant(id) == 1) || (mode[id] == 4))) {
		if (get_cvar_num("amx_bazooka_autohands") == 1) {
			switch_hands(id,0)
		}
		ammo_hud(id, 0)
		ammo_hud(id, 1)
		if (iTeam&CS_TEAM_CT) {
			cs_set_user_plant(id,0,0)
			mode[id] = 1
			modetext[id] = 1
			entity_set_string(id, EV_SZ_viewmodel, "models/v_rpg.mdl")
			entity_set_string(id, EV_SZ_weaponmodel, "models/p_rpg.mdl")
		}
		else if (iTeam&CS_TEAM_T) {
			cs_set_user_plant(id,1,1)
			entity_set_string(id, EV_SZ_viewmodel, "models/v_c4.mdl")
			entity_set_string(id, EV_SZ_weaponmodel, "models/p_c4.mdl")
		}
	}
	else if (weaponid != CSW_C4) {
		if (get_cvar_num("amx_bazooka_autohands") == 1) {
			switch_hands(id,0)
		}
		cs_set_user_plant(id,0,0)
		mode[id] = 1
		modetext[id] = 1
		ammo_hud(id, 0)
	}
	return PLUGIN_HANDLED
}
//this little guy reads the flags given in the amx_bazooka_restrict cvar
get_restrict_flags() {
	new sFlags[24]
	get_cvar_string("amx_bazooka_restrict",sFlags,24)
	iFlags = read_flags(sFlags)
}


//ok, everything past here is a direct copy/paste from Mike Cao's Gore Plugin
//with a few minor changes
//i had permission to use this code of course
/************************************************************
* GIB FUNCTIONS (made by mike_cao)
************************************************************/

public event_respawn(id) {
	gHealthIndex[id] = get_user_health(id)
	fx_trans(id,255)
	return PLUGIN_CONTINUE	

}

static fx_trans(player,amount)
{
	set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount)
	return PLUGIN_CONTINUE
}

static fx_blood_small(origin[3],num)
{
	// Blood decals
	#if CZERO
	static const blood_small[8] = {202,203,204,205,206,207,208,209}
	#else
	static const blood_small[7] = {190,191,192,193,194,195,197}
	#endif	
	// Small splash
	for (new j = 0; j < num; j++) {
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_WORLDDECAL)
		write_coord(origin[0]+random_num(-100,100))
		write_coord(origin[1]+random_num(-100,100))
		write_coord(origin[2]-36)
		write_byte(blood_small[random_num(0,6)]) // index
		message_end()
	}
}

static fx_blood_large(origin[3],num)
{
	// Blood decals
	#if CZERO
	static const blood_large[2] = {216,217}
	#else
	static const blood_large[2] = {204,205}
	#endif
	
	// Large splash
	for (new i = 0; i < num; i++) {
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_WORLDDECAL)
		write_coord(origin[0]+random_num(-50,50))
		write_coord(origin[1]+random_num(-50,50))
		write_coord(origin[2]-36)
		write_byte(blood_large[random_num(0,1)]) // index
		message_end()
	}
}

static fx_gib_explode(origin[3],num)
{
	new flesh[3], x, y, z
	flesh[0] = mdl_gib_flesh
	flesh[1] = mdl_gib_meat
	flesh[2] = mdl_gib_legbone
	
	// Gib explosion
	// Head
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_MODEL)
	write_coord(origin[0])
	write_coord(origin[1])
	write_coord(origin[2])
	write_coord(random_num(-100,100))
	write_coord(random_num(-100,100))
	write_coord(random_num(100,200))
	write_angle(random_num(0,360))
	write_short(mdl_gib_head)
	write_byte(0) // bounce
	write_byte(500) // life
	message_end()
	
	// Spine
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_MODEL)
	write_coord(origin[0])
	write_coord(origin[1])
	write_coord(origin[2])
	write_coord(random_num(-100,100))
	write_coord(random_num(-100,100))
	write_coord(random_num(100,200))
	write_angle(random_num(0,360))
	write_short(mdl_gib_spine)
	write_byte(0) // bounce
	write_byte(500) // life
	message_end()
	
	// Lung
	for(new i = 0; i < random_num(1,2); i++) {
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_MODEL)
		write_coord(origin[0])
		write_coord(origin[1])
		write_coord(origin[2])
		write_coord(random_num(-100,100))
		write_coord(random_num(-100,100))
		write_coord(random_num(100,200))
		write_angle(random_num(0,360))
		write_short(mdl_gib_lung)
		write_byte(0) // bounce
		write_byte(500) // life
		message_end()
	}
	
	// Parts, 10 times
	for(new i = 0; i < 10; i++) {
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
		write_byte(TE_MODEL)
		write_coord(origin[0])
		write_coord(origin[1])
		write_coord(origin[2])
		write_coord(random_num(-100,100))
		write_coord(random_num(-100,100))
		write_coord(random_num(100,200))
		write_angle(random_num(0,360))
		write_short(flesh[random_num(0,2)])
		write_byte(0) // bounce
		write_byte(500) // life
		message_end()
	}
	
	// Blood
	for(new i = 0; i < num; i++) {
		x = random_num(-100,100)
		y = random_num(-100,100)
		z = random_num(0,100)
		for(new j = 0; j < 3; j++) {
			message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
			write_byte(TE_BLOODSPRITE)
			write_coord(origin[0]+(x*j))
			write_coord(origin[1]+(y*j))
			write_coord(origin[2]+(z*j))
			write_short(spr_blood_spray)
			write_short(spr_blood_drop)
			write_byte(229) // color index
			write_byte(15) // size
			message_end()
		}
	}
}

/**********************************
Function Testing Section
***********************************/


/**********************************
End of Function Testing Sectionn
***********************************/
en el sv tengo el mp_friendlyfire en "0"

Last edited by twiister; 04-22-2013 at 14:16.
twiister is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 04-21-2013 , 15:55   Re: [Bazooka] No mata al team contrario.
#2

Ps descargate de nuevo el plugin creo que es este: http://forums.alliedmods.net/showthread.php?p=72047
Nomas ponle el plugin y no le muevas a nada deve de funcionar Recuerda que te puedes matar tu solo con ella pero a los de tu equipo no, y obio a los del equipo contrario si los mata
Si no jala debera interferir otro plugin que tengas talvez
__________________
Allied Modders En Español
MexPower is offline
3MCy Daimont
Senior Member
Join Date: Oct 2012
Old 04-21-2013 , 15:56   Re: [Bazooka] No mata al team contrario.
#3

primero que nada encierralo en PHP, por que asi no entiendo nada
__________________
Clases Humanas v2.0 Con/Sin Restriccion de Niveles
El premio de una buena accion, es haberla hecho...
Te Amo GokuX <3
I Love those believed.
3MCy Daimont is offline
twiister
Senior Member
Join Date: Mar 2013
Location: Argentina
Old 04-22-2013 , 11:59   Re: [Solucionado] Bazoka, No mata al team contrario.
#4

Quote:
Originally Posted by MexPower View Post
Ps descargate de nuevo el plugin creo que es este: http://forums.alliedmods.net/showthread.php?p=72047
Nomas ponle el plugin y no le muevas a nada deve de funcionar Recuerda que te puedes matar tu solo con ella pero a los de tu equipo no, y obio a los del equipo contrario si los mata
Si no jala debera interferir otro plugin que tengas talvez
Ya lo eh probado y cuando lanzo la bazoka explota al lado mio.. osea no se dirige :/


Quote:
Originally Posted by 3MCy Daimont View Post
primero que nada encierralo en PHP, por que asi no entiendo nada
Perdon.. Aca esta el code en PHP..

PHP Code:
/ * AMX Mod X guión

Bazooka 
:: ::

Comandos:

amx_bazooka generar un bazooka en frente de usted (funciona en el modo espectador también administrador único)

amx_bazooka_give <@ totalidad o nombre id> <amount> | dar a alguien un bazooka (admin solamente)

amx_bazooka_startarena <Modo restrictions> <round reiniciar 1|0> | presentar la arena bazooka (admin solamente)

amx_bazooka_endarena <poner ammo> | especificar nueva munición para todo el mundo y al final bazooka arena (se establece en -1 para salir de munición de todo el mundo soloadministrador único)

Diga buybazooka en el chat para abrir un menú de compra. (Todo el mundo)

Diga bazookahelp en el chat para abrir el archivo de ayuda. (Todo el mundo)

Cvars:

amx_bazooka_dropping :: Puede un jugador abandonar su bazooka? (Por defecto1)

amx_bazooka_ammo :: cuánta munición tiene el bazooka? (Por defecto3)

amx_bazooka_arena :: Si se pone a 1 cada jugador recibirá una bazooka con munición ilimitada
en el inicio de la siguiente ronda
Mientras este modo se activa que requiere
un golpe directo a matar a alguien
También es recomendable restringir los otros modos.

amx_bazooka_cost :: ¿cuánto cuesta el bazooka para comprarlo? (Por defecto8000)

amx_bazooka_buyable :: ¿es posible comprar el bazooka? (Por defecto1)

amx_bazooka_damageradius :: ¿Qué tan grande es el radio de daño (por defecto250)

amx_bazooka_maxdamage :: cuando se encuentra en el centrola cantidad de HP se pierde? (Por defecto150)

amx_bazooka_restrict :: resrict ciertos modosNormaltermodirigidosguiada por el usuarioSin restricciones

amx_bazooka_reloadtime 
:: cuánto tiempo (en segundosque se tarda en recargar la bazooka (por defecto2.5)

amx_bazooka_trailtime :: ¿Cuánto tiempo permanecen los senderos bazooka en el aire (mejor a 30)

amx_bazooka_velocity :: Esto sólo afecta a la rapidez con la búsqueda de calor y cohetes normales van (mejor a 700)

amx_bazooka_teamcolors :: establecidos en 1 para utilizar los colores del equipo (CT bluerojoo se establece en 2 para que los colores al azar

amx_bazooka_gib 
:: establecido en 1 para provocar una explosión gib si el daño es100 y también lo suficiente como para matar a la persona

Un agradecimiento especial a
:

- = 
STN = - MaGe
KaOs
RadidEskimo
Freecode
EJL
JTP10181
PaintLancer
Kaddar
Vexd
twistedeuphoria
XxAvalanchexX
papi chulo
Ronkkrop
Más de lo que el plugin original de bazooka
mike_cao por su complemento impresionante Gore
BAILOPAN

Notas
:
1. Por lo que he probado en mi pueblo servidores parecen como los colores del equipo mejor que los colores al azar.
2. He atado algunas claves para bazooka arena de este modo:
bind "PGDN" "amx_bazooka_arena 0; amx_bazooka_maxdamage 150; amx_bazooka_damageradius 250; amx_bazooka_restrict 1; sv_gravity 800; amx_say Bazooka Arena OFF"
bind "PGUP" "amx_bazooka_arena 1; amx_bazooka_maxdamage 999999; amx_bazooka_damageradius 40; amx_bazooka_restrict 1; sv_gravity 150; amx_bazooka_give @ todo 1; amx_say Bazooka Arena ON; amx_say decir 'bazookahelp" para obtener más información sobre Bazookas "
3. Cuando usted tiene Bazooka arena activada es divertido cambiar los tiempos de recarga.
Modo Bonus: reloadtime es 2.5
Modo de Tiro Rápido: reloadtime es 0
Esto ha tenido buenos comentarios en mi servidor de prueba.
4. personas están intrigados por una bazooka en CS 1.6, anunciar esto en el nombre del servidor.
* /

/ / Establezca este valor en 1 si está utilizando Condition Zero
/ / NO he probado este plugin con CZ, así que no sé si funcionará
/ / Este cambio fue parte de Mike Cao Gore complemento
/ / Yo creo que se asegura de que se utilizan los índices de sprites correctos
# Define CZero 0


# Include <amxmodx>
# Include <fakemeta>
# Include <engine>
# Include <fun>
# Include <cstrike>
# Include <amxmisc>
# Include <entity_maths> / / esto tiene la función de los cohetes "
de búsqueda de calor"

# Define TE_EXPLOSION 3
# Define TE_EXPLFLAG_NONE 0
# Define TE_SMOKE 5
# Define TE_BLOODSPRITE 115
# Define TE_BLOODSTREAM 101
# Define TE_MODEL 106
# Define TE_WORLDDECAL 116
# Define BA_NORMAL (1 << 0) / / "
a"
# Define BA_HEAT (1 << 1) / / "b"
# Define BA_USER (1 << 2) / / "
c"
# Define SEQ_IDLE 0
# Define SEQ_FIDGET 1
# Define SEQ_RELOAD 2
# Define SEQ_FIRE 3
# Define BAZOOKA_MENUKEYS (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6 ) | (1 << 7) | (1 << 8) | (1 << 9)



nueva g_sModelIndexFireball, g_sModelIndexSmoke, rocketsmoke
nueva bool: CanShoot [32], Munni [32], el modo [32], bool: allow_shooting, user_controll [32], bool: hasBazooka [32]
nueva mdl_gib_flesh, mdl_gib_head, mdl_gib_legbone, mdl_gib_lung, mdl_gib_meat, mdl_gib_spine, spr_blood_drop, spr_blood_spray
nueva gHealthIndex [33], bool: cantplantbomb, bool: cantswitch, iFlags, modetext [32]
nueva mano [33], newhand [33], bazookamenu, seq_animation [32]

plugin_init pública () {
    register_plugin ("
BazookaAdvanced", "1.3c", "gran victoria")
    register_concmd ("
amx_bazooka", "drop_rpg", ADMIN_LEVEL_A)
    register_concmd ("
amx_bazooka_give", "cmdBazooka_give", ADMIN_LEVEL_A, "<@ totalidad o nombre id> <amount>")
    register_concmd ("
amx_bazooka_startarena", "cmdBazooka_StartArena", ADMIN_LEVEL_A, "<Modo restrictions> <restart tiempono restart>")

    register_concmd ("
amx_bazooka_endarena", "cmdBazooka_EndArena", ADMIN_LEVEL_A, "<poner ammo>")
    
    register_cvar ("
amx_bazooka_dropping", "1") / / Puede un jugador abandonar una bazuca
    register_cvar ("
amx_bazooka_ammo", "1") / / la cantidad de munición por bazooka
    register_cvar ("
amx_bazooka_damageradius", "250") / / NOTA: damagradius no se ve afectado por las paredes
    register_cvar ("
amx_bazooka_maxdamage", "150")
    register_cvar ("
amx_bazooka_cost", "2500") / / ¿cuánto uno cuesta bazooka
    register_cvar ("
amx_bazooka_arena", "0") / / requiere golpe directo de matar
    register_cvar ("
amx_bazooka_buyable", "1") / / deshabilita / habilita el menú de compra
    register_cvar ("
amx_bazooka_restrict", "bc") / / a = Normal | b = termodirigidos | c = guiada por el usuario | d = Ninguno
    register_cvar ("
amx_bazooka_reloadtime", "3.1") / / en segundo
    register_cvar ("
amx_bazooka_trailtime", "30") / / aproximadamente 3 segundos
    register_cvar ("
amx_bazooka_velocity", "700") / / no sé las unidades de este, sólo trata de los números
    register_cvar ("
amx_bazooka_teamcolors", "1") / / 0 = negro, 1 = colores del equipo, 2 = random
    register_cvar ("
amx_bazooka_gib", "1") / / se establece en 1 para las muertes gib (puede causar retraso en los equipos más lentos)
    register_cvar ("
amx_bazooka_autohands", "1") / / 1 = on, 0 = off
    / / Autohands es experimental, hace que el bazooka aparece en el lado correcto mediante el establecimiento del cliente cl_righthand cvar
    
    
    / / Cvars prueba
    register_cvar cantidad ("
amx_bazooka_menu4num", "7") municiones / / set de menuitem 4
    
    
    register_clcmd ("
decir", "handle_say")
    register_clcmd ("
say_team", "handle_say")
    
    register_event ("
DeathMsg", "player_die", "a")
    register_event ("
CurWeapon", "check_model", "ser")
    register_event ("
TextMsg", "bomb_msg", "b", "# C4_Plant_At_Bomb_Spot")
    
register_event ("ResetHUD""event_respawn""ser""1 = 1")  
    
register_logevent ("round_end"", 1 = Round_End")
    
register_logevent ("round_start"", 1 = Round_Start")
    
register_logevent ("bombplant"", 2 = Planted_The_Bomb")
    
    
register_clcmd ("drop""handle_drop")
    
    
register_forward (FM_PlayerPreThink"player_bazooka")
    
register_forward (FM_SetModel"forward_setmodel")
    / *************************************** /
    / / 
Register_forward (FM_UpdateClientData"UpdateClientData_Post"1)
    / *************************************** /

    
bazookamenu menu_create ("Bazooka Menu""do_bazookamenu")
    
menu_additem (bazookamenu"Comprar Bazooka""1"ADMIN_ALL)
    
menu_additem (bazookamenu"Vendo 2 Rockets""2"ADMIN_ALL)
    
menu_additem (bazookamenu"compre 3 Rockets""3"ADMIN_ALL)
    
menu_additem (bazookamenu"Temp""4"ADMIN_ALL)
    / * 
Notas sobre el sistema de menús:
    
bazookamenu es el id de nuestra Menusystem personalizada
    utilizando menu_additem 
() He añadido 3 entradas para empezar
    
    más tarde en la función Showmenu_Bazooka 
() a continuación utilizo el cvar
    amx_bazooka_menu4num para establecer el número de municiones en la ranura de cuatro
,
    
formatear el texto de cuatro ranurasencontrará ranura Identificación de cuatro,
    
y cambie el texto en cuatro ranuras
    espero que esto puede ser refinado para hacer un sistema de menú dinámico para los administradores
    
* /
}

pública plugin_precache () {
    
precache_model ("models / rpgrocket.mdl")
    
precache_model ("models / w_rpg.mdl")
    
precache_model ("models / v_rpg.mdl")
    
precache_model ("models / p_rpg.mdl")
    
precache_sound ("weapons/rocketfire1.wav")
    
precache_sound ("items/gunpickup4.wav")
    
precache_sound ("armas / nuke_fly.wav") / / <- este es el único no-juego de archivos de sonidoasegúrese de que tiene que
    precache_sound 
("weapons/dryfire1.wav")
    
spr_blood_drop precache_model ("sprites / blood.spr")
    
spr_blood_spray precache_model ("sprites / bloodspray.spr")
    
mdl_gib_flesh precache_model ("models / Fleshgibs.mdl")
    
mdl_gib_head precache_model ("models / GIB_Skull.mdl")
    
mdl_gib_legbone precache_model ("models / GIB_Legbone.mdl")
    
mdl_gib_lung precache_model ("models / GIB_Lung.mdl")
    
mdl_gib_meat precache_model ("models / GIB_B_Gib.mdl")
    
mdl_gib_spine precache_model ("models / GIB_B_Bone.mdl")
    
g_sModelIndexFireball precache_model ("sprites / zerogxplode.spr")
    
g_sModelIndexSmoke precache_model ("sprites/steam1.spr")
    
rocketsmoke precache_model ("sprites / smoke.spr")
}
/ *****************************
WIP Sección comandos
****************************** /

/ / 
Notas:
/ / 
Estoy tratando de mejorar el sistema de menús de edad por lo que para comprar munición
/ / Quizás en el futuro podría añadir vender?

/ / 
BCost bazooka precio
/ / ACOST Precio coheteque es la mitad de Bcost o Bcost 2

/ / Comprar Bazooka
/ / 1. Bazooka (BCost)
/ / 
2. Compre 1 Rocket (ACOST)
/ / 
3. Compra 2 Rockets (ACOST 2)
/ / 
4. Compra 4 Rockets (ACOST 4)

/ / 
5. Vende 1 Rocket (ACOST 0,75) - impide el aumento de dinero
/ / 6. Venda 2 Rockets ((ACOST 0,75) * 2) - same here

/ / 0. Salida

pública Showmenu_Bazooka 
(id) {
    
nueva menu_item4text [51], ammonummenu_item4id
    ammonum 
get_cvar_num ("amx_bazooka_menu4num") / / obtener el ammonum para la ranura 4
    format 
(menu_item4text50"Comprar% i Rockets"ammonum) / texto formato
    menu_item4id 
menu_find_id (bazookamenu0MENU_KEY_4) / / buscar el identificador de menuitem 4
    menu_item_setname 
(bazookamenumenu_item4idmenu_item4text) / / establecer el texto
    menu_display 
(idbazookamenu0) / / mostrar el nuevo menú
    
/ / BTW usando menu_additem () aquí hace que el menú se hacen más grandes cada vez que el menú se llama
    
    
/ * New MenuBody_b [256]
    
nueva len Formato (MenuBody_b255"\ ybuy Artículo ^ n ^ n")
    
len len formato (MenuBody_b [les], 255 len". \ w1 Bazooka \ R $% d ^ n"get_cvar_num ("amx_bazooka_cost"))
    
len len formato (MenuBody_b [les], 255 len". ^ n \ w0 Exit ^ n")
    
register_menuid ("Bazooka_Buymenu")
    
show_menu (idBAZOOKA_MENUKEYSMenuBody_b, -1"Bazooka Menu") * /
    
menu_display (idbazookamenu0)
    
volver PLUGIN_HANDLED
}

do_bazookamenu pública (idMenupunto) {
    
nueva szCommand [3], AccesssDevolución de llamadaBCostACOST
    BCost 
get_cvar_num ("amx_bazooka_cost") / / explicados en la sección notas
    ACOST 
BCost 2
    menu_item_getinfo 
(MenúpuntoAccesssszCommand2__rellamada)
    
interruptor (szCommand [0]) {
        case 
'-': {
            
volver PLUGIN_HANDLED
        
}
        
caso '1 ': {
            if (
cs_get_user_money (id)> = BCost &&! hasBazooka [id]) {
                
give_item_bazooka (id, (Munni [id] + get_cvar_num ("amx_bazooka_ammo")), 1)
                
cs_set_user_money (idcs_get_user_money (id) - BCost)
                
client_print (idprint_chat"[Bazooka] Has comprado éxito un bazooka!")
                
client_print (idprint_chat"[Bazooka] ¿Qué vas a hacer ahora?")
            }
            if (
cs_get_user_money (id) <BCost) {
                
client_print (idprint_center"Usted necesita $% i a comprar esto"BCost)
            }
            if (
hasBazooka [id]) {
                
client_print (idprint_center"Ya tiene un bazooka")
            }
        }
        
caso 2 ": {
            if (cs_get_user_money (id)> = ACOST * 2 && hasBazooka [id]) {
                Munni [id] + = 2
                cs_set_user_money (id, cs_get_user_money (id) - ACOST * 2)
                client_print (id, print_chat, "
[BazookaAhora tienei Rockets", Munni [id])
            }
            if (cs_get_user_money (id) <ACOST * 2) {
                client_print (id, print_center, "
Usted necesita $% i a comprar esto", ACOST * 2)
            }
            if (! hasBazooka [id]) {
                client_print (id, print_center, "
No se puede comprar munición para un arma que no tiene")
            }
        }
        caso '3 ': {
            if (cs_get_user_money (id)> = ACOST * 4 && hasBazooka [id]) {
                Munni [id] + = 4
                cs_set_user_money (id, cs_get_user_money (id) - ACOST * 4)
                client_print (id, print_chat, "
[BazookaAhora tienei Rockets", Munni [id])
            }
            if (cs_get_user_money (id) <ACOST * 4) {
                client_print (id, print_center, "
Necesitasi dólares para comprar esto", ACOST * 4)
            }
            if (! hasBazooka [id]) {
                client_print (id, print_center, "
No se puede comprar munición para un arma que no tiene")
            }
        }
        caso '4 ': {
            nueva addnum = get_cvar_num ("
amx_bazooka_menu4num")
            if (cs_get_user_money (id)> = ACOST * && addnum hasBazooka [id]) {
                Munni [id] + = addnum
                cs_set_user_money (id, cs_get_user_money (id) - ACOST * addnum)
                client_print (id, print_chat, "
[BazookaAhora tienei Rockets", Munni [id])
            }
            if (cs_get_user_money (id) <ACOST * addnum) {
                client_print (id, print_center, "
Necesitasi dólares para comprar esto", ACOST * 4)
            }
            if (! hasBazooka [id]) {
                client_print (id, print_center, "
No se puede comprar munición para un arma que no tiene")
            }
        }
    }
    volver PLUGIN_HANDLED
}

/ *****************************
Fin de la sección Comandos WIP
****************************** /

bomb_msg pública (id) {
    if (cs_get_user_plant (id)! = 1)
        client_print (id, print_center, "")
}

bombplant pública () {    
    cantplantbomb = true / / ahora nadie puede plantar la bomba
}

round_end pública () {
    set_task (4.8, "
round_prestart")
    set_task (5.0, "
player_spawn")
    / / Set_task (5.2, "
bazooka_arena")
    / / Colocar la tarea bazooka_arena aquí causó algunos problemas de tiempo
}

pública round_prestart () {
    allow_shooting = false
    cantplantbomb = true
    cantswitch = true
}

round_start pública () {
    allow_shooting = true
    cantplantbomb = false
    cantswitch = false
    si (get_cvar_num ("
amx_bazooka_arena") == 1) {
        set_task (0.1, "
bazooka_arena")
        / / Bazooka_arena la tarea se vuelve más precisa aquí
    }
}

/ / Esto elimina el modelo de mochila para portadores de bombas, lo dejé para consulta
/ * Forward_setmodel público (entidad, el modelo []) {
    if (! is_valid_ent (entidad)) {
        volver FMRES_IGNORED
    }
    if (iguales (modelo "
los modelos w_backpack.mdl")) {
        client_print (0, print_center, "")
        nueva ClassName [32]
        entity_get_string (entidad, EV_SZ_classname, ClassName, 31)
        
        if (igual (ClassName "
weaponbox")) {
            
            remove_entity (entidad)
            
            volver FMRES_SUPERCEDE
        }
    }
    volver FMRES_IGNORED
} * /

/ / Esto reemplaza el modelo de bomba lanzada con el modelo rpg
forward_setmodel público (entidad, el modelo []) { 
    if (! is_valid_ent (entidad)) { 
        volver FMRES_IGNORED; 
    } 
    if (equali (modelo "
models/w_c4.mdl")) { 
        entity_set_model (entidad, "
modelos w_rpg.mdl"); 
        volver FMRES_SUPERCEDE; 
    } 
    volver FMRES_IGNORED; 


client_disconnect pública (id) {
/ * Notas:
Ahora pienso que el uso de switch_hands () en este caso es demasiado tarde
poner cl_righthand cvar del jugador vuelve a la normalidad

Creo que tengo que encontrar un evento que sucede justo antes de que el jugador de dc
* /
    ammo_hud (id, 0)
    si (get_cvar_num ("
amx_bazooka_autohands") == 1) {
        switch_hands (id, 0)
    }
    Munni [id] = 0
    user_controll [id] = 0
    hasBazooka [id] = false
    if ((cs_get_user_plant (id) == 1) | | cantswitch) {
        cs_set_user_plant (id, 0,0)
        cantswitch = false
        / / Si esta persona tenía la bomba fuera y dc'ed entonces los otros jugadores pueden tener acceso a la bomba
    }
}

client_connect pública (id) {
    CanShoot [id] = true
    Munni [id] = 0
    modo [id] = 1
    modetext [id] = 1
    hasBazooka [id] = false
    / Información / requerido para las switch_hands () función
    / / Ir a ver la función de notas sobre su uso
    mano [id] = get_cvar_num ("
cl_righthand")
    if (mano [id] == 1) {
            newhand [id] = 0
    }
    else if (mano [id] == 0) {
            newhand [id] = 1
    }
}

pública player_die (id) {
    nueva víctima
    víctima = read_data (2)
    ammo_hud (víctima, 0)
    si (get_cvar_num ("
amx_bazooka_autohands") == 1) {
        switch_hands (víctima, 0)
        / / Establecer sus "
manos" volver a la normalidad
    }
    Munni [víctima] = 0
    user_controll [víctima] = 0
    hasBazooka [víctima] = false
    if ((cs_get_user_plant (víctima) == 1) | | cantswitch) {
        cs_set_user_plant (víctima, 0,0)
        cantswitch = false
        / / Si tenían c4 salir y murieron, reactivar c4 para otros jugadores
    }
}

player_spawn pública () {
    nuevos actores [32], el recuento
    get_players (jugadores, cuentan)
    para la (nueva i = 0; i <contar; i + +) {
        if (is_user_alive (jugadores [i])) {
            nueva v_oldmodel [64], p_oldmodel [64]
            entity_get_string (jugadores [i], EV_SZ_viewmodel, v_oldmodel, 63)
            entity_get_string (jugadores [i], EV_SZ_weaponmodel, p_oldmodel, 63)
            if (igual (v_oldmodel, "
modelos v_rpg.mdl") | | igual (p_oldmodel, "modelos p_rpg.mdl")) {
                if (! hasBazooka [jugadores [i]]) {
                    nueva weaponid, clip, munición
                    weaponid = get_user_weapon (jugadores [i], clip, munición)
                    
                    nueva weaponname [64]
                    get_weaponname (weaponid, weaponname, 63)
                    
                    nueva v_model [64], p_model [64]
                    format (v_model, 63, "
s", weaponname)
                    format (p_model, 63, "
s", weaponname)
                    
                    replace (v_model, 63, "
weapon_", "v_")
                    format (v_model, 63, "
modelos /% s.mdl", v_model)
                    entity_set_string (jugadores [i], EV_SZ_viewmodel, v_model)
                    
                    replace (p_model, 63, "
weapon_", "p_")
                    format (p_model, 63, "
modelos /% s.mdl", p_model)
                    entity_set_string (jugadores [i], EV_SZ_weaponmodel, p_model)
                }
            }
        }
    }
    
    nueva TempRocket find_ent_by_class = (-1, "
rpgrocket")
    while (TempRocket> 0) {
        remove_entity (TempRocket)
        TempRocket = find_ent_by_class (TempRocket, "
rpgrocket")
    }
    
    nueva TempRPG find_ent_by_class = (-1, "
rpg_temp")
    while (TempRPG> 0) {
        remove_entity (TempRPG)
        TempRPG = find_ent_by_class (TempRPG, "
rpg_temp")
    }
    volver PLUGIN_CONTINUE    
}

pública cmdBazooka_StartArena (id, nivel, cid) {
    / * Notas:
    funciones client_print () con "
/ / DEBUG INFO" directamente delante de ellos
    son sólo eso, información de depuración, que se pueden quitar o comentarios cuando se hacen las pruebas
    
    Además, esta función podría prolly soportar ser limpiado un poco
    un poco significado mucho: P
    * /
    if (! cmd_access (id, nivel, cid, 3)) {
        volver PLUGIN_HANDLED
    }
    / / Información de depuración
    / / Client_print (id, print_chat, "
[BazookacmdBazooka_StartArena ha sido llamada")
    nueva arg [6], arg2 [2], argumento2, jugadores [32], el recuento
    read_argv (1, arg, 5)
    read_argv (2, arg2, 1)
    argumento2 = str_to_num (arg2)
    set_cvar_string ("
amx_bazooka_arena", "1")
    console_cmd (id, "
amx_bazooka_arena 1")
    console_cmd (id, "
amx_bazooka_restricts", arg)
    set_task (0.1, "
bazooka_arena")
    get_players (jugadores, cuentan)
    para la (nueva i = 0; i <contar; i + +) {
        / / Nice pequeño aviso a los jugadores
        console_cmd (jugadores [i], "
spk ^" sistema attention.explosion activado ^ "")
    }
    if (argumento2> 0) {
        console_cmd (id, "
sv_restartrounds", argumento2)
    }
    volver PLUGIN_HANDLED
}

pública cmdBazooka_EndArena (id, nivel, cid) {
    if (! cmd_access (id, nivel, cid, 2)) {
        volver PLUGIN_HANDLED
    }
    / / Información de depuración
    / / Client_print (id, print_chat, "
[BazookacmdBazooka_EndArena ha sido llamada")
    nueva arg [5], argumento1 jugadores [32], el recuento
    read_argv (1, arg, 4)
    argumento1 = str_to_num (arg)
    console_cmd (id, "
amx_bazooka_arena 0")
    if (argumento1> = 0) {
        get_players (jugadores, cuentan)
        para la (nueva i = 0; i <contar; i + +) {
            Munni [jugadores [i]] = argumento1
            ammo_hud (jugadores [i], 0)
            ammo_hud (jugadores [i], 1)
            / / Un doble aviso de que Bazooka Arena está apagado
            / / Que es muy fácil pasar por alto un anuncio de texto en el fragor de la batalla
            client_print (jugadores [i], print_chat, "
[BazookaBazooka Arena se ha apagado")
            console_cmd (jugadores [i], "
spk ^" sistema attention.explosion desactivado ^ "")
        }
    }
    volver PLUGIN_HANDLED
}

/ * Notas:
Por aquí yo estaba tratando de hacer que las animaciones rpg trabajo
seq_animation [id] establece la secuencia de animación de un identificador específico
los números de animación para el bazooka aparecen como constantes en
la parte superior y son los siguientes:
SEQ_IDLE 0
SEQ_FIDGET 1
SEQ_RELOAD 2
SEQ_FIRE 3

No recuerdo lo bien que me dieron animaciones para trabajar,
Pero recuerdo que, en el mejor, tenía que ser la celebración de la
botón de fuego para la animación de fuego para trabajar
* /
pública rpg_reloaddone (datos []) {
    CanShoot [data [0]] = true
    seq_animation [data [0]] = SEQ_IDLE
}

rpg_reloadstart pública (datos []) {
    seq_animation [data [0]] = SEQ_RELOAD
}

fire_rocket pública (id) {
    ammo_hud (id, 0)
    ammo_hud (id, 1)
    / / Estas dos funciones antes refrescar efectivamente la información hud personalizado para el bazooka
    CanShoot [id] = false
    seq_animation [id] = SEQ_FIRE
    nuevos datos [1]
    data [0] = id
    nueva rtime = get_cvar_num ("
amx_bazooka_reloadtime")
    / / Nota: desde rtime debe ser un float hice la cvar un número entero de minimercados
    / / Pero luego he añadido 0.0 para que sea un flotador para más tarde
    if (cs_get_user_plant (id)! = 1) {/ / si no tienen la bomba fuera
        set_task ((rtime 0,0), "
rpg_reloaddone", id 9477, datos, 1) / / ¿Cuándo puedo volver a disparar?
        / / Set_task (0.0, "
rpg_reloadstart", id 9478, datos, 1) / / Iniciar la animación de recarga
        if ((Munni [id] <= 0) && (get_cvar_num ("
amx_bazooka_arena!") = 1)) {
            / / No ammo, haga clic vacía
            emit_sound (id, CHAN_WEAPON, "
weapons/dryfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            volver PLUGIN_HANDLED
        }
        else {
            / / Munición, la puesta en marcha de las matemáticas
            / / No toque la mayor parte de esto a menos que usted conozca sus vectores y ents
            new Float: StartOrigin [3], Float: Ángulo [3]
            
            nueva PlayerOrigin [3]
            get_user_origin (id, PlayerOrigin, 1)
            
            StartOrigin [0] = float (PlayerOrigin [0])
            StartOrigin [1] = float (PlayerOrigin [1])
            StartOrigin [2] = float (PlayerOrigin [2])
            
            entity_get_vector (id, EV_VEC_v_angle, Ángulo)
            Ángulo [0] = Ángulo [0] * -1.0
            nueva RocketEnt = create_entity ("
info_target")
            entity_set_string (RocketEnt, EV_SZ_classname, "
rpgrocket")
            entity_set_model (RocketEnt, "
modelos rpgrocket.mdl")
            entity_set_origin (RocketEnt, StartOrigin)
            entity_set_vector (RocketEnt, EV_VEC_angles, Ángulo)
            
            new Float: MinBox [3] = {-1,0, -1,0, -1,0}
            new Float: Maxbox [3] = {1.0, 1.0, 1.0}
            entity_set_vector (RocketEnt, EV_VEC_mins, MinBox)
            entity_set_vector (RocketEnt, EV_VEC_maxs, Maxbox)
            
            entity_set_int (RocketEnt, EV_INT_solid, 2)
            entity_set_int (RocketEnt, EV_INT_movetype, 5)
            entity_set_edict (RocketEnt, EV_ENT_owner, id)
            
            new Float: Velocity [3]
            nueva myvelocity = get_cvar_num ("
amx_bazooka_velocity") / velocidad / personalizada
            VelocityByAim (id, myvelocity, Velocity)
            entity_set_vector (RocketEnt, EV_VEC_velocity, Velocity)
            
            emit_sound (RocketEnt, CHAN_WEAPON, "
weapons/rocketfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            emit_sound (RocketEnt, CHAN_VOICE, "
armas nuke_fly.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            
            if (get_cvar_num ("
amx_bazooka_arena")! = 1) {
                / / Si bazooka_arena está apagado y luego restar de munición
                / / Y actualizar la costumbre hud
                ammo_hud (id, 0)
                Munni [id] -
                ammo_hud (id, 1)
            }
            / / Aquí hacemos los colores del rastro
            nueva CsTeams: iTeam = cs_get_user_team (id)
            nueva trailtime = get_cvar_num ("
amx_bazooka_trailtime")
            nueva colorr = random_num (0255)
            nueva Colorg = random_num (0255)
            nueva Colorb = random_num (0255)
            nueva colora = 100 + random_num (0155)
            / / Yo nunca he visto un rastro de humo negro en el CS, son posible? ...
            if (get_cvar_num ("
amx_bazooka_teamcolors") == 0) {/ / blanco
                message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
                write_byte (22)
                write_short (RocketEnt)
                write_short (rocketsmoke)
                write_byte (trailtime)
                write_byte (3)
                write_byte (255)
                write_byte (255)
                write_byte (255)
                write_byte (255)
                message_end ()
            }
            else if (get_cvar_num ("
amx_bazooka_teamcolors") == 1) {
                interruptor (iTeam) {
                    caso CS_TEAM_T: {/ / si el equipo T color = red
                        message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
                        write_byte (22)
                        write_short (RocketEnt)
                        write_short (rocketsmoke)
                        write_byte (trailtime)
                        write_byte (3)
                        write_byte (255)
                        write_byte (0)
                        write_byte (0)
                        write_byte (255)
                        message_end () 
                    }
                    caso CS_TEAM_CT: {/ / si el equipo de CT color = blue
                        message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
                        write_byte (22)
                        write_short (RocketEnt)
                        write_short (rocketsmoke)
                        write_byte (trailtime)
                        write_byte (3)
                        write_byte (0)
                        write_byte (0)
                        write_byte (255)
                        write_byte (255)
                        message_end ()
                    }
                }
            }
            else if (get_cvar_num ("
amx_bazooka_teamcolors") == 2) {colores / / random alguien?
                message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
                write_byte (22)
                write_short (RocketEnt)
                write_short (rocketsmoke)
                write_byte (trailtime)
                write_byte (3)
                write_byte (colorr)
                write_byte (Colorg)
                write_byte (Colorb)
                write_byte (colora)
                message_end ()
            }
            
            if (modo [id] == 2) {
                / / Mmmmm búsqueda de calor
                nueva información [1]
                info [0] = RocketEnt
                set_task (1.0, "
find_and_follow", 0, info, 1)
            }
            else if (modo [id] == 3) {
                / / Guiada por el usuario
                entity_set_int (RocketEnt, EV_INT_rendermode, 1)
                attach_view (id, RocketEnt)
                user_controll [id] = RocketEnt
            } 
            volver PLUGIN_HANDLED
        }
        volver PLUGIN_HANDLED
    }
    volver PLUGIN_HANDLED
}

find_and_follow público (info []) {
    nueva RocketEnt = info [0]
    new Float: shortestDist = 10000.0
    nueva nearestPlayer = 0
    
    if (is_valid_ent (RocketEnt)) {
        nuevos actores [32], el recuento
        get_players (jugadores, cuentan)
        para la (nueva i = 0; i <contar; i + +) {
            if (is_user_alive (jugadores [i]) && (entity_get_edict (RocketEnt, EV_ENT_owner)! = jugadores [i]) && (get_user_team (jugadores [i])! = get_user_team (entity_get_edict (RocketEnt, EV_ENT_owner)))) {
                new Float: PlayerOrigin [3], Float: RocketOrigin [3]
                entity_get_vector (jugadores [i], EV_VEC_origin, PlayerOrigin)
                entity_get_vector (RocketEnt, EV_VEC_origin, RocketOrigin)
                
                new Float: distancia = vector_distance (PlayerOrigin, RocketOrigin)
                
                if (distancia <= shortestDist) {
                    shortestDist = distancia
                    nearestPlayer jugadores = [i]
                }
            }
        }
    }
    
    if (nearestPlayer> 0) {
        nuevos datos [2]
        data [0] = RocketEnt
        de datos [1] = nearestPlayer
        set_task (0.1, "
follow_and_catch", RocketEnt, datos, 2, "b")
    }
    else {
        pfn_touch (RocketEnt, 0)
    }
}

pública follow_and_catch (datos []) {
    nueva RocketEnt = data [0]
    nuevo target = datos [1]
    nueva myvelocity = get_cvar_num ("
amx_bazooka_velocity")
    
    if (&& is_user_alive (objetivo) is_valid_ent (RocketEnt)) {
        entity_set_follow (RocketEnt, blanco, (myvelocity 0.0))
        
        new Float: Velocity [3]
        new Float: NewAngle [3]
        entity_get_vector (RocketEnt, EV_VEC_velocity, Velocity)
        vector_to_angle (Velocity, NewAngle)
        entity_set_vector (RocketEnt, EV_VEC_angles, NewAngle)
    }
    else {
        remove_task (RocketEnt)
        nueva información [1]
        info [0] = RocketEnt
        set_task (0.1, "
find_and_follow", 0, datos, 1)
    }
}

pública pfn_touch (ptr, ptd) {
    nueva ClassName [32]
    nueva ClassNameptd [32]
    / / Aquí yo tomo el nombre de clase de cada artículo para la depuración de las colisiones y avanzados más adelante
    if ((ptr> 0) && is_valid_ent (ptr)) {
        entity_get_string (ptr, EV_SZ_classname, ClassName, 31)
    }
    if ((ptd> 0) && is_valid_ent (PTD)) {
        entity_get_string (PTD, EV_SZ_classname, ClassNameptd, 31)
    }
    if (igual (ClassName "
rpgrocket")) {
        remove_task (ptr)
        new Float: EndOrigin [3] / / x, y, z
        entity_get_vector (ptr, EV_VEC_origin, EndOrigin)
        
        message_begin (MSG_BROADCAST, SVC_TEMPENTITY) / / explosión
        write_byte (TE_EXPLOSION)
        write_coord (floatround (EndOrigin [0]))
        write_coord (floatround (EndOrigin [1]))
        write_coord (floatround (EndOrigin [2]) 5)
        write_short (g_sModelIndexFireball)
        write_byte (random_num (0,20) + 20)
        write_byte (12) / / framerate
        write_byte (TE_EXPLFLAG_NONE)
        message_end ()
        
        message_begin (MSG_BROADCAST, SVC_TEMPENTITY) / / No se permite fumar
        write_byte (TE_SMOKE)
        write_coord (floatround (EndOrigin [0]))
        write_coord (floatround (EndOrigin [1]))
        write_coord (floatround (EndOrigin [2]) 15)
        write_short (g_sModelIndexSmoke)
        write_byte (60)
        write_byte (10)
        message_end ()
        
        / * Message_begin (MSG_BROADCAST, SVC_TEMPENTITY) / / explosión Decal
        write_byte (28) marca explotion / / granada
        write_coord (floatround (EndOrigin [0]))
        write_coord (floatround (EndOrigin [1]))
        write_coord (floatround (EndOrigin [2]))
        write_short (spr_blood_spray)
        write_short (spr_blood_drop)
        (229) index / / Color write_byte
        write_byte (15) / / tamaño
        message_end () * /
        
        nueva maxdamage = get_cvar_num ("
amx_bazooka_maxdamage")
        nueva damageradius = get_cvar_num ("
amx_bazooka_damageradius")
        if (igual (ClassNameptd, "
func_breakable")) {
            / / New Float: ptrhealth = entity_get_float (ptr, EV_FL_health);
            / / New Float: ptdhealth = entity_get_float (PTD, EV_FL_health);
            / / Información de depuración
            / / Client_print (0, print_console, "
Entidad ptr salud es:% i", ptrhealth)
            / / Client_print (0, print_console, "
Entidad ptd salud es:% i", ptdhealth)
            
            / / Entity_set_float (ptr, EV_FL_health, 100.0) / / No me acuerdo por qué está aquí
            / / Las siguientes funciones romper cualquier frágiles y matan el cohete
            / / Y cuando digo CUALQUIER breakables me refiero a cualquier breakables
            / / Que va a destruir incluso desencadenar sólo frágiles, malo para los cartógrafos
            force_use (ptr, ptd)
            remove_task (ptr)
        }
        / * Notas: Aquí traté de hacerlo de modo que si una entidad frágil estaba dentro de los daños
        radio sería recibir su parte de los daños
        esto es muy experimental, ya que no podía llegar a trabajar después de dos o tres días de juguetear
        * /
        / * If (igual (ClassNameptd, "
func_breakable")) {
            client_print (0, print_console, "
tiene nombre de clases", ClassNameptd)
            new Float: orig1 [3], origen1 [3], NonFloatEndOrigin [3]
            entity_get_vector (PTD, EV_VEC_origin, orig1)
            para la (nueva a = 0, un <3, a + +) {
                origen1 [a] = floatround (orig1 [a])
            }
            para la (nueva a = 0, un <3, a + +) {
                NonFloatEndOrigin [a] = floatround (EndOrigin [a])
            }
            nueva ptddistance = get_distance (origen1, NonFloatEndOrigin)
            client_print (0, print_console, "
tiene longitudi", ptddistance)
            if (ptddistance <= damageradius) {
                client_print (0, print_console, "
está en radio de daño")
                nuevo daño = maxdamage - floatround (floatmul (float (maxdamage), floatdiv (float (ptddistance), float (damageradius))))
                if (daño> 25) {
                    client_print (0, print_console, "
daño25")
                    force_use (ptr, ptd)
                    remove_task (ptr)
                }
                    else {
                    client_print (0, print_console, "
daños <25")
                    remove_task (ptr)
                }
            }
            volver PLUGIN_CONTINUE
        } * /
        
        nuevos playerpos [3], la distancia, el daño
        para la (nueva i = 1; i <32; i + +) {
            if (is_user_alive (i) == 1) {
                get_user_origin (i, playerpos)
                
                nueva NonFloatEndOrigin [3]
                para la (nueva a = 0, un <3, a + +) {
                        NonFloatEndOrigin [a] = floatround (EndOrigin [a])
                }
                distancia = get_distance (playerpos, NonFloatEndOrigin)
                if (distancia <= damageradius) {/ / Screenshake Radio
                    message_begin (MSG_ONE, get_user_msgid ("
ScreenShake"), {0,0,0}, i) / / Shake pantalla
                    write_short (1 << 14)
                    write_short (1 << 14)
                    write_short (1 << 14)
                    message_end ()
                    
                    daños = maxdamage - floatround (floatmul (float (maxdamage), floatdiv (float (distancia), float (damageradius))))
                    nuevo atacante = entity_get_edict (ptr, EV_ENT_owner)
                    
                    if (! get_user_godmode (i)) {
                        
                        if (get_user_team (atacante)! = get_user_team (i)) {
                            
                            if (daños <get_user_health (i)) {
                                set_user_health (i, get_user_health (i) - daño)
                            }
                            else {
                                set_msg_block (get_user_msgid ("
DeathMsg"), BLOCK_SET)
                                user_kill (i, 1)
                                set_msg_block (get_user_msgid ("
DeathMsg"), BLOCK_NOT)
                                
                                message_begin (MSG_BROADCAST, get_user_msgid ("
DeathMsg")) / / Kill-Log oben rechts
                                write_byte (atacante) / / Atacante
                                write_byte (i) / / Víctima
                                write_byte (0) / / Headshot
                                write_string ("
bazooka")
                                message_end ()
                                if (daño> 100 && get_cvar_num ("
amx_bazooka_gib") == 1) {/ / iniciar cuñas y efectos (hecha por mike_cao)
                                    nueva iOrigin [3]
                                    get_user_origin (i, iOrigin) / / Efectos
                                    fx_trans (i, 0)
                                    fx_gib_explode (iOrigin, 3)
                                    fx_blood_large (iOrigin, 5)
                                    fx_blood_small (iOrigin, 15)
                                    iOrigin [2] = iOrigin [2] -20 / / Hide cuerpo
                                    set_user_origin (i, iOrigin)
                                } / Gibs / finales y efectos
                                set_user_frags (atacante, get_user_frags (atacante) + 1)
                                si (get_cvar_num ("
amx_bazooka_gib") == 1) {
                                    client_print (atacante, print_center, "
LOLERSAcabas salpicó que las tripas del individuo por todas partes!")
                                }
                                
                            }
                        }
                        if (get_user_team (atacante) == get_user_team (i)) {
                            
                            if (atacante == i) {
                                
                                if (daños <get_user_health (i)) {
                                    set_user_health (i, get_user_health (i) - daño)
                                }
                                else {
                                    set_msg_block (get_user_msgid ("
DeathMsg"), BLOCK_SET)
                                    user_kill (i, 1)
                                    set_msg_block (get_user_msgid ("
DeathMsg"), BLOCK_NOT)
                                    
                                    message_begin (MSG_BROADCAST, get_user_msgid ("
DeathMsg")) / / Kill-Log oben rechts
                                    write_byte (atacante) / / Atacante
                                    write_byte (i) / / Víctima
                                    write_byte (0) / / Headshot
                                    write_string ("
bazooka")
                                    message_end ()
                                    if ((daño> 100) && get_cvar_num ("
amx_bazooka_gib") == 1) {/ / iniciar cuñas y efectos (hecha por mike_cao)
                                        nueva iOrigin [3]
                                        get_user_origin (i, iOrigin) / / Efectos
                                        fx_trans (i, 0)
                                        fx_gib_explode (iOrigin, 3)
                                        fx_blood_large (iOrigin, 5)
                                        fx_blood_small (iOrigin, 15)
                                        iOrigin [2] = iOrigin [2] -20 / / Hide cuerpo
                                        set_user_origin (i, iOrigin)
                                    } / Gibs / finales y efectos
                                    set_user_frags (atacante, get_user_frags (atacante) - 1)
                                    si (get_cvar_num ("
amx_bazooka_gib") == 1) {
                                        client_print (atacante, print_center "
GreatAhora todo el mundo sabe lo que tenía para la cena!")
                                    }
                                    else {
                                        client_print (atacante, print_center, "
¿Sabes esa cosa explota verdad?")
                                    }
                                    
                                }
                            }
                            else {
                                if (get_cvar_num ("
mp_friendlyfire")) {
                                    if (daños <get_user_health (i)) {
                                        set_user_health (i, get_user_health (i) - daño)
                                        client_print (atacante, print_center, "
Usted hirió a un compañero de equipo¡Mire su objetivo!")
                                    }
                                    else {
                                        set_msg_block (get_user_msgid ("
DeathMsg"), BLOCK_SET)
                                        user_kill (i, 1)
                                        set_msg_block (get_user_msgid ("
DeathMsg"), BLOCK_NOT)
                                        
                                        message_begin (MSG_BROADCAST, get_user_msgid ("
DeathMsg")) / / Kill-Log oben rechts
                                        write_byte (atacante) write_byte / / Delantero (i) / / Víctima
                                        write_byte (0) / / Headshot
                                        write_string ("
bazooka")
                                        message_end ()
                                        if (daño> 100 && get_cvar_num ("
amx_bazooka_gib") == 1) {/ / iniciar cuñas y efectos (hecha por mike_cao)
                                            nueva iOrigin [3]
                                            get_user_origin (i, iOrigin) / / Efectos
                                            fx_trans (i, 0)
                                            fx_gib_explode (iOrigin, 3)
                                            fx_blood_large (iOrigin, 5)
                                            fx_blood_small (iOrigin, 15)
                                            iOrigin [2] = iOrigin [2] -20 / / Hide cuerpo
                                            set_user_origin (i, iOrigin)
                                        } / Gibs / finales y efectos
                                        set_user_frags (atacante, get_user_frags (atacante) - 1)
                                        si (get_cvar_num ("
amx_bazooka_gib") == 1) {
                                            client_print (atacante, print_center, "
de OMFGAcabas salpicó un compañero de equipo!")
                                        }
                                        else {
                                            client_print (atacante, print_center, "
LOLEse compañero de equipo probablemente no es muy feliz ahora!")
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        attach_view (entity_get_edict (ptr, EV_ENT_owner), entity_get_edict (ptr, EV_ENT_owner))
        user_controll [entity_get_edict (ptr, EV_ENT_owner)] = 0
        remove_entity (ptr)
    }
    
    
    if (igual (ClassName, "
RPG") | | igual (ClassName "rpg_temp")) {
        nuevo Selector [32]
        if ((ptd> 0) && is_valid_ent (PTD)) {
            entity_get_string (PTD, EV_SZ_classname, Picker, 31)
        } 
        if (igual (Picker, "
player")) {
            give_item_bazooka (PTD (Munni [DPT] + entity_get_int (ptr, EV_INT_iuser1)), 1)
            client_print (PTD, print_chat, "
[BazookaHas cogido un bazooka!")
            remove_entity (ptr)
        }
    }
    volver PLUGIN_CONTINUE
}

pública drop_rpg (id, nivel, cid) {
    if (! cmd_access (id, nivel, cid, 1)) {
        volver PLUGIN_HANDLED
    }    
    new Float: PlayerOrigin [3], Float: End [3], Float: Volver [3], Float: TraceDirection [3]
    entity_get_vector (id, EV_VEC_origin, PlayerOrigin)
    VelocityByAim (id, 64, TraceDirection)
    
    Fin [0] = TraceDirection [0] + PlayerOrigin [0]
    Fin [1] = TraceDirection [1] + PlayerOrigin [1]
    Fin [2] = TraceDirection [2] + PlayerOrigin [2]
    
    trace_line (id, PlayerOrigin, End, Retorno)
    Volver [2] = PlayerOrigin [2]
    
    nuevo RPG = create_entity ("
info_target")
    entity_set_string (RPG, EV_SZ_classname, "
RPG")
    entity_set_model (RPG "
modelos w_rpg.mdl")
    entity_set_origin (RPG, Retorno)
    
    new Float: MinBox [3] = {-16,0, -16,0, 0,0}
    new Float: Maxbox [3] = {16.0, 16.0, 16.0}
    entity_set_vector (RPG, EV_VEC_mins, MinBox)
    entity_set_vector (RPG, EV_VEC_maxs, Maxbox)
    
    entity_set_int (RPG, EV_INT_solid, 1)
    entity_set_int (RPG, EV_INT_movetype, 6)
    
    entity_set_int (RPG, EV_INT_iuser1, get_cvar_num ("
amx_bazooka_ammo"))
    
    volver PLUGIN_HANDLED
}
/ * Notas:
No atornille con los modos. PERIODO!

Me tomó horas para averiguar la lógica de cada acción y hacer que funcione.
los modos en que sean permiten que sólo un jugador a la vez para acceder a la c4
y también obligará a un jugador moverse al siguiente modo si el que están en está restringido
lo cual puede suceder si los cambios de administración restricciones durante el juego
* /

pública player_bazooka (id) {
    if (is_user_alive (id)) {
        nueva weaponid, clip, munición
        weaponid = get_user_weapon (id, clip, munición)
        if ((weaponid == CSW_C4) && hasBazooka [id]) {
            set_animation (id, seq_animation [id])
            nuevo ataque = get_user_button (id) y IN_ATTACK
            nueva oldattack = get_user_oldbutton (id) y IN_ATTACK
            nueva attack2 = get_user_button (id) y IN_ATTACK2
            nueva oldattack2 = get_user_oldbutton (id) y IN_ATTACK2
            nueva CsTeams: iTeam = cs_get_user_team (id)
            if (&& ataque! && oldattack (cs_get_user_plant (id)! = 1)) {
                get_restrict_flags ()
                if (modo [id] == 1 && iFlags y BA_NORMAL) {
                    client_print (id, print_center, "
No se puede despedir a un modo restringido")
                    client_cmd (id, "
attack2espera;-attack2")
                }
                else if (modo [id] == 2 && iFlags y BA_HEAT) {
                    client_print (id, print_center, "
No se puede despedir a un modo restringido")
                    client_cmd (id, "
attack2espera;-attack2")
                }
                else if (modo [id] == 3 && iFlags y BA_USER) {
                    client_print (id, print_center, "
No se puede despedir a un modo restringido")
                    client_cmd (id, "
attack2espera;-attack2")
                }
                else if (modo [id] == 4 && iTeam y CS_TEAM_CT) {
                    client_print (id, print_center, "
Usted no puede colocar una bomba!")
                    client_cmd (id, "
attack2espera;-attack2")
                }
                else {
                    if (CanShoot [id] && && allow_shooting (user_controll [id] == 0)) {
                        fire_rocket (id)
                        
                    }
                }
                
            }
            else if (attack2 &&! oldattack2) {
                check_model (id)
                switch (modo [id]) {
                    Caso 1: {
                        get_restrict_flags ()
                        if ((iFlags y BA_HEAT)! = BA_HEAT) {
                            modo [id] = 2
                            modetext [id] = 2
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            emit_sound (id, CHAN_WEAPON, "
Elementos nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Modo de búsqueda de calor")
                        }
                        else if ((iFlags y BA_USER)! = BA_USER) {
                            modo [id] = 3
                            modetext [id] = 3                            
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            emit_sound (id, CHAN_WEAPON, "
items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Modo guiada por el usuario")
                        }
                        else {
                            if (! && cantplantbomb! cantswitch && iTeam y CS_TEAM_T) {
                                cantswitch = true
                                modo [id] = 4
                                modetext [id] = 4                            
                                ammo_hud (id, 0)
                                ammo_hud (id, 1)
                                cs_set_user_plant (id, 1,1)
                                check_model (id)
                                emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                                client_print (id, print_center, "
Cambiando a C4 bomba")
                            }
                            else if (cantplantbomb | | cantswitch | | iTeam y CS_TEAM_CT) {
                                modo [id] = 1
                                modetext [id] = 1
                                ammo_hud (id, 0)
                                ammo_hud (id, 1)
                                check_model (id)
                                emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                                client_print (id, print_center, "
Los otros modos son restringidos")
                            }
                        }
                    }
                    Caso 2: {
                        get_restrict_flags ()
                        if ((iFlags y BA_USER)! = BA_USER) {
                            modo [id] = 3
                            modetext [id] = 3
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            emit_sound (id, CHAN_WEAPON, "
items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Modo guiada por el usuario")
                        }
                        else if (iFlags y BA_USER && ((iFlags y BA_NORMAL)! = BA_NORMAL)) {
                            if (! && cantplantbomb! cantswitch && iTeam y CS_TEAM_T) {
                                cantswitch = true
                                modo [id] = 4
                                modetext [id] = 4
                                ammo_hud (id, 0)
                                ammo_hud (id, 1)
                                cs_set_user_plant (id, 1,1)
                                check_model (id)
                                emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                                client_print (id, print_center, "
Cambiando a C4 bomba")
                            }
                            else if (cantplantbomb | | cantswitch | | iTeam y CS_TEAM_CT) {
                                modo [id] = 1
                                modetext [id] = 1
                                ammo_hud (id, 0)
                                ammo_hud (id, 1)
                                check_model (id)
                                emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                                client_print (id, print_center, "
Modo Normal")
                            }
                        }
                        else {
                            modo [id] = 2
                            modetext [id] = 2
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Los otros modos son restringidos")
                        }
                    }
                    Caso 3: {
                        get_restrict_flags ()
                        if ((iFlags y BA_NORMAL)! = BA_NORMAL) {
                            if (! && cantplantbomb! cantswitch && iTeam y CS_TEAM_T) {
                                cantswitch = true
                                modo [id] = 4
                                modetext [id] = 4
                                ammo_hud (id, 0)
                                ammo_hud (id, 1)
                                cs_set_user_plant (id, 1,1)
                                check_model (id)
                                emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                                client_print (id, print_center, "
Cambiando a C4 bomba")
                            }
                            else if (cantplantbomb | | cantswitch | | iTeam y CS_TEAM_CT) {
                                modo [id] = 1
                                modetext [id] = 1
                                ammo_hud (id, 0)
                                ammo_hud (id, 1)
                                check_model (id)
                                emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                                client_print (id, print_center, "
Modo Normal")
                            }
                        }
                        else if ((iFlags y BA_HEAT)! = BA_HEAT) {
                            modo [id] = 2
                            modetext [id] = 2
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            emit_sound (id, CHAN_WEAPON, "
Elementos nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Modo de búsqueda de calor")
                        }
                        else {
                            modo [id] = 3
                            modetext [id] = 3
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Los otros modos son restringidos")
                        }
                    }
                    Caso 4: {
                        get_restrict_flags ()
                        if ((iFlags y BA_NORMAL)! = BA_NORMAL) {
                            cantswitch = false
                            modo [id] = 1
                            modetext [id] = 1
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            cs_set_user_plant (id, 0,0)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Cambiando a Bazooka")    
                        }
                        else if ((iFlags y BA_HEAT)! = BA_HEAT) {
                            cantswitch = false
                            modo [id] = 2
                            modetext [id] = 2
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            cs_set_user_plant (id, 0,0)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            emit_sound (id, CHAN_WEAPON, "
Elementos nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Modo de búsqueda de calor")
                        }
                        else if ((iFlags y BA_USER)! = BA_USER) {
                            cantswitch = false
                            modo [id] = 3
                            modetext [id] = 3
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            cs_set_user_plant (id, 0,0)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            emit_sound (id, CHAN_WEAPON, "
items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Modo guiada por el usuario")
                        }
                        else {
                            cantswitch = true
                            modo [id] = 4
                            modetext [id] = 4
                            ammo_hud (id, 0)
                            ammo_hud (id, 1)
                            cs_set_user_plant (id, 1,1)
                            check_model (id)
                            emit_sound (id, CHAN_ITEM, "
común wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                            client_print (id, print_center, "
Los otros modos son restringidos")
                        }
                    }
                }
            }
        }    
    }    
    if (user_controll [id]> 0) {
        nueva RocketEnt = user_controll [id]
        if (is_valid_ent (RocketEnt)) {
            new Float: Velocity [3]
            VelocityByAim (id, 500, Velocity)
            entity_set_vector (RocketEnt, EV_VEC_velocity, Velocity)
            new Float: NewAngle [3]
            entity_get_vector (id, EV_VEC_v_angle, NewAngle)
            entity_set_vector (RocketEnt, EV_VEC_angles, NewAngle)
        }
        else {
            attach_view (id, id)
        }
    }
    volver FMRES_IGNORED
}
/ * Notas
en la versión 1.3c esta función dio lugar tanto a un juego de rol y una bomba al caer el bazooka,
en la versión 1.3di limpió y esperamos fijar este error
... Creo que sólo limpié, pondrá a prueba más tarde ...
* /
handle_drop pública (id) {
    nueva weaponid, clip, munición
    weaponid = get_user_weapon (id, clip, munición)
    if (weaponid == CSW_C4 && cs_set_user_plant (id, 0,0)) {
        si (get_cvar_num ("
amx_bazooka_dropping") == 1) {
            drop_rpg_temp (id)
            si (get_cvar_num ("
amx_bazooka_autohands") == 1) {
                switch_hands (id, 0)
            }
        }
        else {
            client_print (id, print_center, "
Esta arma no se puede quitar")
            volver PLUGIN_HANDLED
        }
    }
    volver PLUGIN_CONTINUE
}

pública drop_rpg_temp (id) {
    
    new Float: PlayerOrigin [3], Float: End [3], Float: Volver [3], Float: TraceDirection [3], Float: Angles [3]
    entity_get_vector (id, EV_VEC_origin, PlayerOrigin)
    entity_get_vector (id, EV_VEC_angles, ángulos)
    VelocityByAim (id, 200, TraceDirection)
    
    Fin [0] = TraceDirection [0] + PlayerOrigin [0]
    Fin [1] = TraceDirection [1] + PlayerOrigin [1]
    Fin [2] = TraceDirection [2] + PlayerOrigin [2]
    
    trace_line (id, PlayerOrigin, End, Retorno)
    Volver [2] = PlayerOrigin [2]
    
    nuevo RPG = create_entity ("
info_target")
    entity_set_string (RPG, EV_SZ_classname, "
rpg_temp")
    entity_set_model (RPG "
modelos w_rpg.mdl")
    entity_set_origin (RPG, Retorno)
    
    Ángulos [0] = 0,0
    Ángulos [2] = 0,0
    
    entity_set_vector (RPG, EV_VEC_angles, ángulos)
    
    new Float: MinBox [3] = {-16,0, -16,0, 0,0}
    new Float: Maxbox [3] = {16.0, 16.0, 16.0}
    entity_set_vector (RPG, EV_VEC_mins, MinBox)
    entity_set_vector (RPG, EV_VEC_maxs, Maxbox)
    
    entity_set_int (RPG, EV_INT_solid, 1)
    entity_set_int (RPG, EV_INT_movetype, 6)
    
    entity_set_int (RPG, EV_INT_iuser1, Munni [id])
    
    Munni [id] = 0
    hasBazooka [id] = false
    
    volver PLUGIN_HANDLED
}

pública handle_say (id) {
    comando de nuevo [32]
    read_argv (1, comando, 31)
    
    if (igual (mando "
buybazooka")) {
        if (is_user_alive (id)) {
            si (get_cvar_num ("
amx_bazooka_buyable") == 1) {
                Showmenu_Bazooka (id)
            }
            else {
                client_print (id, print_chat, "
[BazookaEl buymenu está habilitado!")
            }
        }
        else {
            client_print (id, print_chat, "
[BazookaNo se puede comprar una bazuca mientras estás muerto!")
        }
    }
    if (igual (mando "
bazookahelp"))
        {
        / / Visualización del archivo de ayuda de amxx / configs / bazooka_help.htm
        nueva szHelpFile [64], szCustomDir [32]
        / / Creo get_customdir () se ha depreciado, no estoy seguro si ...
        get_customdir (szCustomDir, 31)
        format (szHelpFile, 63, "
bazooka_help.htm", szCustomDir)
        show_motd (id, szHelpFile, "
Bazooka Help")
        volver PLUGIN_CONTINUE
    }
    
    volver PLUGIN_HANDLED
}

pública cmdBazooka_give (id, nivel, cid) {
    if (! cmd_access (id, nivel, cid, 3)) {
        volver PLUGIN_HANDLED
    }
    
    nueva arg [32], arg2 [8], nombre2 [32], munición, argumento2
    munición = get_cvar_num ("
amx_bazooka_ammo")
    read_argv (1, arg, 31)
    read_argv (2, arg2, 7)
    argumento2 = str_to_num (arg2)
    if (equali (arg "
all"))
        {
        nueva plist [32], pnum
        get_players (plist, pnum, "
a")
        if (pnum == 0)
            {
            console_print (id, "
[BazookaEste cliente no es válido")
            volver PLUGIN_HANDLED
        }
        para la (nueva i = 0; i <pnum; i + +)
            {
            give_item_bazooka (plist [i], (argumento2 * munición), 1)
            client_print (plist [i], print_chat, "
[BazookaLa administración le dio una bazooka cond cohetes", argumento2 * munición)
            client_print (plist [i], print_chat, "
[BazookaCambiar al arma bomba o la ranura de armas 5 usarlo")
            console_print (id, "
[Bazookadio a todos los jugadores con bazookasd cohetes", argumento2 * munición)
        }
    }
    más
    {
        get_user_name (id, nombre 2, 31)
        nuevo jugador = cmd_target (id, arg, 7)
        if (! jugador)
            {
            console_print (id, "
[BazookaDale Bazooka Failed") 
            volver PLUGIN_HANDLED
        }
        nuevo nombre [32]
        get_user_name (jugador, nombre, 31)
        give_item_bazooka (jugador, (argumento2 * munición), 1)
        console_print (id, "
[BazookaDiosd Bazookas", nombre, argumento2 * munición)
        client_print (jugador, print_chat, "
[BazookaLa administración le dio una bazooka cond cohetes", argumento2 * munición)
        client_print (jugador, print_chat, "
[BazookaCambiar al arma bomba o arma ranura 5 para usarlo.")
        volver PLUGIN_HANDLED
    }
    volver PLUGIN_HANDLED
}

pública bazooka_arena (id) {
    si (get_cvar_num ("
amx_bazooka_arena") == 1) {
        / / Información de depuración
        / / Client_print (id, print_chat, "
[Bazookabazooka_arena ha sido llamada")
        / / Console_cmd (id, "
amx_bazooka_give todos 1")
        console_cmd (id, "
amx_bazooka_damageradius 40")
        console_cmd (id, "
amx_bazooka_maxdamage 999999")
        nuevos actores [32], el recuento
        get_players (jugadores, cuentan)
        para la (nueva i = 0; i <contar; i + +) {
            give_item_bazooka (jugadores [i], 1,1)
            client_print (jugadores [i], print_chat, "
[BazookaBazooka Arena está en marchadecir ^" bazookahelp ^ "para más información")
            client_print (jugadores [i], print_center, "
Es hora de hacer que las cosas vayan BOOM!")
        }
    }
    
    volver PLUGIN_HANDLED
}
/ / Esta función es más interna que externa, hace dando un bazooka suceda en una línea en lugar de 15
pública give_item_bazooka (id, munición, sonido) {
    give_item (id, "
weapon_c4") / / dar arma real
    hasBazooka [id] = true / / el plugin ahora sabe que tiene una bazooka
    Munni [id] = munición / / set municiones
    CanShoot [id] = true / / se puede disparar ahora
    cs_set_user_plant (id, 0,0) / / no se puede plantar a menos que cambien a bombardear
    modo [id] = 1 / / modo = normal
    modetext [id] = 1
    check_model (id) / / refresh modelo
    ammo_hud (id, 0)
    ammo_hud (id, 1) / / refresh info hud
    if (sonido) {
        / Notificación de audio /
        emit_sound (id, CHAN_ITEM, "
items/gunpickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}

/ * Notas:
Esta función es muy experimental también
Se debe permitir el uso de seq_animation [Identificación] en lugar del parámetro "
anim"
para ajustar la animación actual de un jugador específico.

El truco es conseguir que la animación para recorrer los fotogramas
y no permanecer en la primera uno en cada animación
* /
set_animation (id, anim) {
    set_pev (id, pev_weaponanim, anim)
    message_begin (MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, id)
    write_byte (anim)
    write_byte (PEV (id, pev_body))
    message_end ()
}

/ * Notas:
Esta pequeña funciones interruptores del cliente cl_righthand cvar
para que el bazooka aparece en el lado correcto

Hasta ahora he aplicado muy bien a excepción de cuando un jugador se desconecta
* /
switch_hands (id, modo) {
    if (modo) {
        client_cmd (id, "
cl_righthandi", newhand [id])
    }
    else {
        client_cmd (id, "
cl_righthandi", la mano [id])
    }
}

/ / Yay personalizada hud!
ammo_hud (id, espectáculo) {
    nueva AmmoHud [65], el modo [20]
    if (modetext [id] == 1) {
        mode = "
Bazooka"
    }
    else if (modetext [id] == 2) {
        mode = "
buscadores de calor"
    }
    else if (modetext [id] == 3) {
        mode = "
guiada por el usuario"
    }
    else if (modetext [id] == 4) {
        mode = "
C4"
    }
    si (get_cvar_num ("
amx_bazooka_arena") == 1) {
        format (AmmoHud, 64, "
RocketsInfinito Modo:% s", el modo)
    }
    else {
        format (AmmoHud, 64, "
Rockets:% Modo:% s", Munni [id], el modo)
    }
    
    if (espectáculo) {
        message_begin (MSG_ONE, get_user_msgid ("
StatusText"), {0,0,0}, id)
        write_byte (0)
        write_string (AmmoHud)
        message_end ()
    }
    else {
        message_begin (MSG_ONE, get_user_msgid ("
StatusText"), {0,0,0}, id)
        write_byte (0)
        write_string ("")
        message_end ()
    }
}

/ * Notas:
He visto esta obra en mi ordenador el 100% del tiempo,
pero yo no he podido probarlo en línea o con varios jugadores

lo que esta funcion no se compruebe si el jugador tiene el arma bazooka cabo
y luego se cambia el modelo en consecuencia, pero si esa arma no está fuera entonces
cambia de nuevo a lo que debería ser

Aquí es también donde switch_hands () se utiliza mucho
* /
check_model pública (id) {
    nueva weaponid, clip, munición
    nueva CsTeams: iTeam = cs_get_user_team (id)
    weaponid = get_user_weapon (id, clip, munición)
    if ((weaponid == CSW_C4) && ((cs_get_user_plant (id) = 1) | |! (modo [id] = 4))) {
        si (get_cvar_num ("
amx_bazooka_autohands") == 1) {
            switch_hands (id, 1)
        }
        ammo_hud (id, 0)
        ammo_hud (id, 1)
        cs_set_user_plant (id, 0,0)
        entity_set_string (id, EV_SZ_viewmodel, "
modelos v_rpg.mdl")
        entity_set_string (id, EV_SZ_weaponmodel, "
modelos p_rpg.mdl")
    }
    else if ((weaponid == CSW_C4) && ((cs_get_user_plant (id) == 1) | | (modo [id] == 4))) {
        si (get_cvar_num ("
amx_bazooka_autohands") == 1) {
            switch_hands (id, 0)
        }
        ammo_hud (id, 0)
        ammo_hud (id, 1)
        if (iTeam y CS_TEAM_CT) {
            cs_set_user_plant (id, 0,0)
            modo [id] = 1
            modetext [id] = 1
            entity_set_string (id, EV_SZ_viewmodel, "
modelos v_rpg.mdl")
            entity_set_string (id, EV_SZ_weaponmodel, "
modelos p_rpg.mdl")
        }
        else if (iTeam y CS_TEAM_T) {
            cs_set_user_plant (id, 1,1)
            entity_set_string (id, EV_SZ_viewmodel, "
models/v_c4.mdl")
            entity_set_string (id, EV_SZ_weaponmodel, "
models/p_c4.mdl")
        }
    }
    else if (weaponid! = CSW_C4) {
        si (get_cvar_num ("
amx_bazooka_autohands") == 1) {
            switch_hands (id, 0)
        }
        cs_set_user_plant (id, 0,0)
        modo [id] = 1
        modetext [id] = 1
        ammo_hud (id, 0)
    }
    volver PLUGIN_HANDLED
}
/ / Este pequeño individuo lee los distintivos que figuran en la amx_bazooka_restrict cvar
get_restrict_flags () {
    nuevos sFlags [24]
    get_cvar_string ("
amx_bazooka_restrict", sFlags, 24)
    iFlags = read_flags (sFlags)
}


/ / Ok, todo pasado aquí es una copia directa / paste de Mike Cao Gore Programas
/ / Con algunos cambios de menor importancia
/ / Que tenía permiso para utilizar este código, por supuesto,
/ ************************************************* ***********
* FUNCIONES GIB (hecho por mike_cao)
************************************************** ********** /

event_respawn pública (id) {
    gHealthIndex [id] = get_user_health (id)
    fx_trans (id, 255)
    volver PLUGIN_CONTINUE    

}

fx_trans estática (jugador, cantidad)
{
    set_user_rendering (jugador, kRenderFxNone, 0,0,0, kRenderTransAlpha, cantidad)
    volver PLUGIN_CONTINUE
}

estática fx_blood_small (origen [3], num)
{
    Etiquetas / / Sangre
    # Si CZero
    static const blood_small [8] = {} 202.203.204.205.206.207.208.209
    # Else
    estática blood_small const [7] = {} 190.191.192.193.194.195.197
    # Endif    
    / / Pequeñas salpicaduras
    para la (nueva j = 0; j <num; j + +) {
        message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte (TE_WORLDDECAL)
        write_coord (origen [0] + random_num (-100.100))
        write_coord (origen [1] + random_num (-100.100))
        write_coord (origen [2] -36)
        write_byte (blood_small [random_num (0.6)]) / / index
        message_end ()
    }
}

fx_blood_large estática (origen [3], num)
{
    Etiquetas / / Sangre
    # Si CZero
    estática const blood_large [2] = {216217}
    # Else
    estática const blood_large [2] = {204205}
    # Endif
    
    / / Grande splash
    para la (nueva i = 0; i <num; i + +) {
        message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte (TE_WORLDDECAL)
        write_coord (origen [0] + random_num (-50,50))
        write_coord (origen [1] + random_num (-50,50))
        write_coord (origen [2] -36)
        write_byte (blood_large [random_num (0,1)]) / / index
        message_end ()
    }
}

fx_gib_explode estática (origen [3], num)
{
    nueva carne [3], x, y, z
    carne [0] = mdl_gib_flesh
    carne [1] = mdl_gib_meat
    carne [2] = mdl_gib_legbone
    
    / Explosión / Gib
    / / Head
    message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
    write_byte (TE_MODEL)
    write_coord (origen [0])
    write_coord (origen [1])
    write_coord (origen [2])
    write_coord (random_num (-100.100))
    write_coord (random_num (-100.100))
    write_coord (random_num (100200))
    write_angle (random_num (0360))
    write_short (mdl_gib_head)
    write_byte (0) / / rebote
    write_byte (500) / / la vida
    message_end ()
    
    / / Columna
    message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
    write_byte (TE_MODEL)
    write_coord (origen [0])
    write_coord (origen [1])
    write_coord (origen [2])
    write_coord (random_num (-100.100))
    write_coord (random_num (-100.100))
    write_coord (random_num (100200))
    write_angle (random_num (0360))
    write_short (mdl_gib_spine)
    write_byte (0) / / rebote
    write_byte (500) / / la vida
    message_end ()
    
    / / Pulmón
    para la (nueva i = 0; i <random_num (1,2); i + +) {
        message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte (TE_MODEL)
        write_coord (origen [0])
        write_coord (origen [1])
        write_coord (origen [2])
        write_coord (random_num (-100.100))
        write_coord (random_num (-100.100))
        write_coord (random_num (100200))
        write_angle (random_num (0360))
        write_short (mdl_gib_lung)
        write_byte (0) / / rebote
        write_byte (500) / / la vida
        message_end ()
    }
    
    / / Las piezas, 10 veces
    para la (nueva i = 0; i <10; i + +) {
        message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte (TE_MODEL)
        write_coord (origen [0])
        write_coord (origen [1])
        write_coord (origen [2])
        write_coord (random_num (-100.100))
        write_coord (random_num (-100.100))
        write_coord (random_num (100200))
        write_angle (random_num (0360))
        write_short (carne [random_num (0,2)])
        write_byte (0) / / rebote
        write_byte (500) / / la vida
        message_end ()
    }
    
    / / Sangre
    para la (nueva i = 0; i <num; i + +) {
        x = random_num (-100100)
        y = random_num (-100100)
        z = random_num (0100)
        para la (nueva j = 0; j <3; j + +) {
            message_begin (MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte (TE_BLOODSPRITE)
            write_coord (origen [0] + (x * j))
            write_coord (origen [1] + (y * j))
            write_coord (origen [2] + (z * j))
            write_short (spr_blood_spray)
            write_short (spr_blood_drop)
            (229) index / / Color write_byte
            write_byte (15) / / tamaño
            message_end ()
        }
    }
}

/ **********************************
Sección de Pruebas de función
*********************************** /


/ **********************************
Fin de la función de prueba Sectionn
*********************************** / 
Problema solucionado!! Aumente el daño y el rango y listo.. anda perfecto ahora Gracias!
Si quiren cierren el post

Last edited by twiister; 04-22-2013 at 14:15.
twiister 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:52.


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