Raised This Month: $ Target: $400
 0% 

Help: Allowing downloads based on map size.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-06-2004 , 07:25  
Reply With Quote #5

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 >= 4096)         {             server_cmd("sv_allowdownload 0")         } else {             server_cmd("sv_allowdownload 1")         }    return PLUGIN_CONTINUE }

Note that 4 megabytes = 4096 kilobytes ! 4000.
Its a littel nuance, but ya never know.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
 



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