AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Custom Map URL prompt (https://forums.alliedmods.net/showthread.php?t=85315)

Hupio 02-08-2009 14:25

Custom Map URL prompt
 
1 Attachment(s)
Hi

This is my first effort at a amxx script.

The idea is that the player can type in /getMapUrl and get a url to download the map from. When the next map is a non standard map, this gives the player the opportunity to download and install it before the current level ends, hopefully minimising drop outs due to players not having the map and not wanting to waste time downloading from the game server.

How it works:
When someone types in /getMapUrl, my script:

- gets the name of the next map
- searches through a file called 'custom_maps.cfg' (which needs to be in the configs directory)
if the next map name matches an entry in the custom_maps.cfg, the url is returned


sample lines from custom_maps.cfg
cs_afghanistan http://www.fpsbanana.com/maps/download/1165
de_karachi_v32 http://www.fpsbanana.com/maps/download/1693

I'd be grateful if someone could have a look at this and point out any dumb mistakes or make suggestions for improvements. I have checked to see if someone else's done the same thing but it didn't look like they had.

Cheers

IneedHelp 02-08-2009 14:36

Re: Custom Map URL prompt
 
Good job! The only mistakes I saw:

You don't need to include file.inc, it's already included on amxmodx.inc

You aren't using multilingual on the client_prints so you have to change this..

client_print(0, print_chat, "[AMXX] %L", LANG_PLAYER, "custom_maps.cfg exists")

For this:

client_print(0, print_chat, "[AMXX] custom_maps.cfg exists")

The same with the others client_prints too..

Suggestion:
Use the new file system..I think that is faster
Create the file if doesn't exists and write a example on the top of it

Hupio 02-08-2009 14:47

Re: Custom Map URL prompt
 
Great :D That was quick, thanks for that I'll edit and re upload.

bow 02-09-2009 07:21

Re: Custom Map URL prompt
 
I have some problem's =)
http://s47.radikal.ru/i116/0902/88/36ea2122a163.jpg
Why ?!

DarkGod 02-09-2009 08:56

Re: Custom Map URL prompt
 
It's the LANG_PLAYER things he added, I thought he re-uploaded a fixed version?

Well anyways, remove all LANG_PLAYER and compile and it'll work fine.

bow 02-09-2009 09:01

Re: Custom Map URL prompt
 
tnx )

Hupio 02-10-2009 19:59

Re: Custom Map URL prompt
 
1 Attachment(s)
Ok here's the new version 0.0.2 ..

changes:
- updated file access to use the newer functions
- if the custom_maps.cfg file doesn't exist, it gets created with lines and instructions
- removed language stuff

Mlk27 02-10-2009 21:33

Re: Custom Map URL prompt
 
instead of printing the map link in chat, why don't you pop up a motd containing the map download link so players can click and download it?

Hupio 02-11-2009 09:18

Re: Custom Map URL prompt
 
Nice idea, how do I format the URL so that it works as a link though?

Hupio 02-11-2009 09:55

Re: Custom Map URL prompt
 
OK it's html, I didn't know that.

Hupio 02-11-2009 10:23

Re: Custom Map URL prompt
 
1 Attachment(s)
version 0.0.3
changes:
- message now shows in motd window

Nextra 02-11-2009 10:56

Re: Custom Map URL prompt
 
You should update your plugin through the mainpost instead of posting your updates in new posts. Go into advanced edit of your mainpost and reupload the file there so people don't have to crawl through the thread to find your updates.

However, nice idea for the plugin the only thing I recognized is that you have some issues with string lengths.

In get_map_downloadurl the declared string size is never used to it's full (both of the strings) and in search_maplist you need to change

PHP Code:

replace(outLine150"$1"left)
replace(outLine150"$2"right

to:

PHP Code:

replace(outLine149"$1"left)
replace(outLine149"$2"right

Otherwise you risk some ugly buffer overflows.

Some things that came up in my mind while looking at your plugin:
- In the MOTD it always displays "fpsbanana", maybe you could think of a way to make this more dynamic.
- I believe you should use get_pcvar_string for amx_nextmap, use get_cvar_pointer for that.
- You should update your version define so it reflects the actual plugin version you advertise
- Maybe a cvar for enable/disable?

// edit:
Does this not require ( and ) ?

PHP Code:

fclose cmfile 


Hupio 02-11-2009 18:49

Re: Custom Map URL prompt
 
Thanks for spotting those Nextra :)

One 02-15-2009 19:24

Re: Custom Map URL prompt
 
Hello,

idk, i think i couldnt understand you....

Example : when the nextmap ist de_asdasd & i write /getmapurl, this map will be downloaded from fpsbnana..... so... on fps banana are all maps in rar/zip files. how will be this unzip/unrar this files? or this will download the maps from my server?

how about the fastdownload server? when the maps will downloaded from my server, i have to know from wich serveR? fastdownload server or game server?

Nice Idea +k

fysiks 02-15-2009 21:06

Re: Custom Map URL prompt
 
When a server has a fast download server this plugin would be unnecessary.

One 02-16-2009 01:57

Re: Custom Map URL prompt
 
Quote:

Originally Posted by fysiks (Post 762333)
When a server has a fast download server this plugin would be unnecessary.

Hi,

ur right.but im thinking about maps bigger as 20 MB.... when this could func with fdl, i would use it.there are many players with bad settings & low connection...imagin i have players on my server with highskill....40ping...but they need around 1.5 min to dl a knife model :-))) the code say me nothing....

Hupio 02-16-2009 13:03

Re: Custom Map URL prompt
 
Quote:

Originally Posted by One (Post 762301)
Hello,

idk, i think i couldnt understand you....

Example : when the nextmap ist de_asdasd & i write /getmapurl, this map will be downloaded from fpsbnana..... so... on fps banana are all maps in rar/zip files. how will be this unzip/unrar this files? or this will download the maps from my server?

how about the fastdownload server? when the maps will downloaded from my server, i have to know from wich serveR? fastdownload server or game server?

Nice Idea +k

Thanks. :)

When you type /getMapUrl a link to the map's download page (on fpsbanana for instance) shows in a motd window. Downloading and installing the map is beyond my scripting ability in pawn at present.

Also, obviously if you have a fast download server there would be no point installing this plugin. The servers that I usually play on aren't that quick to download from, it might take several minutes to download a map like cs_afghanistan.

KadiR 02-19-2009 12:17

Re: Custom Map URL prompt
 
can you make, that when you type /getmap ,that you download the nextmap from the gameserver? And when it is fastdl then it is fastdl and when not, normal :D

fysiks 02-19-2009 12:40

Re: Custom Map URL prompt
 
Quote:

Originally Posted by KadiR (Post 764674)
can you make, that when you type /getmap ,that you download the nextmap from the gameserver? And when it is fastdl then it is fastdl and when not, normal :D

That's how a server works already. On map change you download the new map from the server or FastDL if you have it.

KadiR 02-19-2009 16:12

Re: Custom Map URL prompt
 
Quote:

Originally Posted by fysiks (Post 764683)
That's how a server works already. On map change you download the new map from the server or FastDL if you have it.

yep, but when it isnt fastdl, then you can download the bsp file while playing :D

fysiks 02-19-2009 16:15

Re: Custom Map URL prompt
 
Quote:

Originally Posted by KadiR (Post 764854)
yep, but when it isnt fastdl, then you can download the bsp file while playing :D

If it's more than just a bsp then you would have to exit the game and install the map yourself.

One 02-20-2009 09:22

Re: Custom Map URL prompt
 
Quote:

Originally Posted by Hupio (Post 762643)
Thanks. :)

When you type /getMapUrl a link to the map's download page (on fpsbanana for instance) shows in a motd window. Downloading and installing the map is beyond my scripting ability in pawn at present.

Also, obviously if you have a fast download server there would be no point installing this plugin. The servers that I usually play on aren't that quick to download from, it might take several minutes to download a map like cs_afghanistan.

Hi,

thats what i cant understand.... all maps on fpsbanana are .zip or .rar. how geht this files unrared or unzipped? a map can have more files like tga or .wad or ... how can this paste the right files in right folder? hmmm :-? i cant understand.

fysiks 02-20-2009 14:16

Re: Custom Map URL prompt
 
Quote:

Originally Posted by One (Post 765268)
thats what i cant understand.... all maps on fpsbanana are .zip or .rar. how geht this files unrared or unzipped?

You have to unzip/unrar with a program made for it. I just use Windows to unzip .zip files. I will never touch a rar file again but I know some people use WinRar.

Quote:

Originally Posted by One (Post 765268)
a map can have more files like tga or .wad or ... how can this paste the right files in right folder? hmmm :-? i cant understand.

You have to "install" it manually (i.e. put the files in your mod's folder yourself).

One 02-20-2009 17:31

Re: Custom Map URL prompt
 
Quote:

Originally Posted by fysiks (Post 765473)
You have to unzip/unrar with a program made for it. I just use Windows to unzip .zip files. I will never touch a rar file again but I know some people use WinRar.



You have to "install" it manually (i.e. put the files in your mod's folder yourself).

Hi,

i said nice idea & its a very nice idea, but , imagin when ur playing on my server & nextmap is a custom map & u need to download this, u have to say /bluh & u get the .zip file. however u have to get on desktop, go in game dir. & unzip it, when there are many files like any sounds in ambince... u have to paste this all in the right folder. imagin for a custom map with 1 extra sound, you need min. 1 min.... i think u can download the file from server & have just to wait & dont change the folder or unzip anything...however, nice idea, maybe anyone makes a host that the files arent zipped .

fysiks 02-20-2009 17:43

Re: Custom Map URL prompt
 
Quote:

Originally Posted by One (Post 765588)
maybe anyone makes a host that the files arent zipped .

If the files are not zipped you have to download each and every file individually. Much more time consuming than unzipping the .zip file (and they are already in the correct folder for you).

Hupio 02-20-2009 21:50

Re: Custom Map URL prompt
 
I've got a shortcut to C:\Program Files\Steam\steamapps\*****\counter-strike\cstrike on my desktop.

if you extract all the files into this folder and the map zip file is setup right, all files go into their proper folders without you having to extract them one folder at a time.

If you remember to download it and install it when you're not involved in the game (when you got shot for example) then you shouldn't miss out on any playing time when the server starts with the next new map.

Having said that, if someone wants to extend what I've done to auto install the map zips then feel free ..

Hawk552 02-23-2009 00:09

Re: Custom Map URL prompt
 
This plugin needs testing. If anyone can report that it does or doesn't work, please post.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approval pending on changes.

Hupio 03-04-2009 07:11

Re: Custom Map URL prompt
 
Hi it works on my standalone server :P I'm hoping to get it tested by a couple of different uk cs servers and I'll ask them to leave feedback.

Hupio 03-12-2009 14:54

Re: Custom Map URL prompt
 
Hi

The one person that I know has tried this has told me that it doesn't work. It doesn't create the custom_map.cfg file. His server runs on Linux. I have installed my script successfully twice on two of my own Windows machines with no problems. He's installed other mods and plugins without hassle before. Are there any OS related idiosyncracies or glitches that I should be aware of that would stop the script executing on Linux?

Marinovv327 06-27-2021 03:42

Re: Custom Map URL prompt
 
I hadn't heard anything more absurd than that in a while. Each server has a fast download. It's also twice as much waste of time.

on154288 07-13-2021 23:00

Re: Custom Map URL prompt
 
Quote:

Originally Posted by Marinovv327 (Post 2751289)
I hadn't heard anything more absurd than that in a while. Each server has a fast download. It's also twice as much waste of time.

Stop digging the post from 11 years ago and call it absurd.
It is like saying why you not using USB to a post talking about using floppy disk years ago.


All times are GMT -4. The time now is 14:38.

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