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.


All times are GMT -4. The time now is 20:18.

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