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_time, EventHookMode_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) == 3 && spawntime < 4)
{
// DoSomeThing
}
}
But that isn't working. ;'(