View Single Post
Kusber
New Member
Join Date: Oct 2020
Old 10-24-2020 , 09:09   Re: [L4D2] Get Ghost Spawntime
Reply With Quote #7

Quote:
Originally Posted by Marttt View Post
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"
Yep, that is working Thank you!
Kusber is offline