AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Next Map (https://forums.alliedmods.net/showthread.php?t=206243)

Artifact 01-20-2013 04:56

Next Map
 
Hello guys, again me, can someone show me how to get random map for nextmap?

AngeIII 01-20-2013 06:26

Re: Next Map
 
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.

fysiks 01-20-2013 13:47

Re: Next Map
 
Quote:

Originally Posted by AngeIII (Post 1876723)
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).

AngeIII 01-20-2013 13:53

Re: Next Map
 
ok, my fail. sorry;]

Artifact 01-20-2013 17:41

Re: Next Map
 
hm, I dont know to work with 'read file' codes, can some tut about this :3

fysiks 01-20-2013 18:08

Re: Next Map
 
Quote:

Originally Posted by Artifact (Post 1877066)
hm, I dont know to work with 'read file' codes, can some tut about this :3

Look at existing examples that already do what you are trying to do. MapChooser already does exactly what you want to do.

Artifact 01-20-2013 19:06

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

fysiks 01-20-2013 20:03

Re: Next Map
 
Quote:

Originally Posted by Artifact (Post 1877115)
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.


All times are GMT -4. The time now is 13:31.

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