Hello guys, I've been trying to compose this problem for several hours, which is the objective is that the furiens are invisible when they are stopped, and so far I've only managed to make it happen sometimes, 3 in 3 rounds they are invisible or something which wasn’t supposed to happen, but I always wanted to. could someone help me? thanks !
PHP Code:
if(cVb_Invisible == true)
{
char wepname[32];
GetClientWeapon(client, wepname, sizeof(wepname));
bool b_CanBeInvisible = IsClientNotMoving(buttons) && !IsClientInAir(client, cFlags) && StrEqual(wepname, "weapon_knife") && b_ClientMovedAfterSpawn[client] == true;
if(b_CanBeInvisible == true)
{
if(b_IsClientInvisible[client] == false)
{
if(b_IsClientInvisiblePre[client] == false)
{
f_ClientInvisible[client] = GetGameTime();
b_IsClientInvisiblePre[client] = true;
}
else if(b_IsClientInvisiblePre[client] && b_IsClientInvisible[client] == false)
{
int i_ClientRenderColor[MAXPLAYERS+1][4];
F_GetEntityRenderColor(client, i_ClientRenderColor[client]);
float f_InvisTimeLeft[MAXPLAYERS+1];
f_InvisTimeLeft[client] = f_ClientInvisible[client] - GetGameTime() + f_gInvisibleDelay[client];
if(f_InvisTimeLeft[client] < 0.01 && (i_ClientRenderColor[client][3]-cVi_Invisible_Alpha_Reduce) <= 0)
{
SetEntityRenderColor(client,255,255,255,0);
FadeClient(client, 35,0,130,30);
b_IsClientInvisible[client] = true;
}
else if(f_InvisTimeLeft[client] < 0.01 && i_ClientRenderColor[client][3] > 1)
{
SetEntityRenderColor(client,255,255,255,i_ClientRenderColor[client][3]-cVi_Invisible_Alpha_Reduce);
f_ClientInvisible[client] = GetGameTime();
}
}
}
}
else
{
//SetEntityRenderColor(client);
b_IsClientInvisiblePre[client] = false;
b_IsClientInvisible[client] = false;
FadeClient(client);
}
}