Raised This Month: $ Target: $400
 0% 

HLTV redirection script doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 03-17-2005 , 06:15   HLTV redirection script doesn't work
Reply With Quote #1

Hi,

I've coded a script that is to redirect HLTV proxies to a specified one. If you're running a game server and don't want ppl to waste your slots by connecting 20 HLTV proxies but still allow them to get the demos they want, you set up a single one, connect this one to your server and use my script to redirect all spectators to your HLTV server.

Also players who spectated a specified number of rounds will be redirected to the HLTV server to no longer use the slot other ppl who want to play need.

The thing is: Nothing works and I don't have a clue why. Could anyone please have a look at it and give me a hint?

Thx a lot MGee


€: Did a lot of work on this stuff, so have a look further down...
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
Janzert
Senior Member
Join Date: Mar 2004
Old 03-17-2005 , 10:53  
Reply With Quote #2

Are the console_print, server_print, hudmessages, etc., showing up?

I've never tried it, but I would be more suprised than not if client_cmd's work on a hltv proxy.

Janzert
__________________
Janzert is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 03-17-2005 , 11:55  
Reply With Quote #3

the client_cmds work, I've tested this with a clexec script I wrote ages ago, and the server does what it is told. I suppose the functions are never executed, since when I removed the first line checking the CVar value, this didn't have any effect. and the HUDs don't show up, neither is anything printed to console...
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
Janzert
Senior Member
Join Date: Mar 2004
Old 03-18-2005 , 12:24  
Reply With Quote #4

I don't have time to debug it here.

Probably the best thing to do is, start sprinking client_print(0,'s throughout the code till you understand what's happening.

EDIT: Oh, and use amxx plugins in the console to make sure it's getting run ok.

Janzert
__________________
Janzert is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 03-18-2005 , 16:45  
Reply With Quote #5

I did check amxx plugins list, the plugin is listed as "running", and I've actually had the server_prints as client_prints before I changed it to see if that works, but that didn't help...
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
Janzert
Senior Member
Join Date: Mar 2004
Old 03-18-2005 , 19:37  
Reply With Quote #6

Ok, put a client_print, or maybe better in this case MF_Log, at the top of each function to make sure it's getting called when you think it's supposed to. Then go from there till you find where something is happening different than expected.

Janzert
__________________
Janzert is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 03-25-2005 , 16:00  
Reply With Quote #7

I think the script actually does something, but that is the wrong thing

my brother was redirected to the HLTV server aftzer playing four rounds... I think I'll have to rewrite this stuff from scratch once again, there must be a big bug in there... I could use an ant-eater :p

thx 4 help anyway...
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
Janzert
Senior Member
Join Date: Mar 2004
Old 03-26-2005 , 12:15  
Reply With Quote #8

Code:
	get_user_authid(id, cl_id, 4);	// ID check - only 4 characters needed :: HLTV
I'm pretty sure you need to include the null terminator in your length passed to get_user_authid, so change that to 5. Use a client_print(0, print_chat, "%s", cl_id) after the get_user_authid to check this.

Code:
	if(!((get_user_team(id) == 1) || (get_user_team(id) == 2))){ // If player is neither team 1 nor team 2, he's spectating cuz he can't be connecting due to line 71!
Do a search on the forums, it seems that I saw someone mention that while this should be true it isn't always. You also need to add a spot to reset hltv_speccount[id] when a client disconnects. A shortcut way to do it would be to move your is_user_connecting check down from line 73 (refered to as line 71 in the comment above) to the line above.

Add a client_print just at line 80, just after the above if statement block, and check that it prints when you are sitting in spectator mode. Maybe resetHUD doesn't occur for spectators? In which case use register_logevent("cmd_specheck", 2, "1=Round_Start") and loop through the players.

Janzert
__________________
Janzert is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 06-05-2005 , 10:00  
Reply With Quote #9

I did now have time to have another look at this script and I found quite a bunch of things that didn't work. thx @ Janzert for your great hint that specs don't trigger reset_hud! I now got the script to redirect spec'ing players to the specified HLTV server, but yet HLTV serers are not redirected.

I found those do not execute the commands they are given; neither do they show the console messages sent to them. Does anyone have a clue how I can send commands to them?

Thx MGee
Attached Files
File Type: sma Get Plugin or Get Source (red2hltv.sma - 841 views - 7.1 KB)
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 05-31-2012 , 16:12   Re: HLTV redirection script doesn't work
Reply With Quote #10

did anyone gave this a test?
vamppa 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 14:11.


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