For a cooldown convar, you'll probably want something like this. I've included almost everything you'd need to implement it.
PHP Code:
new Handle:g_hCooldown = INVALID_HANDLE;
new g_iLastUsed[MAXPLAYERS+1];
public OnPluginStart()
{
g_hCooldown = CreateConVar("sm_test_cooldown", "10", "Cooldown in seconds.", 0, true, 0.0);
RegConsoleCmd("sm_test", Command_Test, "Test...");
}
public Action:Command_Test(client, args)
{
new iNow = GetTime(), iCooldown = GetConVarInt(g_hCooldown);
if (iCooldown > 0)
{
new iTimeLeft = g_iLastUsed[client] + iCooldown - iNow;
if (iTimeLeft > 0)
{
ReplyToCommand(client, "[SM] You must wait another %d second%s.", iTimeLeft, (iTimeLeft != 1 ? "s" : ""));
return Plugin_Handled;
}
}
g_iLastUsed[client] = iNow;
//Other stuff.
return Plugin_Handled;
}
public OnClientDisconnect_Post(client)
{
g_iLastUsed[client] = 0;
}
__________________