Просьба подсказать. Аптечки создаются, но не подбираются. Что делать?
Код
//Ставим аптечки
public SetMedkit(client)
{
decl Float:Pos[3];
GetLookPos(comrad, Pos);
new index = CreateEntityByName("prop_physics_override");
SetEntProp(index, Prop_Data, "m_CollisionGroup", 11);
SetEntProp(index, Prop_Send, "m_nSolidType", 6);
SetEntityModel(index, "models/items/healthkit.mdl")
DispatchKeyValueVector(index, "origin", Pos);
DispatchKeyValue(index, "solid", "0");
HookSingleEntityOutput(index, "OnBreak", EntityOutput:OnBreak_Func, true);
DispatchSpawn(index);
}
GetLookPos(client, Float:Pos[3])
{
decl Float:EyePosition[3], Float:EyeAngles[3], Handle:h_trace;
GetClientEyePosition(client, EyePosition);
GetClientEyeAngles(client, EyeAngles);
h_trace = TR_TraceRayFilterEx(EyePosition, EyeAngles, MASK_SOLID, RayType_Infinite, GetLookPos_Filter, client);
TR_GetEndPosition(Pos, h_trace);
CloseHandle(h_trace);
}
public bool:GetLookPos_Filter(ent, mask, any:i)
{
return i != ent;
}
public OnBreak_Func(const String:output[], caller, activator, Float:delay)
{
if (activator > 0 && a <= MaxClients && GetClientTeam(a) == 3)
{
if(IsClientInGame(a) && IsPlayerAlive(a) && GetClientHealth(a) < 100)
{
PrintToChatAll("\x04[Jail] Игрок \x05%N \x04вылечен", a);
SetEntProp(a, Prop_Send, "m_iHealth", 100);
}
else if (IsClientInGame(a) && IsPlayerAlive(a) && GetClientHealth(a) >= 100)
{
PrintToChatAll("\x04[Jail] Игрок \x05%N \x04взял аптечку будучи здоров", a);
}
}
}