Help: Allowing downloads based on map size.
Hi, Im trying to write a plugin for a friend, he wants ppl to be able to download any map less than 4mb is size from the server, otherwise he wants them to get a messages telling them where the map pack is.
So far, I have come up with the following, im not worrying about the message yet. This code is in plugin_init(). Code:
new mapname[64], mappath[128]Any idea how AMXX file_size would let me refer to a file in the maps directory, or where it starts its relative paths from (the AMXX dir, root or cs root)? Thanks for any help, Jonny |
Mappath should probably have /%modname%/maps/%mapname%.bsp
|
Path of file_size is the moddir.
Code:
|
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() |
Code:
Note that 4 megabytes = 4096 kilobytes ! 4000. Its a littel nuance, but ya never know. |
file_size returns size in bytes.
4 megabyte = 4096 kB = 16777216 bytes Quote:
|
lol thanks, what can I say, I'm a noob.
The main problem though is still the messages to clients on connect. It isnt printing to the console etc. Code:
public client_connect(id){ |
instead of using client_cmd(id
try using Quote:
Code:
I hope that helps you out man :) |
When a players connecting their console isn't open though. The only way I know of getting a message to players before they connect is via the kick command as it allows you to give a reason why.
Code:
|
The problem if I use the kick is that, it will kick everyone surly?
Is there an "FileDownload" event or similar native funtion? Anyone know of a list of CS events? |
| All times are GMT -4. The time now is 14:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.