AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detecting Something (https://forums.alliedmods.net/showthread.php?t=117332)

zombieplague 01-31-2010 03:34

Detecting Something
 
Does anyone know how to detect when a user is downloading something from your server or connecting or specting.

dFF 01-31-2010 04:55

Re: Detecting Something
 
Try

PHP Code:

register_forward(FM_ClientConnect"your_function")

public 
your_function(id)
{
//stuff


or

PHP Code:

register_forward(FM_SpectatorConnect"your_function")

public 
your_function(id)
{
//stuff



Use
PHP Code:

FM_SpectatorThnk 

to detect user specting.

zombieplague 01-31-2010 05:40

Re: Detecting Something
 
Quote:

Originally Posted by dFF (Post 1073861)
Try

PHP Code:

register_forward(FM_ClientConnect"your_function")
 
public 
your_function(id)
{
//stuff


or

PHP Code:

register_forward(FM_SpectatorConnect"your_function")
 
public 
your_function(id)
{
//stuff
 


Use
PHP Code:

FM_SpectatorThnk 

to detect user specting.


Can you label which is which ?

Like this is what something.

Seta00 01-31-2010 06:19

Re: Detecting Something
 
Both codes try to do the same, you must test it to see if it works.
The last code is the answer to your last question ("or specting").

zombieplague 01-31-2010 06:43

Re: Detecting Something
 
Quote:

Originally Posted by Seta00 (Post 1073915)
Both codes try to do the same, you must test it to see if it works.
The last code is the answer to your last question ("or specting").

Like this ?

PHP Code:

register_forward(FM_SpectatorThnk"your_function")
 
public 
your_functionid )
{
         if ( 
user_is_aliveid )
         {
               
blablablabla
         
}



Seta00 01-31-2010 06:46

Re: Detecting Something
 
Yes, if you want to detect a spectator connecting.

ConnorMcLeod 01-31-2010 07:13

Re: Detecting Something
 
spectator connect and spectator think are for HLTVs, aka clients with flag FL_SPECTATOR.

zombieplague 01-31-2010 07:45

Re: Detecting Something
 
Quote:

Originally Posted by ConnorMcLeod (Post 1073954)
spectator connect and spectator think are for HLTVs, aka clients with flag FL_SPECTATOR.

Can you show me the full code of those 3 that i mention ?

nakash 01-31-2010 08:51

Re: Detecting Something
 
Where to put the register_forward function?
I tried to put this under plugin_init and it returned an error [undefinded symbol].

ujjl 01-31-2010 09:16

Re: Detecting Something
 
Maybe you write:
Code:

FM_SpectatorThnk
but its
Code:

FM_SpectatorThink


All times are GMT -4. The time now is 07:21.

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