Raised This Month: $ Target: $400
 0% 

Next Map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 01-20-2013 , 04:56   Next Map
Reply With Quote #1

Hello guys, again me, can someone show me how to get random map for nextmap?
__________________
Artifact is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-20-2013 , 06:26   Re: Next Map
Reply With Quote #2

read your maps file, for example maps.ini, fill the array, and with random_num(array_size), get next map.. see how work amx_nextmap, mapchooser plugins.
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-20-2013 , 13:47   Re: Next Map
Reply With Quote #3

Quote:
Originally Posted by AngeIII View Post
read your maps file, for example maps.ini, fill the array, and with random_num(array_size), get next map.. see how work amx_nextmap, mapchooser plugins.
Stop using random_num()! It is not correct. When you want to index an array randomly, use random(array_size).
__________________
fysiks is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-20-2013 , 13:53   Re: Next Map
Reply With Quote #4

ok, my fail. sorry;]
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
Artifact
Veteran Member
Join Date: Jul 2010
Old 01-20-2013 , 17:41   Re: Next Map
Reply With Quote #5

hm, I dont know to work with 'read file' codes, can some tut about this
__________________
Artifact is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-20-2013 , 18:08   Re: Next Map
Reply With Quote #6

Quote:
Originally Posted by Artifact View Post
hm, I dont know to work with 'read file' codes, can some tut about this
Look at existing examples that already do what you are trying to do. MapChooser already does exactly what you want to do.
__________________
fysiks is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 01-20-2013 , 19:06   Re: Next Map
Reply With Quote #7

I know, but this is big code, and cant learn too much from then, I just need simple tut :p
__________________

Last edited by Artifact; 01-20-2013 at 19:06.
Artifact is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-20-2013 , 20:03   Re: Next Map
Reply With Quote #8

Quote:
Originally Posted by Artifact View Post
I know, but this is big code, and cant learn too much from then, I just need simple tut :p
It's not really all that big of code actually and it's really easy to find what you are looking for. Hint: It initially tries to load from maps.ini.
__________________

Last edited by fysiks; 01-20-2013 at 20:03. Reason: typo fix
fysiks 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 13:31.


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