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

Solved Event, Timer ? Client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Djctavia
Junior Member
Join Date: Oct 2016
Old 11-01-2016 , 15:39   Event, Timer ? Client
Reply With Quote #1

Hi guys,
I was thinking about those functions : "OnClientDisconnect_Post" and "OnClientConnected".

I see on https://wiki.alliedmods.net/Counter-...ent_disconnect there is event for client disconnect, but, I would like check in same time if someone succesfuly connect or disconnect.

I was more thinking about timer, cause Hook... there is only client_disconnect...

I have not tried yet, maybe should I try for being sure but, if I do a timer like:

Code:
public Action Timer_checkClients(Handle timer)
{
	if(OnClientConnected() || OnClientDisconnect_Post())
	{
		joueurs[MaxClients];
	}

	return Plugin_Continue;
}

Last edited by Djctavia; 11-01-2016 at 15:52.
Djctavia is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-01-2016 , 15:43   Re: Event, Timer ? Client
Reply With Quote #2

OnClientConnected and OnClientDisconnect_Post are forwards, meaning sourcemod executes those when they happen.

Code:
public void OnClientConnected(int client) {
// client connected.
}
Mitchell is offline
Djctavia
Junior Member
Join Date: Oct 2016
Old 11-01-2016 , 15:51   Re: Event, Timer ? Client
Reply With Quote #3

Oh ok, I wasn't sure I can call like this, I saw post, but if that work in that way ok, thank you men ;)
Djctavia is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-01-2016 , 16:05   Re: Event, Timer ? Client
Reply With Quote #4

You can check if a player is in game by doing IsClientInGame(client);
Mitchell is offline
Reply



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 01:34.


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