ÎtemSpawn: reworked Dog
This commit is contained in:
		
							parent
							
								
									daa75af559
								
							
						
					
					
						commit
						ebdc21711d
					
				| @ -183,6 +183,22 @@ stock void SetEntityProps(int entity) | |||||||
| 	SetEntProp(entity, Prop_Send, "m_fEffects", 32); | 	SetEntProp(entity, Prop_Send, "m_fEffects", 32); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | //---------------------------------------------------------------------------------------------------- | ||||||
|  | // Purpose: | ||||||
|  | //---------------------------------------------------------------------------------------------------- | ||||||
|  | public Action EquipWeapons(Handle timer, any userid) | ||||||
|  | { | ||||||
|  | 	int client = GetClientOfUserId(userid); | ||||||
|  | 
 | ||||||
|  | 	if (client != 0) | ||||||
|  | 	{ | ||||||
|  | 		GivePlayerItem(client, "weapon_p90"); | ||||||
|  | 		GivePlayerItem(client, "weapon_elite"); | ||||||
|  | 		GivePlayerItem(client, "item_kevlar"); | ||||||
|  | 		GivePlayerItem(client, "weapon_hegrenade"); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
| //---------------------------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------------------------- | ||||||
| // Purpose: | // Purpose: | ||||||
| //---------------------------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------------------------- | ||||||
|  | |||||||
| @ -44,106 +44,83 @@ public Action Command_HumanDog(int client, int argc) | |||||||
| //----------------------------------------------------------------------------------------------------
 | //----------------------------------------------------------------------------------------------------
 | ||||||
| public void SpawnHumanDog(float fOrigin[3]) | public void SpawnHumanDog(float fOrigin[3]) | ||||||
| { | { | ||||||
| 	char sBuffer[256]; |  | ||||||
| 	float fOriginTemp[3]; | 	float fOriginTemp[3]; | ||||||
| 
 | 
 | ||||||
| 	// Knife
 | 	// weapon_knife.
 | ||||||
| 	int iKnife = CreateEntityByName("weapon_knife"); | 	int iKnife = CreateEntityAtOrigin("weapon_knife", fOrigin); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_knife_%d", g_iCounter); | 	DispatchKeyFormat(iKnife, "targetname",             "human_dog_knife_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iKnife, "targetname", sBuffer); | 	DispatchKeyFormat(iKnife, "hammerid",               "11051995%d", g_iCounter); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "11051995%d", g_iCounter); | 	DispatchKeyFormat(iKnife, "spawnflags",             "1"); | ||||||
| 	DispatchKeyValue(iKnife, "hammerid", sBuffer); | 	DispatchKeyFormat(iKnife, "angles",                 "0 0 0"); | ||||||
| 	DispatchKeyValue(iKnife, "spawnflags", "1"); | 	DispatchKeyFormat(iKnife, "OnPlayerPickup",         "!self,AddOutput,renderfx 6,0,1"); | ||||||
| 	DispatchKeyValue(iKnife, "angles", "0 0 0"); | 	DispatchKeyFormat(iKnife, "OnPlayerPickup",         "item_human_dog_controls_%d,Activate,,0,1", g_iCounter); | ||||||
| 	DispatchKeyValueVector(iKnife, "origin", fOrigin); | 	DispatchKeyFormat(iKnife, "OnPlayerPickup",         "!activator,AddOutput,health 50000,0,1"); | ||||||
| 	//DispatchKeyValue(iKnife, "OnPlayerPickUp", "!activator,AddOutput,renderfx 6,0,-1");
 | 	DispatchKeyFormat(iKnife, "OnPlayerPickup",         "item_spawn_speedmod,ModifySpeed,0.8,0,1"); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_ui_%d,Activate,,0,-1", g_iCounter); | 	SpawnAndActivate(iKnife); | ||||||
| 	DispatchKeyValue(iKnife, "OnPlayerPickup", sBuffer); | 
 | ||||||
| 	DispatchSpawn(iKnife); |  | ||||||
| 	ActivateEntity(iKnife); |  | ||||||
| 	HookSingleEntityOutput(iKnife, "OnPlayerPickup", HumanDogPickup, true); | 	HookSingleEntityOutput(iKnife, "OnPlayerPickup", HumanDogPickup, true); | ||||||
| 
 | 
 | ||||||
| 	// Model
 | 
 | ||||||
| 	int iModel = CreateEntityByName("prop_dynamic"); | 	// model origin.
 | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_model_%d", g_iCounter); |  | ||||||
| 	DispatchKeyValue(iModel, "targetname", sBuffer); |  | ||||||
| 	DispatchKeyValue(iModel, "model", "models/player/pil/re1/dog/dog_pil.mdl"); |  | ||||||
| 	DispatchKeyValue(iModel, "DisableBoneFollowers", "1"); |  | ||||||
| 	DispatchKeyValue(iModel, "angles", "0 0 0"); |  | ||||||
| 	DispatchKeyValue(iModel, "solid", "0"); |  | ||||||
| 	DispatchKeyValue(iModel, "skin", "1"); |  | ||||||
| 	DispatchKeyValue(iModel, "DefaultAnim", "Run_lower"); |  | ||||||
| 	fOriginTemp[0] = fOrigin[0] + 10.4; | 	fOriginTemp[0] = fOrigin[0] + 10.4; | ||||||
| 	fOriginTemp[1] = fOrigin[1] - 2.0; | 	fOriginTemp[1] = fOrigin[1] - 2.0; | ||||||
| 	fOriginTemp[2] = fOrigin[2] - 40.32; | 	fOriginTemp[2] = fOrigin[2] - 40.32; | ||||||
| 	DispatchKeyValueVector(iModel, "origin", fOriginTemp); |  | ||||||
| 	DispatchSpawn(iModel); |  | ||||||
| 	ActivateEntity(iModel); |  | ||||||
| 	SetVariantString("!activator"); |  | ||||||
| 	AcceptEntityInput(iModel, "SetParent", iKnife); |  | ||||||
| 
 | 
 | ||||||
| 	// pickup trigger_once
 | 	// prop_dynamic model.
 | ||||||
| 	int iTrigger = CreateEntityByName("trigger_once"); | 	int iModel = CreateEntityAtOrigin("prop_dynamic", fOriginTemp); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "tnt_trigger_%d", g_iCounter); | 	DispatchKeyFormat(iModel, "targetname",             "item_human_dog_model_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iTrigger, "targetname", sBuffer); | 	DispatchKeyFormat(iModel, "model",                  "models/player/pil/re1/dog/dog_pil.mdl"); | ||||||
| 	DispatchKeyValue(iTrigger, "spawnflags", "1"); | 	DispatchKeyFormat(iModel, "disablebonefollowers",   "1"); | ||||||
| 	DispatchKeyValue(iTrigger, "startdisabled", "1"); | 	DispatchKeyFormat(iModel, "defaultanim",            "Run_lower"); | ||||||
| 	DispatchKeyValue(iTrigger, "filtername", "item_spawn_human_filter"); | 	DispatchKeyFormat(iModel, "angles",                 "0 0 0"); | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", "item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1"); | 	DispatchKeyFormat(iModel, "solid",                  "0"); | ||||||
| 	DispatchKeyValueVector(iTrigger, "origin", fOrigin); | 	DispatchKeyFormat(iModel, "skin",                  	"1"); | ||||||
| 	DispatchSpawn(iTrigger); | 	SpawnAndActivate(iModel); | ||||||
| 	ActivateEntity(iTrigger); | 	ParentToEntity(iModel, iKnife); | ||||||
| 	SetEntityModel(iTrigger, "models/vortigaunt_slave.mdl"); | 
 | ||||||
| 	float fMinbounds[3] = {-1.0, -1.0, -10.0}; | 	// trigger_once strip.
 | ||||||
| 	float fMaxbounds[3] = {1.0, 1.0, 10.0}; | 	int iTriggerStrip = CreateEntityAtOrigin("trigger_once", fOrigin); | ||||||
| 	SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", fMinbounds); | 	DispatchKeyFormat(iTriggerStrip, "targetname",          "item_human_dog_strip_%d", g_iCounter); | ||||||
| 	SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", fMaxbounds); | 	DispatchKeyFormat(iTriggerStrip, "filtername",          "item_filter_human"); | ||||||
| 	SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2); | 	DispatchKeyFormat(iTriggerStrip, "spawnflags",          "1"); | ||||||
| 	int enteffects = GetEntProp(iTrigger, Prop_Send, "m_fEffects"); | 	DispatchKeyFormat(iTriggerStrip, "startdisabled",       "1"); | ||||||
| 	enteffects |= 32; | 	DispatchKeyFormat(iTriggerStrip, "OnStartTouch",       	"item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1"); | ||||||
| 	SetEntProp(iTrigger, Prop_Send, "m_fEffects", enteffects); | 	SpawnAndActivate(iTriggerStrip); | ||||||
| 	SetVariantString("!activator"); | 	ParentToEntity(iTriggerStrip, iKnife); | ||||||
| 	AcceptEntityInput(iTrigger, "SetParent", iKnife); | 
 | ||||||
|  | 	// make the trigger work.
 | ||||||
|  | 	SetEntityBBox(iTriggerStrip, view_as<float>({-8.0, -8.0, -8.0}), view_as<float>({8.0, 8.0, 8.0})); | ||||||
|  | 	SetEntityProps(iTriggerStrip); | ||||||
| 
 | 
 | ||||||
| 	// Relay Trigger
 | 	// Relay Trigger
 | ||||||
| 	int iRelayTrigger = CreateEntityByName("logic_relay"); | 	int iRelayTrigger = CreateEntityAtOrigin("logic_relay", fOrigin); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_relay_trigger_%d", g_iCounter); | 	DispatchKeyFormat(iRelayTrigger, "targetname",        	"human_dog_relay_trigger_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iRelayTrigger, "targetname", sBuffer); | 	DispatchKeyFormat(iRelayTrigger, "spawnflags",          "0"); | ||||||
| 	DispatchKeyValue(iRelayTrigger, "spawnflags", "0"); | 	DispatchKeyFormat(iRelayTrigger, "OnTrigger",   		"human_dog_relay_trigger2_%d,Trigger,,0,4", g_iCounter); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_relay_trigger2_%d,Trigger,,0,4", g_iCounter); | 	SpawnAndActivate(iRelayTrigger); | ||||||
| 	DispatchKeyValue(iRelayTrigger, "OnTrigger", sBuffer); | 	ParentToEntity(iRelayTrigger, iKnife); | ||||||
| 	DispatchSpawn(iRelayTrigger); |  | ||||||
| 	ActivateEntity(iRelayTrigger); |  | ||||||
| 	SetVariantString("!activator"); |  | ||||||
| 	AcceptEntityInput(iRelayTrigger, "SetParent", iKnife); |  | ||||||
| 
 | 
 | ||||||
| 	// Relay Trigger2
 | 	// Relay Trigger2
 | ||||||
| 	int iRelayTrigger2 = CreateEntityByName("logic_relay"); | 	int iRelayTrigger2 = CreateEntityAtOrigin("logic_relay", fOrigin); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_relay_trigger2_%d", g_iCounter); | 	DispatchKeyFormat(iRelayTrigger2, "targetname",       	"human_dog_relay_trigger2_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iRelayTrigger2, "targetname", sBuffer); | 	DispatchKeyFormat(iRelayTrigger2, "spawnflags",        	"0"); | ||||||
| 	DispatchKeyValue(iRelayTrigger2, "spawnflags", "0"); | 	SpawnAndActivate(iRelayTrigger2); | ||||||
| 	DispatchSpawn(iRelayTrigger2); | 	ParentToEntity(iRelayTrigger2, iKnife); | ||||||
| 	ActivateEntity(iRelayTrigger2); | 
 | ||||||
| 	SetVariantString("!activator"); |  | ||||||
| 	AcceptEntityInput(iRelayTrigger2, "SetParent", iKnife); |  | ||||||
| 	HookSingleEntityOutput(iRelayTrigger2, "OnTrigger", HumanDogUse, false); | 	HookSingleEntityOutput(iRelayTrigger2, "OnTrigger", HumanDogUse, false); | ||||||
| 
 | 
 | ||||||
| 	// Game UI
 | 
 | ||||||
| 	int iUI = CreateEntityByName("game_ui"); | 	// game_ui.
 | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_ui_%d", g_iCounter); | 	int iControls = CreateEntityAtOrigin("game_ui", fOrigin); | ||||||
| 	DispatchKeyValue(iUI, "targetname", sBuffer); | 	DispatchKeyFormat(iControls, "targetname",              "item_human_dog_controls_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iUI, "spawnflags", "0"); | 	DispatchKeyFormat(iControls, "spawnflags",              "0"); | ||||||
| 	DispatchKeyValue(iUI, "FieldOfView", "-1.0"); | 	DispatchKeyFormat(iControls, "fieldofview",             "-1.0"); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_relay_trigger_%d,Trigger,,0,-1", g_iCounter); | 	DispatchKeyFormat(iControls, "PressedAttack2",          "human_dog_relay_trigger_%d,Trigger,,0,-1", g_iCounter); | ||||||
| 	DispatchKeyValue(iUI, "PressedAttack2", sBuffer); | 	SpawnAndActivate(iControls); | ||||||
| 	DispatchSpawn(iUI); | 	ParentToEntity(iControls, iKnife); | ||||||
| 	ActivateEntity(iUI); |  | ||||||
| 	SetVariantString("!activator"); |  | ||||||
| 	AcceptEntityInput(iUI, "SetParent", iKnife); |  | ||||||
| 
 | 
 | ||||||
| 	// enable pickup trigger
 | 	// enable pickup trigger
 | ||||||
| 	SetVariantString("!activator"); | 	AcceptEntityInput(iTriggerStrip, "Enable"); | ||||||
| 	AcceptEntityInput(iTrigger, "Enable"); |  | ||||||
| 
 | 
 | ||||||
| 	g_iCounter++; | 	g_iCounter++; | ||||||
| } | } | ||||||
| @ -153,10 +130,7 @@ public void SpawnHumanDog(float fOrigin[3]) | |||||||
| //----------------------------------------------------------------------------------------------------
 | //----------------------------------------------------------------------------------------------------
 | ||||||
| public void HumanDogPickup(const char[] output, int caller, int activator, float delay) | public void HumanDogPickup(const char[] output, int caller, int activator, float delay) | ||||||
| { | { | ||||||
| 	char sBuffer[128]; | 	ServerCommand("say ** %N has picked up Human Dog **", activator); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "say ** %N has picked up Human Dog **", activator); |  | ||||||
| 	SetVariantString(sBuffer); |  | ||||||
| 	AcceptEntityInput(g_iConsole, "Command"); |  | ||||||
| 	PrintToChat(activator, " RIGHT CLICK with your KNIFE to leave a present for the Zombies (max 4)"); | 	PrintToChat(activator, " RIGHT CLICK with your KNIFE to leave a present for the Zombies (max 4)"); | ||||||
| 	CreateTimer(2.0, EquipWeapons, GetClientUserId(activator), TIMER_FLAG_NO_MAPCHANGE); | 	CreateTimer(2.0, EquipWeapons, GetClientUserId(activator), TIMER_FLAG_NO_MAPCHANGE); | ||||||
| } | } | ||||||
| @ -166,7 +140,6 @@ public void HumanDogPickup(const char[] output, int caller, int activator, float | |||||||
| //----------------------------------------------------------------------------------------------------
 | //----------------------------------------------------------------------------------------------------
 | ||||||
| public void HumanDogUse(const char[] output, int caller, int activator, float delay) | public void HumanDogUse(const char[] output, int caller, int activator, float delay) | ||||||
| { | { | ||||||
| 	char sBuffer[256]; |  | ||||||
| 	float fOrigin[3]; | 	float fOrigin[3]; | ||||||
| 	float fAngles[3]; | 	float fAngles[3]; | ||||||
| 	GetClientEyeAngles(activator, fAngles); | 	GetClientEyeAngles(activator, fAngles); | ||||||
| @ -177,122 +150,71 @@ public void HumanDogUse(const char[] output, int caller, int activator, float de | |||||||
| 	fOrigin[1] = fOrigin[1] + Sine(DegToRad(fAngles[1])) * -50.0; | 	fOrigin[1] = fOrigin[1] + Sine(DegToRad(fAngles[1])) * -50.0; | ||||||
| 	fOrigin[2] = fOrigin[2] - 62.00; | 	fOrigin[2] = fOrigin[2] - 62.00; | ||||||
| 
 | 
 | ||||||
| 	// Prop
 | 	// prop_dynamic model.
 | ||||||
| 	int iProp = CreateEntityByName("prop_dynamic"); | 	int iModel = CreateEntityAtOrigin("prop_dynamic", fOrigin); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_poo_%d", g_iCounter); | 	DispatchKeyFormat(iModel, "targetname",             "human_dog_poo_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iProp, "targetname", sBuffer); | 	DispatchKeyFormat(iModel, "model",                  "models/poo/curlygpoo.mdl"); | ||||||
| 	DispatchKeyValue(iProp, "model", "models/poo/curlygpoo.mdl"); | 	DispatchKeyFormat(iModel, "spawnflags",             "0"); | ||||||
| 	DispatchKeyValue(iProp, "spawnflags", "0"); | 	DispatchKeyFormat(iModel, "PerformanceMode",       	"0"); | ||||||
| 	DispatchKeyValue(iProp, "PerformanceMode", "0"); | 	DispatchKeyFormat(iModel, "solid",             		"0"); | ||||||
| 	DispatchKeyValue(iProp, "solid", "0"); | 	SpawnAndActivate(iModel); | ||||||
| 	DispatchKeyValueVector(iProp, "origin", fOrigin); |  | ||||||
| 	DispatchSpawn(iProp); |  | ||||||
| 	ActivateEntity(iProp); |  | ||||||
| 
 | 
 | ||||||
| 	// trigger
 | 	// trigger the explosion.
 | ||||||
| 	int iTrigger = CreateEntityByName("trigger_once"); | 	int iTriggerExplosion = CreateEntityAtOrigin("trigger_once", fOrigin); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_poo_trigger_%d", g_iCounter); | 	DispatchKeyFormat(iTriggerExplosion, "targetname",          "human_dog_poo_trigger_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iTrigger, "targetname", sBuffer); | 	DispatchKeyFormat(iTriggerExplosion, "filtername",          "item_filter_zombie"); | ||||||
| 	DispatchKeyValue(iTrigger, "spawnflags", "1"); | 	DispatchKeyFormat(iTriggerExplosion, "spawnflags",          "1"); | ||||||
| 	DispatchKeyValue(iTrigger, "startdisabled", "0"); | 	DispatchKeyFormat(iTriggerExplosion, "startdisabled",       "0"); | ||||||
| 	DispatchKeyValue(iTrigger, "filtername", "item_spawn_zombie_filter"); | 	DispatchKeyFormat(iTriggerExplosion, "OnStartTouch",       	"human_dog_poo_%d,Kill,,1,1", g_iCounter); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_poo_%d,Kill,,1,1", g_iCounter); | 	DispatchKeyFormat(iTriggerExplosion, "OnStartTouch",       	"human_dog_poo_hurt_%d,Enable,,0,1", g_iCounter); | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", sBuffer); | 	DispatchKeyFormat(iTriggerExplosion, "OnStartTouch",       	"human_dog_poo_hurt_%d,Disable,,0.25,1", g_iCounter); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_poo_hurt_%d,Enable,,0,1", g_iCounter); | 	DispatchKeyFormat(iTriggerExplosion, "OnStartTouch",       	"human_dog_particles_%d,Start,,0,-1", g_iCounter); | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", sBuffer); | 	DispatchKeyFormat(iTriggerExplosion, "OnStartTouch",      	"human_dog_particles_%d,Kill,,1,-1", g_iCounter); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_poo_hurt_%d,Disable,,0.25,1", g_iCounter); | 	DispatchKeyFormat(iTriggerExplosion, "OnStartTouch",      	"human_dog_sound_%d,PlaySound,,0,-1", g_iCounter); | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", sBuffer); | 	SpawnAndActivate(iTriggerExplosion); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_particles_%d,Start,,0,-1", g_iCounter); | 	ParentToEntity(iTriggerExplosion, iModel); | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", sBuffer); |  | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_particles_%d,Kill,,1,-1", g_iCounter); |  | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", sBuffer); |  | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_sound_%d,PlaySound,,0,-1", g_iCounter); |  | ||||||
| 	DispatchKeyValue(iTrigger, "OnStartTouch", sBuffer); |  | ||||||
| 	DispatchKeyValueVector(iTrigger, "origin", fOrigin); |  | ||||||
| 	DispatchSpawn(iTrigger); |  | ||||||
| 	ActivateEntity(iTrigger); |  | ||||||
| 	SetEntityModel(iTrigger, "models/vortigaunt_slave.mdl"); |  | ||||||
| 	float fMinbounds[3] = {-12.0, -12.0, -7.5}; |  | ||||||
| 	float fMaxbounds[3] = {12.0, 12.0, 7.5}; |  | ||||||
| 	SetEntPropVector(iTrigger, Prop_Send, "m_vecMins", fMinbounds); |  | ||||||
| 	SetEntPropVector(iTrigger, Prop_Send, "m_vecMaxs", fMaxbounds); |  | ||||||
| 	SetEntProp(iTrigger, Prop_Send, "m_nSolidType", 2); |  | ||||||
| 	int enteffects = GetEntProp(iTrigger, Prop_Send, "m_fEffects"); |  | ||||||
| 	enteffects |= 32; |  | ||||||
| 	SetEntProp(iTrigger, Prop_Send, "m_fEffects", enteffects); |  | ||||||
| 	SetVariantString("!activator"); |  | ||||||
| 	AcceptEntityInput(iTrigger, "SetParent", iProp); |  | ||||||
| 
 | 
 | ||||||
| 	// poo hurt
 | 	// make the trigger work.
 | ||||||
| 	int iHurt = CreateEntityByName("trigger_hurt"); | 	SetEntityBBox(iTriggerExplosion, view_as<float>({-12.0, -12.0, -7.5}), view_as<float>({12.0, 12.0, 7.5})); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_poo_hurt_%d", g_iCounter); | 	SetEntityProps(iTriggerExplosion); | ||||||
| 	DispatchKeyValue(iHurt, "targetname", sBuffer); |  | ||||||
| 	DispatchKeyValue(iHurt, "spawnflags", "1"); |  | ||||||
| 	DispatchKeyValue(iHurt, "startdisabled", "1"); |  | ||||||
| 	DispatchKeyValue(iHurt, "filtername", "item_spawn_zombie_filter"); |  | ||||||
| 	DispatchKeyValue(iHurt, "damagetype", "0"); |  | ||||||
| 	DispatchKeyValue(iHurt, "damagemodel", "0"); |  | ||||||
| 	DispatchKeyValue(iHurt, "damagecap", "20"); |  | ||||||
| 	DispatchKeyValue(iHurt, "damage", "8000"); |  | ||||||
| 	DispatchKeyValueVector(iHurt, "origin", fOrigin); |  | ||||||
| 	DispatchSpawn(iHurt); |  | ||||||
| 	ActivateEntity(iHurt); |  | ||||||
| 	SetEntityModel(iHurt, "models/vortigaunt_slave.mdl"); |  | ||||||
| 	float fMinbounds2[3] = {-96.0, -112.0, -142.0}; |  | ||||||
| 	float fMaxbounds2[3] = {96.0, 112.0, 142.0}; |  | ||||||
| 	SetEntPropVector(iHurt, Prop_Send, "m_vecMins", fMinbounds2); |  | ||||||
| 	SetEntPropVector(iHurt, Prop_Send, "m_vecMaxs", fMaxbounds2); |  | ||||||
| 	SetEntProp(iHurt, Prop_Send, "m_nSolidType", 3); |  | ||||||
| 	int enteffects2 = GetEntProp(iHurt, Prop_Send, "m_fEffects"); |  | ||||||
| 	enteffects2 |= 32; |  | ||||||
| 	SetEntProp(iHurt, Prop_Send, "m_fEffects", enteffects2); |  | ||||||
| 	SetVariantString("!activator"); |  | ||||||
| 	AcceptEntityInput(iHurt, "SetParent", iProp); |  | ||||||
| 
 | 
 | ||||||
| 	// Particles
 | 	// trigger poo damage.
 | ||||||
| 	int iParticles = CreateEntityByName("info_particle_system"); | 	int iTriggerExplosionDamage = CreateEntityAtOrigin("trigger_hurt", fOrigin); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_particles_%d", g_iCounter); | 	DispatchKeyFormat(iTriggerExplosionDamage, "targetname",        "human_dog_poo_hurt_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iParticles, "targetname", sBuffer); | 	DispatchKeyFormat(iTriggerExplosionDamage, "filtername",        "item_filter_zombie"); | ||||||
| 	DispatchKeyValue(iParticles, "effect_name", "fire_small_01"); | 	DispatchKeyFormat(iTriggerExplosionDamage, "spawnflags",        "1"); | ||||||
| 	DispatchKeyValue(iParticles, "start_active", "0"); | 	DispatchKeyFormat(iTriggerExplosionDamage, "startdisabled",     "1"); | ||||||
| 	DispatchKeyValueVector(iParticles, "origin", fOrigin); | 	DispatchKeyFormat(iTriggerExplosionDamage, "damagetype",       	"0"); | ||||||
| 	DispatchSpawn(iParticles); | 	DispatchKeyFormat(iTriggerExplosionDamage, "damagemodel",       "0"); | ||||||
| 	ActivateEntity(iParticles); | 	DispatchKeyFormat(iTriggerExplosionDamage, "damagecap",       	"20"); | ||||||
| 	SetVariantString("!activator"); | 	DispatchKeyFormat(iTriggerExplosionDamage, "damage",       		"8000"); | ||||||
| 	AcceptEntityInput(iParticles, "SetParent", iProp); | 	SpawnAndActivate(iTriggerExplosionDamage); | ||||||
|  | 	ParentToEntity(iTriggerExplosionDamage, iModel); | ||||||
| 
 | 
 | ||||||
| 	// Sound
 | 	// make the trigger work.
 | ||||||
| 	int iSound = CreateEntityByName("ambient_generic"); | 	SetEntityBBox(iTriggerExplosionDamage, view_as<float>({-96.0, -112.0, -142.0}), view_as<float>({96.0, 112.0, 142.0})); | ||||||
| 	Format(sBuffer, sizeof(sBuffer), "human_dog_sound_%d", g_iCounter); | 	SetEntityProps(iTriggerExplosionDamage); | ||||||
| 	DispatchKeyValue(iSound, "targetname", sBuffer); | 
 | ||||||
| 	DispatchKeyValue(iSound, "spawnflags", "49"); | 	// particles.
 | ||||||
| 	DispatchKeyValue(iSound, "radius", "1250"); | 	int iParticles = CreateEntityAtOrigin("info_particle_system", fOrigin); | ||||||
| 	DispatchKeyValue(iSound, "message", "ambient/explosions/explode_9.wav"); | 	DispatchKeyFormat(iParticles, "targetname",			"human_dog_particles_%d", g_iCounter); | ||||||
| 	DispatchKeyValue(iSound, "volume", "10"); | 	DispatchKeyFormat(iParticles, "effect_name",       	"fire_small_01"); | ||||||
| 	DispatchKeyValue(iSound, "health", "10"); | 	DispatchKeyFormat(iParticles, "start_active",      	"0"); | ||||||
| 	DispatchKeyValue(iSound, "pitch", "100"); | 	SpawnAndActivate(iParticles); | ||||||
| 	DispatchKeyValue(iSound, "pitchstart", "100"); | 	ParentToEntity(iParticles, iModel); | ||||||
| 	DispatchKeyValueVector(iSound, "origin", fOrigin); | 
 | ||||||
| 	DispatchSpawn(iSound); | 	// sound.
 | ||||||
| 	ActivateEntity(iSound); | 	int iSound = CreateEntityAtOrigin("ambient_generic", fOrigin); | ||||||
| 	SetVariantString("!activator"); | 	DispatchKeyFormat(iSound, "targetname",		"human_dog_sound_%d", g_iCounter); | ||||||
| 	AcceptEntityInput(iSound, "SetParent", iProp); | 	DispatchKeyFormat(iSound, "spawnflags",     "49"); | ||||||
|  | 	DispatchKeyFormat(iSound, "radius",      	"1250"); | ||||||
|  | 	DispatchKeyFormat(iSound, "message",      	"ambient/explosions/explode_9.wav"); | ||||||
|  | 	DispatchKeyFormat(iSound, "volume",      	"10"); | ||||||
|  | 	DispatchKeyFormat(iSound, "health",      	"10"); | ||||||
|  | 	DispatchKeyFormat(iSound, "pitch",      	"100"); | ||||||
|  | 	DispatchKeyFormat(iSound, "pitchstart",     "100"); | ||||||
|  | 	SpawnAndActivate(iSound); | ||||||
|  | 	ParentToEntity(iSound, iModel); | ||||||
| 
 | 
 | ||||||
| 	g_iCounter ++; | 	g_iCounter ++; | ||||||
| } | } | ||||||
| 
 |  | ||||||
| //----------------------------------------------------------------------------------------------------
 |  | ||||||
| // Purpose:
 |  | ||||||
| //----------------------------------------------------------------------------------------------------
 |  | ||||||
| public Action EquipWeapons(Handle timer, any userid) |  | ||||||
| { |  | ||||||
| 	int client = GetClientOfUserId(userid); |  | ||||||
| 
 |  | ||||||
| 	if (client != 0) |  | ||||||
| 	{ |  | ||||||
| 		GivePlayerItem(client, "weapon_p90"); |  | ||||||
| 		GivePlayerItem(client, "weapon_elite"); |  | ||||||
| 		GivePlayerItem(client, "item_kevlar"); |  | ||||||
| 		GivePlayerItem(client, "weapon_hegrenade"); |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
| @ -575,8 +575,8 @@ public void SpawnWhiteKnight(float fOrigin[3]) | |||||||
| public void WhiteKnightPickup(const char[] output, int caller, int activator, float delay) | public void WhiteKnightPickup(const char[] output, int caller, int activator, float delay) | ||||||
| { | { | ||||||
| 	ServerCommand("say ** %N has picked up the White Knight **", activator); | 	ServerCommand("say ** %N has picked up the White Knight **", activator); | ||||||
| 
 |  | ||||||
| 	PrintToChat(activator, " LEFT CLICK = ATTACK and RIGHT CLICK = SHIELD.");	 | 	PrintToChat(activator, " LEFT CLICK = ATTACK and RIGHT CLICK = SHIELD.");	 | ||||||
|  | 	CreateTimer(2.0, EquipWeapons, GetClientUserId(activator), TIMER_FLAG_NO_MAPCHANGE); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //----------------------------------------------------------------------------------------------------
 | //----------------------------------------------------------------------------------------------------
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 neon
						neon