hello,
i saw this Thread @
http://forums.alliedmods.net/showthread.php?t=227995
And i need exactly this plugin, but this doenst work fine:
PHP Code:
#include <sourcemod>
#include <sdktools>
new bool:g_Round;
new g_Count;
public Plugin:myinfo =
{
name = "l4d2_duration",
author = "RU_6uK",
description = "Duration of map played",
version = "0.0",
url = "http://forums.alliedmods.net"
}
public OnPluginStart()
{
HookEvent( "round_start", Event_Round );
HookEvent( "round_end", Event_Round );
}
public OnMapStart()
{
g_Round = true;
}
public Action:Event_Round(Handle:event, const String:name[], bool:dontBroadcast)
{
if ( g_Round == true )
{
g_Count = 0;
CreateTimer( 1.0, Timer_RoundCount, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE );
g_Round = false;
}
else
{
g_Round = true;
}
}
public Action:Timer_RoundCount( Handle:timer, any:client )
{
g_Count ++;
if ( g_Round == false )
{
return Plugin_Continue;
}
else
{
// Do the math here.. i lazy
// Note that the timer ticking every 1.0 sec once. With +1 sec gape.
new min = g_Count/60;
new sec = g_Count - min;
PrintToChatAll( "[ROUNDDURATION]: %d min | %d sec", min, sec );
}
return Plugin_Stop;
}
But it shows me
[ROUNDDURATION]: 6 min | 122 sec
Or if a say slay @all it shows:
[ROUNDDURATION]: 0 min | 15 sec (= always)
Iam a noob, how can i fix this?
Thanks in advance