Raised This Month: $ Target: $400
 0% 

Timeleft x and execute


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 12-15-2018 , 14:12   Re: Timeleft x and execute
Reply With Quote #7

Quote:
Originally Posted by TrullSin View Post
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>

float g_flNextTimeleft 0.0;
int g_flTimeleft 120;

public 
void OnPluginStart() {
  
ConVar hTimeleft CreateConVar("timeleft""120""When timeleft hit this time it will execute the command");
  if (
hTimeleft == INVALID_HANDLE) {
    
SetFailState("CreateConVar failed");
  }
  
AutoExecConfig(true);

  
g_flTimeleft GetConVarInt(hTimeleft);
  
delete hTimeleft;

  
HookEvent("round_start"OnRoundStartEventHookMode_Post);
}

public 
void OnRoundStart(Event event, const char[] namebool dontBroadcast) {
  
g_flNextTimeleft GetGameTime() + float(GameRules_GetProp("m_iRoundTime") - g_flTimeleft);
}

public 
Action Timeleft(int client) {
    if (
GetGameTime() < g_flNextTimeleft) {
      
ServerCommand("exec normal.cfg");
    } else {
    }

Cant figure it out why not executing.. Prob doing something wrong

after a quick glance there is no timer creation not KillTimer function. all you have done on g_flNextTimeleft is assign it a value.
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
 



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 04:38.


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