AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Jockey goes invisible when standing still, stop emitting sound (https://forums.alliedmods.net/showthread.php?t=337794)

arclightarchery 05-15-2022 14:03

Jockey goes invisible when standing still, stop emitting sound
 
Code:

public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBrodcast)
{
        int client = GetClientOfUserId(GetEventInt(event, "userid"));
        if (IsValidJockey(client))
        {
                if (isGhostStalker)
                {
                        GhostStalkerTimer[client] = CreateTimer(0.2, Timer_GhostStalker, client, TIMER_REPEAT);
                }
                if (isBacterialFeet)
                {
                        cvarBacterialFeetTimer[client] = CreateTimer(0.5, Timer_BacterialFeet, client);
                }
        }
}

public Action Timer_GhostStalker(Handle timer, any client)
{
    if(!IsClientMoving(client) & IsValidJockey(client) & IsValidClient(client))
    {
        if(Opacity >= 17)
        {
            Opacity-=17;
            PrintToChatAll("%i", Opacity);
            SetEntityRenderMode(client, RENDER_TRANSCOLOR);
            SetEntityRenderColor(client, 255, 255, 255, Opacity);
            for(int i=0; i<sizeof(g_JockeySounds); i++)
            {
                StopSound(client, -1, g_JockeySounds[i]);
            }
        }
    }
    else
    {
        Opacity = 255;
        SetEntityRenderColor(client, 255, 255, 255, Opacity);
    }
}

I made a feature for Jockey, if he's not moving for 3 seconds he will goes invisible, the problem is he still emitting sound, alert the survivor and they can also trigger voice line that detects him, also another issue is other Jockey can break invi of each other, I don't know why

OciXCrom 05-15-2022 14:22

Re: Jockey goes invisible when standing still, stop emitting sound
 
You're in the AMX Mod X section.


All times are GMT -4. The time now is 21:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.