View Single Post
nosoop
Veteran Member
Join Date: Aug 2014
Old 02-19-2017 , 22:51   Re: [TF2]Delaying commands
Reply With Quote #2

I'm having trouble understanding what the event plugin entails. Could you explain the underlying problem that you're having?

If you want to hook a player respawn, you can use the following:

Code:
public void OnPluginStart() {
    HookEvent("player_spawn", OnPlayerSpawn);
}

public void OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast) {
    int client = GetClientOfUserId(event.GetInt("userid"));
    
    if (client) {
        // spawn timer, etc.
    }
}
For Timers and the like, you do have to provide a callback function that gets called when the timer interval has elapsed.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline