View Single Post
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 10-19-2020 , 15:19   Re: [L4D2] Get Ghost Spawntime
Reply With Quote #4

I don't know much about how this event works, but maybe it fires only once when the player becomes ghost.

Anyway try like this:

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

#define TEAM_INFECTED    3

public void OnPluginStart()
{
    
HookEvent("ghost_spawn_time"event_ghost_spawn_time);
}

public 
void event_ghost_spawn_time(Event event, const char[] namebool dontBroadcast)
{

    
int client GetClientOfUserId(event.GetInt("attacker"));
    
int spawntime event.GetInt("spawntime");

    
PrintToChatAll("client %N | time %i"clientspawntime);

    if (
<= client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client) && GetClientTeam(client) == && spawntime 4)
    {
        
PrintToChatAll("Do Something");
    }

If that doesn't fire every second, then you may need to create a timer to make the "countdown"
__________________

Last edited by Marttt; 10-19-2020 at 15:20.
Marttt is offline