Raised This Month: $4 Target: $400
 1% 

[L4D2] Get Ghost Spawntime


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kusber
New Member
Join Date: Oct 2020
Old 10-16-2020 , 11:38   [L4D2] Get Ghost Spawntime
Reply With Quote #1

Hello all,

I'm new in Sourcemod Scripting so I'm sorry for this noob question.

I'm trying to get the ghost spawntime and excute some code if clients spawntime is under 4 seconds.

Here is my code:

PHP Code:
#include <sourcemod>

#define TEAM_INFECTED    3

public onPluginStart()
{
    
HookEvent("ghost_spawn_time",event_ghost_spawn_timeEventHookMode_Post); 
}

public 
event_ghost_spawn_time(Handle:event, const String:name[], bool:dontBroadcast)
{
    
    new 
client GetClientOfUserId(GetEventInt(event,"userid"));
    new 
spawntime GetEventFloat(event,"spawntime");
    if (
IsHumanPlayer(client) && IsPlayerGhost && GetClientTeam(client) == && spawntime 4)
    {
        
// DoSomeThing
    
}

But that isn't working. ;'(
Kusber is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:17.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode