I completely forgot to post the wallhang script:
PHP Code:
public OnGameFrame()
{
//Declare:
decl MaxPlayers;
//Initialize:
MaxPlayers = GetMaxClients();
//Loop:
for(new X = 1; X < MaxPlayers; X++)
{
//Connected:
if(IsClientInGame(X) && GetClientTeam(X) == 2)
{
//Alive:
if(IsPlayerAlive(X))
{
if(g_Trepar[X])
{
//Wall?
new bool:NearWall = false;
//Circle:
for(new AngleRotate = 0; AngleRotate < 360; AngleRotate += 30)
{
//Declare:
decl Handle:TraceRay;
decl Float:StartOrigin[3], Float:Angles[3];
//Initialize:
Angles[0] = 0.0;
Angles[2] = 0.0;
Angles[1] = float(AngleRotate);
GetClientEyePosition(X, StartOrigin);
//Ray:
TraceRay = TR_TraceRayEx(StartOrigin, Angles, MASK_SOLID, RayType_Infinite);
//Collision:
if(TR_DidHit(TraceRay))
{
//Declare:
decl Float:Distance;
decl Float:EndOrigin[3];
//Retrieve:
TR_GetEndPosition(EndOrigin, TraceRay);
//Distance:
Distance = (GetVectorDistance(StartOrigin, EndOrigin));
//Allowed:
if(Distance < 50) NearWall = true;
}
//Close:
CloseHandle(TraceRay);
}
//Ceiling:
decl Handle:TraceRay;
decl Float:StartOrigin[3];
new Float:Angles[3] = {270.0, 0.0, 0.0};
//Initialize:
GetClientEyePosition(X, StartOrigin);
//Ray:
TraceRay = TR_TraceRayEx(StartOrigin, Angles, MASK_SOLID, RayType_Infinite);
//Collision:
if(TR_DidHit(TraceRay))
{
//Declare:
decl Float:Distance;
decl Float:EndOrigin[3];
//Retrieve:
TR_GetEndPosition(EndOrigin, TraceRay);
//Distance:
Distance = (GetVectorDistance(StartOrigin, EndOrigin));
//Allowed:
if(Distance < 50) NearWall = true;
}
//Close:
CloseHandle(TraceRay);
//Near:
if(NearWall)
{
//Almost Zero:
SetEntityGravity(X, Pow(Pow(100.0, 3.0), -1.0));
//Buttons:
decl ButtonBitsum;
ButtonBitsum = GetClientButtons(X);
//Origin:
decl Float:ClientOrigin[3];
GetClientAbsOrigin(X, ClientOrigin);
//Angles:
decl Float:ClientEyeAngles[3];
GetClientEyeAngles(X, ClientEyeAngles);
//Declare:
decl Float:VeloX, Float:VeloY, Float:VeloZ;
//Initialize:
VeloX = (Speed * Cosine(DegToRad(ClientEyeAngles[1])));
VeloY = (Speed * Sine(DegToRad(ClientEyeAngles[1])));
VeloZ = (Speed * Sine(DegToRad(ClientEyeAngles[0])));
//Jumping:
if(ButtonBitsum & IN_JUMP)
{
//Stop:
new Float:Velocity[3] = {0.0, 0.0, 0.0};
TeleportEntity(X, ClientOrigin, NULL_VECTOR, Velocity);
}
//Forward:
if(ButtonBitsum & IN_FORWARD)
{
//Forward:
new Float:Velocity[3];
Velocity[0] = VeloX;
Velocity[1] = VeloY;
Velocity[2] = (VeloZ - (VeloZ * 2));
TeleportEntity(X, ClientOrigin, NULL_VECTOR, Velocity);
}
//Backward:
else if(ButtonBitsum & IN_BACK)
{
//Backward:
new Float:Velocity[3];
Velocity[0] = (VeloX - (VeloX * 2));
Velocity[1] = (VeloY - (VeloY * 2));
Velocity[2] = VeloZ;
TeleportEntity(X, ClientOrigin, NULL_VECTOR, Velocity);
}
//Null:
else
{
//Stop:
new Float:Velocity[3] = {0.0, 0.0, 0.0};
TeleportEntity(X, ClientOrigin, NULL_VECTOR, Velocity);
}
}
//Default:
else SetEntityGravity(X, 0.3);
}
}
}
}
}
The problem is that when a Furien is using WallHang they have a "slower no clip", basicly they can float arround the map, instead of being stuck to the wall.
__________________