public Action ShowAxis(Handle timer, any client)
{
int ent = GetClientAimTarget(client, false);
if(ent > MaxClients && IsValidEntity(ent))
// if(ent > 0 && IsValidEntity(ent))
{
float origin[3], angles[3], min[3], max[3];
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", origin);
GetEntPropVector(ent, Prop_Data, "m_angRotation", angles);
GetEntPropVector(ent, Prop_Data, "m_vecMins", min);
GetEntPropVector(ent, Prop_Data, "m_vecMaxs", max);
Effect_DrawBeamBoxRotatable(client, origin, min, max, angles, g_BeamSprite, 0, 0, fTime, 1.0, 1.0, 1, 0.0, {255, 165, 0, 255}, 0);
if(iWorld[client] == 1) angles[0] = angles[1] = angles[2] = 0.0;
Effect_DrawAxisOfRotation(client, origin, angles, max, g_BeamSprite, 0, 0, fTime, 1.0, 1.0, 1, 0.0, 0);
char sBuffer[256], temp[64];
GetEdictClassname(ent, sBuffer, sizeof(sBuffer));
Format(sBuffer, sizeof(sBuffer), "%s (%i)", sBuffer, ent);
if(HasEntProp(ent, Prop_Data, "m_iName"))
{
GetEntPropString(ent, Prop_Data, "m_iName", temp, sizeof(temp));
if(strlen(temp) > 0) Format(sBuffer, sizeof(sBuffer), "%s%s'%s'", sBuffer, L4D2 ? " " : "\n", temp);
}
if(HasEntProp(ent, Prop_Data, "m_iHealth"))
{
int health = GetEntProp(ent, Prop_Data, "m_iHealth");
if(health >= 0) Format(sBuffer, sizeof(sBuffer), "%s (%iHP)\n", sBuffer, health);
}
if(HasEntProp(ent, Prop_Send, "m_nSolidType"))
{
Format(sBuffer, sizeof(sBuffer), "%sType: %i", sBuffer, GetEntProp(ent, Prop_Send, "m_nSolidType"));
}
if(HasEntProp(ent, Prop_Send, "m_CollisionGroup"))
{
Format(sBuffer, sizeof(sBuffer), "%s Group: %i", sBuffer, GetEntProp(ent, Prop_Send, "m_CollisionGroup"));
}
if(HasEntProp(ent, Prop_Send, "m_usSolidFlags"))
{
Format(sBuffer, sizeof(sBuffer), "%s Flags: %i", sBuffer, GetEntProp(ent, Prop_Send, "m_usSolidFlags"));
}
if(HasEntProp(ent, Prop_Data, "m_ModelName"))
{
GetEntPropString(ent, Prop_Data, "m_ModelName", temp, sizeof(temp));
Format(sBuffer, sizeof(sBuffer), "%s\n%s", sBuffer, temp);
}
if(L4D2) PrintHintText(client, sBuffer); // Панель внизу по центру (в L4D2 всего 3 строки)
else
{
Format(sBuffer, sizeof(sBuffer), "%s\nPos: %.2f %.2f %.2f", sBuffer, origin[0], origin[1], origin[2]);
SubtractVectors(max, min, max);
Format(sBuffer, sizeof(sBuffer), "%s\nSize: %.2f %.2f %.2f", sBuffer, max[0], max[1], max[2]);
Format(sBuffer, sizeof(sBuffer), "%s\nAngR: %.2f %.2f %.2f", sBuffer, angles[0], angles[1], angles[2]);
if(HasEntProp(ent, Prop_Data, "m_angRotationClosed"))
{
GetEntPropVector(ent, Prop_Data, "m_angRotationClosed", angles);
Format(sBuffer, sizeof(sBuffer), "%s\nAngC: %.2f %.2f %.2f", sBuffer, angles[0], angles[1], angles[2]);
}
Handle hBuffer = StartMessageOne("KeyHintText", client); // Панель справа
BfWriteByte(hBuffer, 1);
BfWriteString(hBuffer, sBuffer);
EndMessage();
}
}
return Plugin_Continue;
}