AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get hltv delay value (https://forums.alliedmods.net/showthread.php?t=241464)

bol 06-04-2014 01:01

get hltv delay value
 
Hello,

Is there a way for the game server to check connected hltv delay time?
And lets say if it is below 15seconds kick it?

fysiks 06-04-2014 01:45

Re: get hltv delay value
 
I don't think there is because the HLTV is treated like any other player (other than it's SteamID and such).

I wonder if maybe it's in the user info. Maybe try get_user_info() with some stuff and see if it broadcasts that kind of information.

bol 06-04-2014 11:53

Re: get hltv delay value
 
hm interesting that could proven to be helpful.
for information the delay time is visible in status I reckon you know this, is there a way to retrieve it from there?
Its position is that of user frags, perhaps get_user_frags?

jimaway 06-04-2014 12:38

Re: get hltv delay value
 
Quote:

Originally Posted by fysiks (Post 2146513)
I don't think there is because the HLTV is treated like any other player (other than it's SteamID and such).

I wonder if maybe it's in the user info. Maybe try get_user_info() with some stuff and see if it broadcasts that kind of information.

actually HLTV is not treated like any other player, HLTV has different status output

Code:

status
hostname:  Counter-Strike
version :  48/1.1.2.6 5758 secure  (10)
tcp/ip  :  192.168.1.69:27015
map    :  skate_dusts at: 0 x, 0 y, 0 z
players :  2 active (20 max)

#      name userid uniqueid frag time ping loss adr
# 1 "www.kz-arg.com.ar" 1 BOT  0 02:15    0    0
# 2 "HLTV Proxy" 2 HLTV hltv:0/128 delay:30 01:46 127.0.0.1:27020
2 users


fysiks 06-04-2014 16:56

Re: get hltv delay value
 
Quote:

Originally Posted by jimaway (Post 2146734)
actually HLTV is not treated like any other player, HLTV has different status output

Code:

status
hostname:  Counter-Strike
version :  48/1.1.2.6 5758 secure  (10)
tcp/ip  :  192.168.1.69:27015
map    :  skate_dusts at: 0 x, 0 y, 0 z
players :  2 active (20 max)

#      name userid uniqueid frag time ping loss adr
# 1 "www.kz-arg.com.ar" 1 BOT  0 02:15    0    0
# 2 "HLTV Proxy" 2 HLTV hltv:0/128 delay:30 01:46 127.0.0.1:27020
2 users


Oh. I guess it's been too long since I've used HLTV. It's probably possible then.

^SmileY 06-05-2014 00:07

Re: get hltv delay value
 
You have access to hltv proxy?

or just try:

PHP Code:

    new sDelay[3];
    
get_user_info(id,"delay",sDelay,charsmax(sDelay)); 


bol 06-06-2014 13:59

Re: get hltv delay value
 
Having no luck so far, am getting
PHP Code:

get_user_info(id,"delay",sDelay,charsmax(sDelay)); 

on the same piece of code that im getting the hltvip so it should work. anyone else willing to try this?
On the hltv the command 'setinfo' is not registered. yet hltv clearly passes info to status.

Think ill have to go try query_client_cvar.

vlad_slick 06-07-2014 02:20

Re: get hltv delay value
 
Try this:
PHP Code:

#include <amxmodx>

#define PLUGIN "HLTV Delay Checker"
#define VERSION "1.0"
#define AUTHOR "you"

#define MIN_DELAY 15

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id) {
    if(
is_user_hltv(id)) {        
        static 
hltv_delay[3
        
get_user_info(id"hdelay"hltv_delay2)
        if(
str_to_num(hltv_delay)<MIN_DELAY)
            
server_cmd("kick #%d ^"HLTV Delay(%dtoo low (MAX=%d)^" ",get_user_userid(id), str_to_num(hltv_delay),MIN_DELAY)
        
    }



bol 06-13-2014 04:44

Re: get hltv delay value
 
I assume "hdelay" was a type o and meant to be "delay"

Code:

<Kicked : "HLTV delay<0> too low <MAX=15>" >.
On the hltv console.
so far I havent been able to get the hltv delay value.
When the gameserver knows the given hltv delay time from 'status' there must be a way to retrieve it right?

Nextra 06-13-2014 06:47

Re: get hltv delay value
 
Or it was not a typo and you should try out the code he has probably confirmed working. I think hdelay is the correct info name.


All times are GMT -4. The time now is 09:44.

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