Raised This Month: $12 Target: $400
 3% 

Timer Issue


Post New Thread Reply   
 
Thread Tools Display Modes
Lubricant Jam
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 12-29-2018 , 10:52   Re: Timer Issue
Reply With Quote #21

Quote:
Originally Posted by Bacardi View Post
What game is this ?
CS:GO my friend, I think I was using round_officially_end and switched it to round_end and it seems to be somewhat working but I've got to test thoroughly.
Lubricant Jam is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 12-29-2018 , 12:15   Re: Timer Issue
Reply With Quote #22

Quote:
Originally Posted by Lubricant Jam View Post
CS:GO my friend, I think I was using round_officially_end and switched it to round_end and it seems to be somewhat working but I've got to test thoroughly.
Also, if the first guy who enters the zone disconnects, then no one will be killed (and the round will end when the roundtime ends).

PHP Code:

    int client 
GetClientOfUserId(data); 

    if (
g_iCountdown && IsClientInGame(client)) 
    {
        ...
    } 
I don't know if you really need the client here.
__________________
Ilusion9 is offline
XiLuo
Member
Join Date: Mar 2018
Old 12-29-2018 , 12:16   Re: Timer Issue
Reply With Quote #23

Quote:
Originally Posted by XiLuo View Post
TIMER_FLAG_NO_MAPCHANGE flag is that will not allow timer pass next map.And the flag TIMER_REPEAT for timer if you not kill it until the next map will kill
So to avoid timer repeat more,you can try this code
PHP Code:
public Action Event_RoundStart(Handle event, const char[] namebool dontBroadcast)
{
    
g_iCompleted 0;
    
g_iCountdown 30;
    
//if last round the timer is not over , we kill it and create new
    
if(EndZoneTimer != INVALID_HANDLE)
    {
        
KillTimer(EndZoneTimer);
        
EndZoneTimer INVALID_HANDLE;
    }
    if(
CountdownTimer!=INVALID_HANDLE)
    {
        
KillTimer(CountdownTimer);
        
CountdownTimer INVALID_HANDLE;
    }
    
    
EndZoneTimer CreateTimer(1.0EndZoneCheckINVALID_HANDLETIMER_REPEAT);
}

public 
Action EndZoneCheck(Handle timerint userid)
{
    for (
int client 1client <= MaxClients; ++client)
    {
        if (
IsClientInGame(client) && coursetimer_InEndZone(client) && IsPlayerAlive(client))
        {
            if (
g_iCompleted == 0) {
                
EmitSoundToAll("training/countdown.wav"clientSNDCHAN_VOICESNDLEVEL_RAIDSIREN);
                
PrintToChatAll("[SM] \x07%N \x02has reached the end!"client);
                
PrintToChatAll("[SM] \x0330 seconds remaining to complete the map.");
                
ForcePlayerSuicide(client);
                
CountdownTimer CreateTimer(1.0Timer_CountdownGetClientUserId(client), TIMER_REPEAT);
                
g_iCompleted++;
                
//It's time to kill this timer and set it INVALID_HANDLE
                
KillTimer(timer);//KillTimer(EndZoneTimer);
                
EndZoneTimer INVALID_HANDLE;
            }
        }
    }
}

public 
Action Timer_Countdown(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);

    if (
g_iCountdown && IsClientInGame(client))
    {
        if ((
g_iCountdown == 20) || (g_iCountdown == 10) || (g_iCountdown == 5) || (g_iCountdown 4))
            if (
g_iCountdown == 1)
            {
                
PrintToChatAll("[SM] \x03%d second remaining to complete the map."g_iCountdown);
                for (
int i 1<= MaxClients; ++i)
                {
                    if(
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) > 1)
                    {
                        
ForcePlayerSuicide(i);
                    }
                }
                
// round over we must kill this timer now
                
KillTimer(timer);//KillTimer(CountdownTimer);
                
CountdownTimer INVALID_HANDLE;
            }
            else 
PrintToChatAll("[SM] \x03%d seconds remaining to complete the map."g_iCountdown);

        
g_iCountdown--;
    }

if there's something wrong please correct me,thanks.
Excuse my poor English,thanks again.

Please try it again, If roundstart works well,the timer will be one

Last edited by XiLuo; 12-30-2018 at 01:02.
XiLuo is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-29-2018 , 12:59   Re: Timer Issue
Reply With Quote #24

@Lubricant Jam, about those zones...
Could you give link to the map or mod/plugin what have this end zone ?

I don't exactly follow how this game should end.
*edit
Or does it trigger round_end when player get in end zone ??

Last edited by Bacardi; 12-29-2018 at 13:00.
Bacardi is offline
Lubricant Jam
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 01-15-2019 , 04:44   Re: Timer Issue
Reply With Quote #25

Quote:
Originally Posted by Bacardi View Post
@Lubricant Jam, about those zones...
Could you give link to the map or mod/plugin what have this end zone ?

I don't exactly follow how this game should end.
*edit
Or does it trigger round_end when player get in end zone ??
It's simply an adaptation of ckSurf and I made the end zone a native and I am simply checking that way. Since this post I have managed to sort, I can't remember how however I will check when I am next at my computer.
Lubricant Jam is offline
Reply


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


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