Raised This Month: $32 Target: $400
 8% 

How to get map description


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
731
Member
Join Date: Aug 2006
Old 10-01-2022 , 13:28   How to get map description
Reply With Quote #1

How to get map descriptions in other plugins
use amx_nextmap Only maps name can be obtained
How should I read the selected map description

as_oilrig "OilRig - Assassination"
as_tundra "TunDra - Assassination"
cs_747 "747 hijack - Hostage rescue"
cs_assault "Assault - Hostage rescue"
cs_backalley "Alleyway - Hostage rescue"
cs_downed_cz "Downed CZ - Hostage rescue"
cs_estate "Zaphod's estate - Hostage rescue"
cs_havana "Havana - Hostage rescue"
cs_havana_cz "Havana CZ - Hostage rescue"
cs_italy "Italy - Hostage rescue"
cs_italy_cz "Italy CZ - Hostage rescue"
cs_militia "Militia - Hostage rescue"
cs_militia_cz "Militia CZ - Hostage rescue"
cs_office "Office - Hostage rescue"
cs_office_cz "Office CZ - Hostage rescue"
cs_siege "Canyon siege - Hostage rescue"
de_airstrip "Airstrip - Bomb/Defuse"
de_airstrip_cz "Airstrip CZ - Bomb/Defuse"
de_aztec "Aztec - Bomb/Defuse"
de_aztec_cz "Aztec CZ - Bomb/Defuse"
de_cbble "Cobble - Bomb/Defuse"
de_cbble_cz "Cobble CZ - Bomb/Defuse"
de_chateau "Chateau - Bomb/Defuse"
de_chateau_cz "Chateau CZ - Bomb/Defuse"
de_corruption_cz "Corruption CZ - Bomb/Defuse"
de_dust "Dust - Bomb/Defuse"
de_dust_cz "Dust CZ - Bomb/Defuse"
de_dust2 "Dust II - Bomb/Defuse"
de_dust2_cz "Dust II CZ - Bomb/Defuse"
de_fastline_cz "Fastline CZ - Bomb/Defuse"
de_inferno "Inferno - Bomb/Defuse"
de_inferno_cz "Inferno CZ - Bomb/Defuse"
de_nuke "Nuke - Bomb/Defuse"
de_piranesi "Piranesi - Bomb/Defuse"
de_piranesi_cz "Piranesi CZ - Bomb/Defuse"
de_prodigy "Prodigy - Bomb/Defuse"
de_prodigy_cz "Prodigy CZ - Bomb/Defuse"
de_sienna_cz "Sienna CZ - Bomb/Defuse"
de_stadium_cz "Stadium CZ - Bomb/Defuse"
de_storm "Storm - Bomb/Defuse"
de_survivor "Survivor - Bomb/Defuse"
de_tides_cz "Tides CZ - Bomb/Defuse"
de_torn "Torn - Bomb/Defuse"
de_torn_cz "Torn CZ - Bomb/Defuse"
de_train "Trainyard - Bomb/Defuse"
de_truth_cz "Truth CZ - Bomb/Defuse"
de_vegas "Vegas - Bomb/Defuse"
de_vertigo "Vertigo - Bomb/Defuse"
de_vostok_cz "Vostok CZ - Bomb/Defuse"
731 is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-01-2022 , 20:15   Re: How to get map description
Reply With Quote #2

what do you mean?? can you please be more specific ...

like read the .txt file of the map? i dont get it
__________________
deprale is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-01-2022 , 21:46   Re: How to get map description
Reply With Quote #3

When the next map is chosen (presumably in your map manager), you could read the description file to get the description of the next map and then add that onto whatever you're using to display the next map name.

There are several resources around here for reading from and parsing a file (check out the tutorials section).
__________________

Last edited by fysiks; 10-01-2022 at 21:47.
fysiks is offline
731
Member
Join Date: Aug 2006
Old 10-03-2022 , 03:44   Re: How to get map description
Reply With Quote #4

mapchooser and mapsmenu I know how to read the map description
I just want to know how to get the map description in the following code

PHP Code:
new nextmap[32
get_cvar_string("amx_nextmap",nextmap,31)
client_print_color(id,id,"^3Next Map: ^4%s",nextmap
731 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-04-2022 , 01:00   Re: How to get map description
Reply With Quote #5

Read the map descriptions into arrays (or even better a Trie with the map name as the key which will be simpler and more efficient than trying to use arrays) and then you can look up the description for the map and add it to your print function.

There are many plugins using Tries and I found a tutorial thread that gives an example using TrieSetString() and TrieGetSTring(). Let us know if you have questions or need help. Please post your code when you run into issues so we can better assist you.
__________________
fysiks is offline
731
Member
Join Date: Aug 2006
Old 10-04-2022 , 01:16   Re: How to get map description
Reply With Quote #6

Can you write a code tutorial on how to get descriptions
I just want to read the map description from maps.ini in other code

Last edited by 731; 10-04-2022 at 01:27. Reason: explain
731 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-04-2022 , 22:54   Re: How to get map description
Reply With Quote #7

This tutorial shows how to set the set and get with TrieSetString and TrieGetString. That should be about all you need since you say you can read the data from the file.
__________________

Last edited by fysiks; 10-04-2022 at 23:17.
fysiks is offline
731
Member
Join Date: Aug 2006
Old 10-04-2022 , 23:33   Re: How to get map description
Reply With Quote #8

I'll try first. If there's anything I don't understand, I'll ask you
731 is offline
Reply



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 10:44.


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