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

Solved [CS GO] client for start_round event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-14-2018 , 14:08   [CS GO] client for start_round event
Reply With Quote #1

hi guys!!
i need timer for every players

for example this cod is true ??

PHP Code:
/*********************************
 *  Event RoundStart
 *********************************/
public Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    for(
int i 1<= MaxClientsi++)
    {
        
CreateTimer(3.0UpdateDelayGetClientSerial(i));
    }
    return 
Plugin_Continue;
}

/*********************************
 *  Public Timers
 *********************************/
public Action UpdateDelay(Handle timerany serial)
{
    
int client GetClientFromSerial(serial);
    
    if(!
IsValidClient(client))
    {
        return 
Plugin_Stop;
    }
    
    
// cod here
    
    
return Plugin_Continue;
}

/*********************************
 *  IsValidClient
 *********************************/
stock bool IsValidClient(int client)
{
    if(
client <= 0)
        return 
false;
    if(
client MaxClients)
        return 
false;
    if(!
IsClientInGame(client))
        return 
false;
    if(!
IsClientSourceTV(client))
        return 
false;
    if(
IsFakeClient(client))
        return 
false;
    return 
true;

thank you

Last edited by Dr.Mohammad; 12-15-2018 at 09:00.
Dr.Mohammad is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 12-14-2018 , 14:30   Re: [CS GO] client for start_round event
Reply With Quote #2

1) if somebody enter game after roundstart event, he will not be listed in timer
If you dont want it just create 1 timer and then loop all players
2)remove ! in sourcetv, and maybe sourcetv will be also fakeclient, I am not sure
3)Make sure your
******
IsValidClient
*******
Helps you, for me it make nocense
Maybe something like
*****
Stocks
*****
Events...

Last edited by Indarello; 12-14-2018 at 14:37.
Indarello is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-14-2018 , 16:16   Re: [CS GO] client for start_round event
Reply With Quote #3

Quote:
Originally Posted by Indarello View Post
if somebody enter game after roundstart event, he will not be listed in timer
thank you
this cod for example

"if somebody enter game after roundstart event, he will not be listed in timer" how i to fixing this problem??
Dr.Mohammad is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 12-14-2018 , 22:49   Re: [CS GO] client for start_round event
Reply With Quote #4

Code:
public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
    CreateTimer(3.0, UpdateDelay);
	
    return Plugin_Continue;
}

/*********************************
 *  Public Timers
 *********************************/
public Action UpdateDelay(Handle timer, any serial)
{
    for(int i = 1; i <= MaxClients; i++)
    {
		if(IsValidClient(client))
		{
			
		}
    }
}
Indarello is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-15-2018 , 03:44   Re: [CS GO] client for start_round event
Reply With Quote #5

Quote:
Originally Posted by Indarello View Post
Code:
public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
    CreateTimer(3.0, UpdateDelay);
	
    return Plugin_Continue;
}

/*********************************
 *  Public Timers
 *********************************/
public Action UpdateDelay(Handle timer, any serial)
{
    for(int i = 1; i <= MaxClients; i++)
    {
		if(IsValidClient(client))
		{
			
		}
    }
}
this is true??

PHP Code:
int g_iTimer[MAXPLAYERS+1];

/*********************************
 *  Event_RoundStart
 *********************************/
public Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
CreateTimer(3.0UpdateDelay);
    return 
Plugin_Continue;
}

/*********************************
 *  Public UpdateDelay Timer
 *********************************/
public Action UpdateDelay(Handle timer)
{
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsValidClient(i))
        {
            
CreateTimer(1.0CheckEveryClientGetClientSerial(i));
        }
        return 
Plugin_Stop;
    }
}

/*********************************
 *  Public CheckEveryClient Timer
 *********************************/
public Action CheckEveryClient(Handle timerany serial)
{
    
int client GetClientFromSerial(serial);
    
    if(!
IsValidClient(client))
    {
        return 
Plugin_Stop;
    }

    if(
g_iTimer >= 30)
    {
        
//code is here, for every client on round start after 30s
        
g_iTimer[client] = 0;
        return 
Plugin_Stop;
    }
    else
    {
        
g_iTimer[client]++;
        return 
Plugin_Continue;
    }
}

/*********************************
 *  IsValidClient
 *********************************/
stock bool IsValidClient(int client)
{
    if(
client <= 0)
        return 
false;
    if(
client MaxClients)
        return 
false;
    if(!
IsClientInGame(client))
        return 
false;
    if(!
IsClientSourceTV(client))
        return 
false;
    if(
IsFakeClient(client))
        return 
false;
    return 
true;


Last edited by Dr.Mohammad; 12-15-2018 at 03:46.
Dr.Mohammad is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 12-15-2018 , 06:30   Re: [CS GO] client for start_round event
Reply With Quote #6

Quote:
Originally Posted by Dr.Mohammad View Post
this is true??

PHP Code:
int g_iTimer[MAXPLAYERS+1];

/*********************************
 *  Event_RoundStart
 *********************************/
public Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
CreateTimer(3.0UpdateDelay);
    return 
Plugin_Continue;
}

/*********************************
 *  Public UpdateDelay Timer
 *********************************/
public Action UpdateDelay(Handle timer)
{
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsValidClient(i))
        {
            
CreateTimer(1.0CheckEveryClientGetClientSerial(i));
        }
        return 
Plugin_Stop;
    }
}

/*********************************
 *  Public CheckEveryClient Timer
 *********************************/
public Action CheckEveryClient(Handle timerany serial)
{
    
int client GetClientFromSerial(serial);
    
    if(!
IsValidClient(client))
    {
        return 
Plugin_Stop;
    }

    if(
g_iTimer >= 30)
    {
        
//code is here, for every client on round start after 30s
        
g_iTimer[client] = 0;
        return 
Plugin_Stop;
    }
    else
    {
        
g_iTimer[client]++;
        return 
Plugin_Continue;
    }
}

/*********************************
 *  IsValidClient
 *********************************/
stock bool IsValidClient(int client)
{
    if(
client <= 0)
        return 
false;
    if(
client MaxClients)
        return 
false;
    if(!
IsClientInGame(client))
        return 
false;
    if(!
IsClientSourceTV(client))
        return 
false;
    if(
IsFakeClient(client))
        return 
false;
    return 
true;

Maybe you will write what you want, cause I dont understand this code
Indarello is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 12-15-2018 , 08:56   Re: [CS GO] client for start_round event
Reply With Quote #7

Quote:
Originally Posted by Indarello View Post
Maybe you will write what you want, cause I dont understand this code
solved.


/*********************************
* IsValidClient
*********************************/
stock bool IsValidClient(int client)
{
if(client <= 0)
return false;
if(client > MaxClients)
return false;
if(!IsClientInGame(client))
return false;
if(!IsClientSourceTV(client))
return false;
if(IsFakeClient(client))
return false;
return true;
}

Last edited by Dr.Mohammad; 12-15-2018 at 08:58.
Dr.Mohammad is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 12-15-2018 , 09:01   Re: [CS GO] client for start_round event
Reply With Quote #8

Quote:
Originally Posted by Indarello View Post
Code:
Handle h_Timer;

public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
	h_Timer = CreateTimer(3.0, UpdateDelay, _, TIMER_REPEAT);
}

/*********************************
 *  Public Timers
 *********************************/
public Action UpdateDelay(Handle timer, any serial)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i))
		{
			// do something crazy here
		}
	}
}

public void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
{
	delete h_Timer;
}
__________________
Ilusion9 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:29.


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