_ssvvaauuggrr_さんが投稿したコード一覧

C bethevagineer.sp

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2>
#include <tf2_stocks>

#define PLUGIN_VERSION "1.1.0"

public Plugin:myinfo =
{
	name = "Be the Vagineer",
	author = "svaugrasn",
	description = "HAMALUM",
	version = PLUGIN_VERSION,
	url = ""
}

new bool:isVagineer[MAXPLAYERS + 1] = { false, ... };
new String:voicemenu1[4];
new String:voicemenu2[4];

public OnPluginStart()
{
	RegConsoleCmd("vagineer", BetheVagineer);
	RegConsoleCmd("voicemenu", Command_Voicemenu);
	AddNormalSoundHook(HookSound);
}

public OnMapStart()
{
	AddFileToDownloadsTable("models/player/saxton_hale/vagineer_v134.dx80.vtx");
	AddFileToDownloadsTable("models/player/saxton_hale/vagineer_v134.dx90.vtx");
	AddFileToDownloadsTable("models/player/saxton_hale/vagineer_v134.mdl");
	AddFileToDownloadsTable("models/player/saxton_hale/vagineer_v134.sw.vtx");
	AddFileToDownloadsTable("models/player/saxton_hale/vagineer_v134.vvd");

	AddFileToDownloadsTable("sound/misc/vagineer/engineer_battlecry01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_battlecry03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_battlecry04.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_battlecry06.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_battlecry07.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_cheers02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_cheers07.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_go01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_goodjob01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_headleft01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_headright03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_helpme01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_helpme02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_helpme03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_incoming01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_incoming02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_incoming03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_jeers01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_jeers02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_jeers03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_laughlong01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_laughlong02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_medic01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_medic02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_medic03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_moveup01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_needdispenser01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_negativevocalization12.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_no01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_no02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_no03.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_paincrticialdeath01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_thanks01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_yes01.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_yes02.mp3");
	AddFileToDownloadsTable("sound/misc/vagineer/engineer_yes03.mp3");

	PrecacheSound("misc/vagineer/engineer_battlecry01.mp3");
	PrecacheSound("misc/vagineer/engineer_battlecry03.mp3");
	PrecacheSound("misc/vagineer/engineer_battlecry04.mp3");
	PrecacheSound("misc/vagineer/engineer_battlecry06.mp3");
	PrecacheSound("misc/vagineer/engineer_battlecry07.mp3");
	PrecacheSound("misc/vagineer/engineer_cheers02.mp3");
	PrecacheSound("misc/vagineer/engineer_cheers07.mp3");
	PrecacheSound("misc/vagineer/engineer_go01.mp3");
	PrecacheSound("misc/vagineer/engineer_goodjob01.mp3");
	PrecacheSound("misc/vagineer/engineer_headleft01.mp3");
	PrecacheSound("misc/vagineer/engineer_headright03.mp3");
	PrecacheSound("misc/vagineer/engineer_helpme01.mp3");
	PrecacheSound("misc/vagineer/engineer_helpme02.mp3");
	PrecacheSound("misc/vagineer/engineer_helpme03.mp3");
	PrecacheSound("misc/vagineer/engineer_incoming01.mp3");
	PrecacheSound("misc/vagineer/engineer_incoming02.mp3");
	PrecacheSound("misc/vagineer/engineer_incoming03.mp3");
	PrecacheSound("misc/vagineer/engineer_jeers01.mp3");
	PrecacheSound("misc/vagineer/engineer_jeers02.mp3");
	PrecacheSound("misc/vagineer/engineer_jeers03.mp3");
	PrecacheSound("misc/vagineer/engineer_laughlong01.mp3");
	PrecacheSound("misc/vagineer/engineer_laughlong02.mp3");
	PrecacheSound("misc/vagineer/engineer_medic01.mp3");
	PrecacheSound("misc/vagineer/engineer_medic02.mp3");
	PrecacheSound("misc/vagineer/engineer_medic03.mp3");
	PrecacheSound("misc/vagineer/engineer_moveup01.mp3");
	PrecacheSound("misc/vagineer/engineer_needdispenser01.mp3");
	PrecacheSound("misc/vagineer/engineer_negativevocalization12.mp3");
	PrecacheSound("misc/vagineer/engineer_no01.mp3");
	PrecacheSound("misc/vagineer/engineer_no02.mp3");
	PrecacheSound("misc/vagineer/engineer_no03.mp3");
	PrecacheSound("misc/vagineer/engineer_paincrticialdeath01.mp3");
	PrecacheSound("misc/vagineer/engineer_thanks01.mp3");
	PrecacheSound("misc/vagineer/engineer_yes01.mp3");
	PrecacheSound("misc/vagineer/engineer_yes02.mp3");
	PrecacheSound("misc/vagineer/engineer_yes03.mp3");

}

public Action:BetheVagineer(client, args)
{

	if (!isVagineer[client])
	{
		// SPAWN SOUND
		EmitSoundToAll("misc/vagineer/engineer_laughlong01.mp3");

		// SPAWN CHAT
		new String:name[MAX_NAME_LENGTH];
		GetClientName(client, name, sizeof(name));

		// SET MODEL
		new String:Mdl[PLATFORM_MAX_PATH];
		Format(Mdl, sizeof(Mdl), "models/player/saxton_hale/vagineer_v134.mdl", Mdl, Mdl);
		PrecacheModel(Mdl);
		SetVariantString(Mdl);
		AcceptEntityInput(client, "SetCustomModel");
		SetEntProp(client, Prop_Send, "m_bUseClassAnimations", 1);
		SetEntPropFloat(client, Prop_Send, "m_flModelScale", 1.00);

		isVagineer[client] = true;
	}

}

public Action:Command_Voicemenu(client, args)
{
	if(isVagineer[client])
	{

		new rint = GetRandomInt(0,2);
		GetCmdArg(1, voicemenu1, sizeof(voicemenu1));
		GetCmdArg(2, voicemenu2, sizeof(voicemenu2));

		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 0)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_medic01.mp3", client);
				}
				if(rint == 1){
				EmitSoundToAll("misc/vagineer/engineer_medic02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_medic03.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 1)
			{
				EmitSoundToAll("misc/vagineer/engineer_thanks01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 2)
			{
				EmitSoundToAll("misc/vagineer/engineer_go01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 3)
			{
				EmitSoundToAll("misc/vagineer/engineer_moveup01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 4)
			{
				EmitSoundToAll("misc/vagineer/engineer_headleft01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 5)
			{
				EmitSoundToAll("misc/vagineer/engineer_headright03.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 6)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_yes01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_yes02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_yes03.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 0)
		{
			if(StringToInt(voicemenu2) == 7)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_no01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_no02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_no03.mp3", client);
				}
			}
		}

		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 0)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_incoming01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_incoming02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_incoming03.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 1)
			{
				EmitSoundToAll("misc/vagineer/engineer_jeers01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 2)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_jeers02.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_battlecry01.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_battlecry04.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 3)
			{
				EmitSoundToAll("misc/vagineer/engineer_needdispenser01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 4)
			{
				EmitSoundToAll("misc/vagineer/engineer_needdispenser01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 5)
			{
				EmitSoundToAll("misc/vagineer/engineer_needdispenser01.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 6)
			{
				EmitSoundToAll("misc/vagineer/engineer_cheers02.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 1)
		{
			if(StringToInt(voicemenu2) == 7)
			{
				EmitSoundToAll("misc/vagineer/engineer_laughlong01.mp3", client);
			}
		}

		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 0)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_helpme01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_helpme02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_helpme03.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 1)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_battlecry01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_battlecry03.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_battlecry04.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 2)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_battlecry06.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_battlecry07.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_cheers02.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 3)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_jeers01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_jeers02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_jeers03.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 4)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_laughlong01.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_battlecry07.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_cheers02.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 5)
			{
				if(rint == 0){
					EmitSoundToAll("misc/vagineer/engineer_negativevocalization12.mp3", client);
				}
				if(rint == 1){
					EmitSoundToAll("misc/vagineer/engineer_jeers02.mp3", client);
				}
				if(rint == 2){
					EmitSoundToAll("misc/vagineer/engineer_jeers01.mp3", client);
				}
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 6)
			{
				EmitSoundToAll("misc/vagineer/engineer_cheers02.mp3", client);
			}
		}
		if(StringToInt(voicemenu1) == 2)
		{
			if(StringToInt(voicemenu2) == 7)
			{
				EmitSoundToAll("misc/vagineer/engineer_goodjob01.mp3", client);
			}
		}
	}
}

public Action:HookSound(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &ent, &channel, &Float:volume, &level, &pitch, &flags)
{
	if (ent < 1 || ent > MaxClients || channel < 1)
		return Plugin_Continue;

	if (isVagineer[ent])
	{
		volume = 0.0;
		return Plugin_Changed;
	}

	return Plugin_Continue;

}

public Action:event_class_change(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	isVagineer[client] = false;
}

public OnClientDisconnect(client)
{
	isVagineer[client] = false;
}

C airfortress.sp

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2>
#include <tf2_stocks>
#include <tf2items>
#include <steamtools>

#define PLUGIN_VERSION "1.0.0"

new g_flg = 0;

public Plugin:myinfo = {
    name = "Air Fortress",
    author = "svaugrasn",
    description = "",
    version = PLUGIN_VERSION,
};

public OnPluginStart() {
	HookEvent("player_death", OnPlayerDeath);
	HookEvent("teamplay_round_start", Event_teamplay_round_start);
	HookEvent("arena_win_panel", OnRoundEnd);

	SetConVarInt(FindConVar("mp_chattime"), 6, true);
	SetConVarInt(FindConVar("mp_bonusroundtime"), 7, true);
	SetConVarInt(FindConVar("mp_respawnwavetime"), 7, true);
	SetConVarInt(FindConVar("tf_arena_preround_time"), 7, true);

	SetConVarInt(FindConVar("tf_arena_use_queue"), 0, true);
	SetConVarInt(FindConVar("tf_arena_first_blood"), 0, true);
	SetConVarInt(FindConVar("mp_forceautoteam"), 0, true);
	SetConVarInt(FindConVar("mp_stalemate_enable"), 0, true);
	SetConVarInt(FindConVar("tf_weapon_criticals"), 0, true);
	SetConVarInt(FindConVar("tf_damage_disablespread"), 0, true);
	SetConVarInt(FindConVar("tf_use_fixed_weaponspreads"), 0, true);

	CreateTimer(5.0, ChangeDesc);

}

public OnMapStart()
{
	AddFileToDownloadsTable("sound/misc/aw/explode.mp3");
	AddFileToDownloadsTable("sound/misc/aw/warn.mp3");

	PrecacheSound("misc/aw/explode.mp3");
	PrecacheSound("misc/aw/warn.mp3");

}

public Action:ChangeDesc(Handle:timer)
{
	decl String:description[128];
	description = "Air Fortress";
	Steam_SetGameDescription(description);
}

public Action:Event_teamplay_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
	PrintToChatAll("Air Fortress v%s", PLUGIN_VERSION);

	for(new i = 1; i <= MaxClients; i++)
	{
		if(IsValidEdict(i) && IsClientConnected(i) && IsPlayerAlive(i))
		{
			if (TF2_GetPlayerClass(i) != TFClass_Soldier) TF2_SetPlayerClass(i, TFClass_Soldier);
			TF2_RemoveAllWeapons(i);
		}
	}

	g_flg = 0;

	CreateTimer(7.0, OnGameStart);

}

public Action:OnGameStart(Handle:timer, any:Ent)
{
	for(new i = 1; i <= MaxClients; i++)
	{

		if(IsValidEdict(i) && IsClientConnected(i) && IsPlayerAlive(i))
		{
			TF2_RemoveAllWeapons(i);
			if (TF2_GetPlayerClass(i) != TFClass_Soldier) TF2_SetPlayerClass(i, TFClass_Soldier);
			TF2_RemoveAllWeapons(i);

			SetEntProp(i, Prop_Data, "m_iMaxHealth", 600);
			SetEntityHealth(i, 600);

			new Handle:h_weapon_air = TF2Items_CreateItem(OVERRIDE_ALL);
			if (h_weapon_air != INVALID_HANDLE)
			{
				TF2Items_SetClassname(h_weapon_air, "tf_weapon_rocketlauncher");
				TF2Items_SetItemIndex(h_weapon_air, 513);

				new String:weaponAttribs[] = "138 ; 2.3 ; 4 ; 6 ; 6 ; 0.5 ; 26 ; 300 ; 58 ; 0.5 ; 96 ; 0.4 ; 99 ; 2.0 ; 103 ; 3.5 ; 150 ; 1";
				new String:weaponAttribsArray[32][32];
				new attribCount = ExplodeString(weaponAttribs, " ; ", weaponAttribsArray, 32, 32);
				if (attribCount > 0) {
					TF2Items_SetNumAttributes(h_weapon_air, attribCount/2);
					new j2 = 0;
					for (new j = 0; j < attribCount; j+=2) {
						TF2Items_SetAttribute(h_weapon_air, j2, StringToInt(weaponAttribsArray[j]), StringToFloat(weaponAttribsArray[j+1]));
						j2++;
					}
				} else {
					TF2Items_SetNumAttributes(h_weapon_air, 0);
				}

				TF2Items_SetLevel(h_weapon_air, 0);
				TF2Items_SetQuality(h_weapon_air, 0);
				new weapon_air = TF2Items_GiveNamedItem(i, h_weapon_air);
				EquipPlayerWeapon(i, weapon_air);
				CloseHandle(h_weapon_air);
			}

			new Handle:h_weapon_air2 = TF2Items_CreateItem(OVERRIDE_ALL);
			if (h_weapon_air2 != INVALID_HANDLE)
			{
				TF2Items_SetClassname(h_weapon_air2, "tf_weapon_raygun");
				TF2Items_SetItemIndex(h_weapon_air2, 442);

				new String:weaponAttribs2[] = "138 ; 0.2 ; 4 ; 40 ; 6 ; 0.02 ; 96 ; 0.00 ; 318 ; 15.00 ; 103 ; 10.0";
				new String:weaponAttribsArray2[32][32];
				new attribCount2 = ExplodeString(weaponAttribs2, " ; ", weaponAttribsArray2, 32, 32);
				if (attribCount2 > 0) {
					TF2Items_SetNumAttributes(h_weapon_air2, attribCount2/2);
					new j2 = 0;
					for (new j = 0; j < attribCount2; j+=2) {
						TF2Items_SetAttribute(h_weapon_air2, j2, StringToInt(weaponAttribsArray2[j]), StringToFloat(weaponAttribsArray2[j+1]));
						j2++;
					}
				} else {
					TF2Items_SetNumAttributes(h_weapon_air2, 0);
				}

				TF2Items_SetLevel(h_weapon_air2, 0);
				TF2Items_SetQuality(h_weapon_air2, 0);
				new weapon_air2 = TF2Items_GiveNamedItem(i, h_weapon_air2);
				EquipPlayerWeapon(i, weapon_air2);
				CloseHandle(h_weapon_air2);
			}

			SetEntPropFloat(i, Prop_Send, "m_flModelScale", 0.6);
			SetEntPropFloat(i, Prop_Send, "m_flStepSize", 9.0);

		}
	}
	g_flg = 1;

}

public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
	decl Float:vecAngles[3], Float:vecVelocity[3];
	GetClientEyeAngles(client, vecAngles);
	GetEntPropVector(client, Prop_Data, "m_vecVelocity", vecVelocity);

	if (buttons & IN_JUMP)
	{
		vecVelocity[2] = 220.0;
		TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
	}

	new clientflags = GetEntityFlags(client);

	if(!(clientflags & FL_ONGROUND))
	{

		if (buttons & IN_FORWARD)
		{
			vecAngles[0] = DegToRad(vecAngles[0]);
			vecAngles[1] = DegToRad(vecAngles[1]);
			vecVelocity[0] = 380 * Cosine(vecAngles[0]) * Cosine(vecAngles[1]);
			vecVelocity[1] = 380 * Cosine(vecAngles[0]) * Sine(vecAngles[1]);
			vecVelocity[2] -= 0.01;

			TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
		}
		if (buttons & IN_BACK)
		{
			vecAngles[0] = DegToRad(vecAngles[0]);
			vecAngles[1] = DegToRad(vecAngles[1]);
			vecVelocity[0] -= 0.1 * Cosine(vecAngles[0]) * Cosine(vecAngles[1]);
			vecVelocity[1] -= 0.1 * Cosine(vecAngles[0]) * Sine(vecAngles[1]);
			vecVelocity[2] -= 0.01;
			TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
		}

	}

	if(clientflags & FL_ONGROUND)
	{
		if(g_flg == 1){
			if(IsPlayerAlive(client)){
				SetHudTextParams(-1.0, 0.7, 5.0, 255, 0, 0, 20);
				ShowHudText(client, -1, ">> Low altitude warning <<");
				AttachParticle(client, "fluidSmokeExpl_ring_mvm");
				DoDamage(client, client, 25);

				vecVelocity[2] = 500.0;
				TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
				EmitSoundToAll("misc/aw/warn.mp3", client);
			}
		}
	}

	return Plugin_Continue;

}

public OnGameFrame()
{
	for(new i = 1; i <= MaxClients; i++)
	{
		if(IsValidEdict(i) && IsClientConnected(i) && IsPlayerAlive(i))
		{
			decl Float:vecVelocity[3];
			GetEntPropVector(i, Prop_Data, "m_vecVelocity", vecVelocity);
			if (-150.0 < vecVelocity[0] < 150.0 && -150.0 < vecVelocity[1] < 150.0)
			{
				if ((-180.0 < vecVelocity[0] < 180.0) || (-180.0 < vecVelocity[0] < 180.0)){
					vecVelocity[0] += vecVelocity[0] * 0.07;
					vecVelocity[1] += vecVelocity[1] * 0.07;
					vecVelocity[2] -= 0.1;
					TeleportEntity(i, NULL_VECTOR, NULL_VECTOR, vecVelocity);
				}
			}
		}
	}
}

stock DoDamage(client, target, amount)
{

	new pointHurt = CreateEntityByName("point_hurt");
	if (pointHurt)
	{
		DispatchKeyValue(target, "targetname", "explodeme");
		DispatchKeyValue(pointHurt, "DamageTarget", "explodeme");
		new String:dmg[15];
		Format(dmg, 15, "%i", amount);
		DispatchKeyValue(pointHurt, "Damage", dmg);
		DispatchKeyValue(pointHurt, "DamageType", "0");

		DispatchSpawn(pointHurt);
		AcceptEntityInput(pointHurt, "Hurt", client);
		DispatchKeyValue(pointHurt, "classname", "point_hurt");
		DispatchKeyValue(target, "targetname", "");
		RemoveEdict(pointHurt);
	}
}

public OnRoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
	g_flg = 0;
}

public Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{

	new client = GetClientOfUserId(GetEventInt(event, "userid"));

	AttachParticle(client, "fluidSmokeExpl_ring_mvm");
	EmitSoundToAll("misc/aw/explode.mp3", client);

}

stock bool:AttachParticle(Ent, String:particleType[], bool:cache=false)
{
	new particle = CreateEntityByName("info_particle_system");
	if (!IsValidEdict(particle)) return false;
	new String:tName[128];
	new Float:f_pos[3];
	if (cache) f_pos[2] -= 3000;
	else
	{
		GetEntPropVector(Ent, Prop_Send, "m_vecOrigin", f_pos);
		f_pos[2] += 60;
	}
	TeleportEntity(particle, f_pos, NULL_VECTOR, NULL_VECTOR);
	Format(tName, sizeof(tName), "target%i", Ent);
	DispatchKeyValue(Ent, "targetname", tName);
	DispatchKeyValue(particle, "effect_name", particleType);
	DispatchSpawn(particle);
	SetVariantString(tName);
	AcceptEntityInput(particle, "SetParent", particle, particle, 0);
	ActivateEntity(particle);
	AcceptEntityInput(particle, "start");
	CreateTimer(10.0, DeleteParticle, particle);
	return true;
}

public Action:DeleteParticle(Handle:timer, any:Ent)
{
	if (!IsValidEntity(Ent)) return;
	new String:cls[25];
	GetEdictClassname(Ent, cls, sizeof(cls));
	if (StrEqual(cls, "info_particle_system", false)) AcceptEntityInput(Ent, "Kill");
	return;
}

C kissme.sp

#pragma semicolon 1

#include <sourcemod>
#include <tf2>
#include <tf2_stocks>

#define PLUGIN_VERSION "1.0.0"

public Plugin:myinfo =
{
	name = "Kiss me.",
	author = "Kiss me.",
	description = "Kiss me.",
	version = PLUGIN_VERSION,
	url = ""
}

public OnPluginStart()
{
	AddNormalSoundHook(HookSound);
}

public OnMapStart()
{
	PrecacheSound("vo/heavy_generic01.wav");
}

public Action:HookSound(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &ent, &channel, &Float:volume, &level, &pitch, &flags)
{

	if (ent < 1 || ent > MaxClients || channel < 1)
		return Plugin_Continue;

	if (TF2_GetPlayerClass(ent) == TFClass_Heavy)
	{
		if(StrContains(sample, "vo/heavy_", false) != -1){
			Format(sample, PLATFORM_MAX_PATH, "vo/heavy_generic01.wav");
		}

		return Plugin_Changed;
	}

	return Plugin_Continue;

}

C スパム用コンフィグ

alias saysound1 "say sunzen; bind Q saysound2"
alias saysound2 "say sikomi; bind Q saysound1"
bind Q saysound1

alias saysound3 "say nemuttero; bind Q saysound4"
alias saysound42 "say hosii; bind Q saysound3"
bind KP_SLASH saysound3

bind "KP_MULTIPLY" "say hankou2"
bind "KP_MINUS" "say nigenja"
bind "KP_PLUS" "say erasouna"
bind "KP_ENTER" "say razor"

よく投稿されているコード

タグ

最近投稿されたコード