Raised This Month: $94 Target: $400
 23% 

Custom Map URL prompt


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   Exolent[jNr] (178)
Hupio
Junior Member
Join Date: Feb 2009
Location: York, UK
Old 02-08-2009 , 15:25   Custom Map URL prompt
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (getMapDownloadURL.sma - 1236 views - 3.2 KB)

Last edited by Hupio; 02-21-2009 at 16:54. Reason: changed categories
Hupio is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 02-08-2009 , 15:36   Re: Custom Map URL prompt
Reply With Quote #2

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
__________________

Last edited by IneedHelp; 02-08-2009 at 15:39.
IneedHelp is offline
Hupio
Junior Member
Join Date: Feb 2009
Location: York, UK
Old 02-08-2009 , 15:47   Re: Custom Map URL prompt
Reply With Quote #3

Great That was quick, thanks for that I'll edit and re upload.
Hupio is offline
bow
Junior Member
Join Date: Nov 2008
Location: Russia, Saint Petesburg
Old 02-09-2009 , 08:21   Re: Custom Map URL prompt
Reply With Quote #4

I have some problem's =)

Why ?!
__________________
www.makeserver.ru Amx Mod X Russian Support
I'm From Russia, Saint Petesburg
bow is offline
Send a message via ICQ to bow
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-09-2009 , 09:56   Re: Custom Map URL prompt
Reply With Quote #5

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.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
bow
Junior Member
Join Date: Nov 2008
Location: Russia, Saint Petesburg
Old 02-09-2009 , 10:01   Re: Custom Map URL prompt
Reply With Quote #6

tnx )
__________________
www.makeserver.ru Amx Mod X Russian Support
I'm From Russia, Saint Petesburg
bow is offline
Send a message via ICQ to bow
Hupio
Junior Member
Join Date: Feb 2009
Location: York, UK
Old 02-10-2009 , 20:59   Re: Custom Map URL prompt
Reply With Quote #7

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
Attached Files
File Type: sma Get Plugin or Get Source (getMapDownloadURL.sma - 1040 views - 2.8 KB)
Hupio is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 02-10-2009 , 22:33   Re: Custom Map URL prompt
Reply With Quote #8

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?
Mlk27 is offline
Hupio
Junior Member
Join Date: Feb 2009
Location: York, UK
Old 02-11-2009 , 10:18   Re: Custom Map URL prompt
Reply With Quote #9

Nice idea, how do I format the URL so that it works as a link though?
Hupio is offline
Hupio
Junior Member
Join Date: Feb 2009
Location: York, UK
Old 02-11-2009 , 10:55   Re: Custom Map URL prompt
Reply With Quote #10

OK it's html, I didn't know that.
Hupio is offline
Reply


Thread Tools
Display Modes

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 23:06.


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