#include <amxmodx>
#include <cstrike>

public plugin_init() 
{
	register_plugin("[ZP] Set rate","0.2","DANDY")
}

public plugin_cfg()
{
	log_amx("[ZP] Set rate loaded")
}

public client_connect(id)
{
	/*if(is_user_LAN(id))
	    set_high_rate(id)
	else
	    set_low_rate(id)
	    */
	set_low_rate(id)
}

// checks if IP starts from 10, like 10.1.2.3
public is_user_LAN(id)
{
	new ip[32];
	get_user_ip(id,ip,31,0);
	return equali(ip, "10.", 3)
}

public set_low_rate(id)
{
	client_cmd(id, "cl_updaterate 66")
	client_cmd(id, "cl_cmdrate 66")
	client_cmd(id, "cl_rate 25000")
	client_cmd(id, "rate 40000")
}

public set_high_rate(id)
{
	client_cmd(id, "cl_updaterate 66")
	client_cmd(id, "cl_cmdrate 66")
	client_cmd(id, "cl_rate 25000")
	client_cmd(id, "rate 40000")
}
