Raised This Month: $ Target: $400
 0% 

wan and lan download urls


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-02-2013 , 10:48   wan and lan download urls
Reply With Quote #1

#include <amxmodx>

new wl_downloadurl, ip_adrr[16]

public plugin_init()
{
register_plugin("wanorlan", "0.1beta", "mockBa")
wl_downloadurl = get_cvar_pointer("sv_downloadurl")
}

public client_connect(id)
{
get_user_ip(id, ip_adrr, 15, 1)

if(!equali(ip_adrr, "10.", 3))
{
set_pcvar_string(wl_downloadurl, "http://10.91.140.125/cstrike/")
}
else
{
set_pcvar_string(wl_downloadurl, "http://mydomain/cstrike/")
}
}

I have sv_downloadurl "http://mydomain/cstrike/", but LAN users, without Internet, can't download files. Can you help me with script for switching urls for LAN and WAN users? LAN users from 10.0.0.0/8

The script works, I want to hear your advice about using it.

Last edited by ZASTRELIS; 01-02-2013 at 10:56.
ZASTRELIS is offline
 



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 13:45.


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