Плагин вх поменять значение

-=AWP=-

Участник
Сообщения
41
Реакции
26
Здравствуйте, помогите пожалуйста с плагином.
О плагине:
У всех игроков работает ВХ-РЕЖИМ при старте раунда, нужно сделать так чтобы вх работало у всех игроков только когда мертвый. Там наверное не сложно, значение поменять, помогите пожалуйста, буду вам очень благодарен.
 

Вложения

  • WS_wallhack.zip
    3.8 КБ · Просмотры: 29

BatyaMedic

Участник
Сообщения
766
Реакции
127
Обращайся к wS.Он же создатель плагина.
 

The End Is Near...

Russian Roulette
Сообщения
874
Реакции
691
Пробуй. По команде !wh
PHP:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin:myinfo = 
{
	name	= "WallHack",
	author	= "wS (world - source . ru)",
	version = "1.0"
};

new g_MySprite[MAXPLAYERS + 1];
new g_MySpriteRef[MAXPLAYERS + 1];

public OnPluginStart()
{
	HookEvent("player_spawn",	ClearEvent);
	HookEvent("player_team",	ClearEvent);

	RegConsoleCmd("wh", Callback);
}

public OnMapStart()
{
	AddFileToDownloadsTable("materials/sprites/player_blue_small2.vmt");
	AddFileToDownloadsTable("materials/sprites/player_blue_small2.vtf");
	AddFileToDownloadsTable("materials/sprites/player_red_small2.vmt");
	AddFileToDownloadsTable("materials/sprites/player_red_small2.vtf");

	PrecacheDecal("sprites/player_blue_small2.vmt",	true);
	PrecacheDecal("sprites/player_red_small2.vmt",	true);
}

public Action:Callback(client, args)
{
	if (client > 0)
	{
		if (!IsPlayerAlive(client))
		{			
			CreateTimer(0.1, player_spawn_Timer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
		}
	}

	return Plugin_Handled;
}

public ClearEvent(Handle:event, const String:name[], bool:silent)
{
	wS_ClearSprite(GetClientOfUserId(GetEventInt(event, "userid")));
}

public Action:player_spawn_Timer(Handle:timer, any:id)
{
	new client = GetClientOfUserId(id);
	if (client < 1)
		return Plugin_Stop;

	wS_ClearSprite(client);

	new ent = CreateEntityByName("env_sprite"); 
	if (ent < 1) 
	{
		LogError("env_sprite error");
		return Plugin_Stop;
	}

	g_MySprite[client] = ent;
	g_MySpriteRef[client] = EntIndexToEntRef(ent);

	decl Float:pos[3]; GetClientAbsOrigin(client, pos); pos[2] += 50.0;
	DispatchKeyValueVector(ent, "origin", pos);
	DispatchKeyValue(ent, "model", GetClientTeam(client) == 2 ? "sprites/player_red_small2.vmt" : "sprites/player_blue_small2.vmt"); 
	DispatchKeyValue(ent, "rendermode", "0"); 
	DispatchKeyValue(ent, "renderfx", "0"); 
	DispatchKeyValue(ent, "renderamt", "255");
	DispatchKeyValue(ent, "scale", "0.5"); 
	DispatchKeyValue(ent, "GlowProxySize", "61.0");
	DispatchSpawn(ent);

	SetVariantString("!activator");
	AcceptEntityInput(ent, "SetParent", client, ent);

	SDKHook(ent, SDKHook_SetTransmit, Hook_SetTransmit);

	return Plugin_Stop;
}

public Action:Hook_SetTransmit(entity, client)
{
	return entity == g_MySprite[client] ? Plugin_Handled : Plugin_Continue;
}

stock wS_ClearSprite(client)
{
	if (g_MySprite[client] > 0)
	{
		new ent = EntRefToEntIndex(g_MySpriteRef[client]);
		if (ent > 0) AcceptEntityInput(ent, "Kill");
		g_MySprite[client] = 0;
		g_MySpriteRef[client] = 0;
	}
}

public OnClientDisconnect(client)
{
	wS_ClearSprite(client);
}
 

-=AWP=-

Участник
Сообщения
41
Реакции
26
Пробуй. По команде !wh
PHP:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin:myinfo = 
{
	name	= "WallHack",
	author	= "wS (world - source . ru)",
	version = "1.0"
};

new g_MySprite[MAXPLAYERS + 1];
new g_MySpriteRef[MAXPLAYERS + 1];

public OnPluginStart()
{
	HookEvent("player_spawn",	ClearEvent);
	HookEvent("player_team",	ClearEvent);

	RegConsoleCmd("wh", Callback);
}

public OnMapStart()
{
	AddFileToDownloadsTable("materials/sprites/player_blue_small2.vmt");
	AddFileToDownloadsTable("materials/sprites/player_blue_small2.vtf");
	AddFileToDownloadsTable("materials/sprites/player_red_small2.vmt");
	AddFileToDownloadsTable("materials/sprites/player_red_small2.vtf");

	PrecacheDecal("sprites/player_blue_small2.vmt",	true);
	PrecacheDecal("sprites/player_red_small2.vmt",	true);
}

public Action:Callback(client, args)
{
	if (client > 0)
	{
		if (!IsPlayerAlive(client))
		{			
			CreateTimer(0.1, player_spawn_Timer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
		}
	}

	return Plugin_Handled;
}

public ClearEvent(Handle:event, const String:name[], bool:silent)
{
	wS_ClearSprite(GetClientOfUserId(GetEventInt(event, "userid")));
}

public Action:player_spawn_Timer(Handle:timer, any:id)
{
	new client = GetClientOfUserId(id);
	if (client < 1)
		return Plugin_Stop;

	wS_ClearSprite(client);

	new ent = CreateEntityByName("env_sprite"); 
	if (ent < 1) 
	{
		LogError("env_sprite error");
		return Plugin_Stop;
	}

	g_MySprite[client] = ent;
	g_MySpriteRef[client] = EntIndexToEntRef(ent);

	decl Float:pos[3]; GetClientAbsOrigin(client, pos); pos[2] += 50.0;
	DispatchKeyValueVector(ent, "origin", pos);
	DispatchKeyValue(ent, "model", GetClientTeam(client) == 2 ? "sprites/player_red_small2.vmt" : "sprites/player_blue_small2.vmt"); 
	DispatchKeyValue(ent, "rendermode", "0"); 
	DispatchKeyValue(ent, "renderfx", "0"); 
	DispatchKeyValue(ent, "renderamt", "255");
	DispatchKeyValue(ent, "scale", "0.5"); 
	DispatchKeyValue(ent, "GlowProxySize", "61.0");
	DispatchSpawn(ent);

	SetVariantString("!activator");
	AcceptEntityInput(ent, "SetParent", client, ent);

	SDKHook(ent, SDKHook_SetTransmit, Hook_SetTransmit);

	return Plugin_Stop;
}

public Action:Hook_SetTransmit(entity, client)
{
	return entity == g_MySprite[client] ? Plugin_Handled : Plugin_Continue;
}

stock wS_ClearSprite(client)
{
	if (g_MySprite[client] > 0)
	{
		new ent = EntRefToEntIndex(g_MySpriteRef[client]);
		if (ent > 0) AcceptEntityInput(ent, "Kill");
		g_MySprite[client] = 0;
		g_MySpriteRef[client] = 0;
	}
}

public OnClientDisconnect(client)
{
	wS_ClearSprite(client);
}

плагин без команд, просто вх щас работает у всех хотелось бы сделать чтобы когда только умер работало.

Добавлено через 1 минуту
Помогите ребят, если не сложно. Буду благодарен..
 
Последнее редактирование:

The End Is Near...

Russian Roulette
Сообщения
874
Реакции
691
тогда так пробуй
PHP:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin:myinfo = 
{
	name	= "WallHack",
	author	= "wS (♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥)",
	version = "1.0"
};

new g_MySprite[MAXPLAYERS + 1];
new g_MySpriteRef[MAXPLAYERS + 1];

public OnPluginStart()
{
	HookEvent("player_spawn",	ClearEvent);
	HookEvent("player_death", player_death);
}

public OnMapStart()
{
	AddFileToDownloadsTable("materials/sprites/player_blue_small2.vmt");
	AddFileToDownloadsTable("materials/sprites/player_blue_small2.vtf");
	AddFileToDownloadsTable("materials/sprites/player_red_small2.vmt");
	AddFileToDownloadsTable("materials/sprites/player_red_small2.vtf");

	PrecacheDecal("sprites/player_blue_small2.vmt",	true);
	PrecacheDecal("sprites/player_red_small2.vmt",	true);
}

public player_death(Handle:event, const String:name[], bool:silent)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if (client > 0)
	{
		CreateTimer(0.1, player_spawn_Timer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
	}
}

public ClearEvent(Handle:event, const String:name[], bool:silent)
{
	wS_ClearSprite(GetClientOfUserId(GetEventInt(event, "userid")));
}

public Action:player_spawn_Timer(Handle:timer, any:id)
{
	new client = GetClientOfUserId(id);
	if (client < 1)
		return Plugin_Stop;

	wS_ClearSprite(client);

	new ent = CreateEntityByName("env_sprite"); 
	if (ent < 1) 
	{
		LogError("env_sprite error");
		return Plugin_Stop;
	}

	g_MySprite[client] = ent;
	g_MySpriteRef[client] = EntIndexToEntRef(ent);

	decl Float:pos[3]; GetClientAbsOrigin(client, pos); pos[2] += 50.0;
	DispatchKeyValueVector(ent, "origin", pos);
	DispatchKeyValue(ent, "model", GetClientTeam(client) == 2 ? "sprites/player_red_small2.vmt" : "sprites/player_blue_small2.vmt"); 
	DispatchKeyValue(ent, "rendermode", "0"); 
	DispatchKeyValue(ent, "renderfx", "0"); 
	DispatchKeyValue(ent, "renderamt", "255");
	DispatchKeyValue(ent, "scale", "0.5"); 
	DispatchKeyValue(ent, "GlowProxySize", "61.0");
	DispatchSpawn(ent);

	SetVariantString("!activator");
	AcceptEntityInput(ent, "SetParent", client, ent);

	SDKHook(ent, SDKHook_SetTransmit, Hook_SetTransmit);

	return Plugin_Stop;
}

public Action:Hook_SetTransmit(entity, client)
{
	return entity == g_MySprite[client] ? Plugin_Handled : Plugin_Continue;
}

stock wS_ClearSprite(client)
{
	if (g_MySprite[client] > 0)
	{
		new ent = EntRefToEntIndex(g_MySpriteRef[client]);
		if (ent > 0) AcceptEntityInput(ent, "Kill");
		g_MySprite[client] = 0;
		g_MySpriteRef[client] = 0;
	}
}

public OnClientDisconnect(client)
{
	wS_ClearSprite(client);
}
 

-=AWP=-

Участник
Сообщения
41
Реакции
26
Привет The End Is Near., я ценю твой труд, но ты сделал так: когда в спектрах, или же мертв не чего нет, как игрока убивают над ним появляется вх и залипает на одном месте. Подправь немного, на скриншоте посмотри.
 

Вложения

  • Новый точечный рисунок.jpg
    Новый точечный рисунок.jpg
    89.4 КБ · Просмотры: 63
  • 1.jpg
    1.jpg
    89.9 КБ · Просмотры: 52
Сверху Снизу