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

SendConVarValue doesn't seem to work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheAvengers
BANNED
Join Date: Mar 2011
Old 04-04-2011 , 12:31   SendConVarValue doesn't seem to work
Reply With Quote #1

Why does this not work? What am I doing wrong?

SendConVarValue(client, FindConVar("sv_downloadurl"), "http://webspace/cstrike/");

Also, does the client have a cvar which it stores its location in? with 0 being west coast or something.

Last edited by TheAvengers; 04-04-2011 at 12:47.
TheAvengers is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 04-05-2011 , 12:55   Re: SendConVarValue doesn't seem to work
Reply With Quote #2

Try.

PHP Code:
ClientCommand(Client"sv_downloadurl http://webspace/cstrike/"); 
__________________
Master(d)



Master53 is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-05-2011 , 15:09   Re: SendConVarValue doesn't seem to work
Reply With Quote #3

And then you realize that Master53's code doesn't work.

When are you calling SendConVarValue TheAvengers ?
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 04-06-2011 , 07:04   Re: SendConVarValue doesn't seem to work
Reply With Quote #4

Why not just set the global ( server ) once since it sends it to all clients?

Oh and were looking for sv_region ? That is server side thought not client side.
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks
Samantha is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-06-2011 , 09:32   Re: SendConVarValue doesn't seem to work
Reply With Quote #5

SendConVarValue
Quote:
Notes:
Replicates a convar value to a specific client. This does not change the actual convar value.
PHP Code:
bool:SendConVarValue(clientHandle:convar, const String:value[]); 
PHP Code:
new Handle:sv_downloadurl INVALID_HANDLE;

public 
OnPluginStart()
{
    
HookEvent("player_activate"PlayerActiveEventHookMode_Post);
    
sv_downloadurl FindConVar("sv_downloadurl");
}

public 
PlayerActive(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl client;
    
client GetClientOfUserId(GetEventInt(event"userid"));
    if(!
IsFakeClient(client))
    {
        
SendConVarValue(clientsv_downloadurl"http://webspace/cstrike/");
    }

Hahahaha
Now you can replace your server "fastdownload" address to another from all players.
They still download missing content from your real server sv_downloadurl "address"

Last edited by Bacardi; 04-06-2011 at 09:46.
Bacardi is offline
TheAvengers
BANNED
Join Date: Mar 2011
Old 04-11-2011 , 05:18   Re: SendConVarValue doesn't seem to work
Reply With Quote #6

Thanks for all of your suggestions guys! I have however, found an alternative method of doing what I wanted. To my surprise, HL2 appears to actually perform the necessary actions of certain HTTP status codes. So I ended up setting up a HTTP redirect server which simply queried the IP Address against a huge list of IP Ranges, determining the country, then redirecting them to my fastest FastDL server in the region.

Once again, thank you for anytime spent offering your suggestions! Though they may not have worked in the end, I'm just happy to have finally found a simple solution.

Last edited by TheAvengers; 04-11-2011 at 05:25.
TheAvengers 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 00:04.


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