Eduard Maier
Участник
- Сообщения
- 1
- Реакции
- 0
skype ; edemaier1 500p. za odin Plugin rate enforce shtob
#include <sdktools>
#include <sdkhooks>
#define EFFECT_MODEL "sprites/redglow1.vmt"
public OnMapStart()
{
PrecacheModel(EFFECT_MODEL);
}
public OnEntityCreated(iEntity, const String:sClassName[])
{
if ( StrEqual(sClassName, "weapon_m4a1") )
{
new iGlowEntity = CreateEntityByName("env_glow");
DispatchKeyValue(iGlowEntity, "model", EFFECT_MODEL);
DispatchKeyValue(iGlowEntity, "rendermode", "3"); // свечение
DispatchKeyValue(iGlowEntity, "scale", "1.0"); // размер свечения
DispatchKeyValue(iGlowEntity, "renderamt", "255"); // прозрачность
DispatchKeyValue(iGlowEntity, "rendercolor", "255 0 0"); // цвет
if ( DispatchSpawn(iGlowEntity) )
{
decl String:sTargetName[32], Float:fOrigin[3];
Format(sTargetName, sizeof(sTargetName) - 1, "weapon_m4a1_%d", iGlowEntity);
DispatchKeyValue(iEntity, "targetname", sTargetName);
GetEntPropVector(iEntity, Prop_Data, "m_vecOrigin", fOrigin);
SetVariantString(sTargetName);
AcceptEntityInput(iGlowEntity, "SetParent");
TeleportEntity(iGlowEntity, fOrigin, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(iGlowEntity, "ShowSprite");
AcceptEntityInput(iGlowEntity, "TurnOn");
}
}
}
#include <sdktools>
#include <sdkhooks>
#define EFFECT_MODEL "sprites/redglow1.vmt"
public OnPluginStart()
{
HookEvent("round_start", Event_Round_Start);
}
public Event_Round_Start(Handle:event, const String:name[], bool:dontBroadcast)
{
PrecacheModel(EFFECT_MODEL);
}
public OnEntityCreated(iEntity, const String:sClassName[])
{
if ( StrEqual(sClassName, "weapon_m4a1") )
{
new iGlowEntity = CreateEntityByName("env_glow");
DispatchKeyValue(iGlowEntity, "model", EFFECT_MODEL);
DispatchKeyValue(iGlowEntity, "rendermode", "3"); // свечение
DispatchKeyValue(iGlowEntity, "scale", "1.0"); // размер свечения
DispatchKeyValue(iGlowEntity, "renderamt", "255"); // прозрачность
DispatchKeyValue(iGlowEntity, "rendercolor", "255 0 0"); // цвет
if ( DispatchSpawn(iGlowEntity) )
{
decl String:sTargetName[32], Float:fOrigin[3];
Format(sTargetName, sizeof(sTargetName) - 1, "weapon_m4a1_%d", iGlowEntity);
DispatchKeyValue(iEntity, "targetname", sTargetName);
GetEntPropVector(iEntity, Prop_Data, "m_vecOrigin", fOrigin);
SetVariantString(sTargetName);
AcceptEntityInput(iGlowEntity, "SetParent");
TeleportEntity(iGlowEntity, fOrigin, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(iGlowEntity, "ShowSprite");
AcceptEntityInput(iGlowEntity, "TurnOn");
}
}
}