Raised This Month: $ Target: $400
 0% 

Help: Allowing downloads based on map size.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
JonnyH
Junior Member
Join Date: Apr 2004
Old 07-06-2004 , 07:15  
Reply With Quote #4

Ok, having some problems now with the client messages, they are not apprearing, I have done it on Client_Connect, but it doesnt come up in console when the user gets the "Cannot download map..." message.

Ideally I would like to have the message pop up in one of those nice steamy boxes, but if this isnt possible, I would be happy with just console printing.

Thanks for the help above "Johnny got his gun", and any further help anyone can offer.

Code:
public plugin_init() 
{
   register_plugin("Download Tester","1.0","JonnyH")
   server_cmd("sv_allowdownload 1")

	new map[33], mappath[128]
	get_mapname(map, 32) 
	format(mappath, 127, "maps/%s.bsp", map) 
	new mapsize = file_size(mappath, 0)
	if (mapsize >= 4000)
		{
			server_cmd("sv_allowdownload 0")
		} else {
			server_cmd("sv_allowdownload 1")
		}

   return PLUGIN_CONTINUE 
}

public client_connect(id){
	if (get_cvar_num("sv_allowdownload")==0){
		client_cmd(id, "echo ^"========================================================================^"")
		client_cmd(id, "echo ^"[KOA] This map is too big to download from the server.^"")
		client_cmd(id, "echo ^"[KOA] Please download this map from www.K-O-A.com.^"")
		client_cmd(id, "echo ^"========================================================================^"")
	} else {
		client_cmd(id, "echo ^"========================================================================^"")
		client_cmd(id, "echo ^"[KOA] As this map is less than 4mb, you can download it from our server.^"")
		client_cmd(id, "echo ^"Visit www.K-O-A.com for more info.^"")
	}
}
JonnyH 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 14:39.


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