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]
get_mapname(mapname,63)
format(mappath,127,"/maps/%s.bsp",mapname)
if (file_size(mappath, 0)>=4000)
{
server_cmd("sv_allowdownload 0")
} else {
server_cmd("sv_allowdownload 1")
}
For some reason it doesnt work, I have tried loads of variations for the path of the map, with no luck, I am sure that it is not seeing the map, as if I do a "file_exists" I get 0.
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