AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   AMX Random Map - Version 1.1 [8/31/09] (https://forums.alliedmods.net/showthread.php?t=102250)

BOYSplayCS 08-31-2009 09:23

AMX Random Map - Version 1.1 [8/31/09]
 
1 Attachment(s)
AMX Random Map v1.1
BOYSplayCS

Description:

Admins can now use a single command to randomly change the map. It works by the plugin reading all the lines from the file 'mapcycle.txt' and then randomly choosing one.


Admin Commands:

  • amx_random_map (Required: ADMIN_MAP)
    • Important Note: Make sure there are maps listed inside your mapcycle.txt or nothing will happen.

Requirements:

  • AMX Mod X (version 1.8.1 or higher)

Credits:

  • Exolent - Major Coding Help
  • Arkshine - Coding Help

Changelog:
  • Version 1.0
    • Initial Release.
  • Version 1.1
    • Added FCVAR_SERVER and FCVAR_SPONLY for tracking.
    • Removed having to type '1' after amx_random_map.
    • Added fclose() to close the reading of the file.
    • Optimized code.

Installation Help:

* Place amx_random_map.amxx in your \account-name\counter-strike\cstrike\addons\amxmodx\plugins folder.

* Add amx_random_map.amxx to your plugins.ini file.

Arkshine 08-31-2009 09:32

Re: AMX Random Map - Version 1.0 [8/31/09]
 
Why 1 ? Is not amx_random_map enough ?!

Also, you forget to close the file after usage.

zacky 08-31-2009 09:57

Re: AMX Random Map - Version 1.0 [8/31/09]
 
And what if you use maps.ini? o.0

BOYSplayCS 08-31-2009 10:17

Re: AMX Random Map - Version 1.0 [8/31/09]
 
Quote:

Originally Posted by Arkshine (Post 918833)
Why 1 ? Is not amx_random_map enough ?!

Also, you forget to close the file after usage.

Because, if you just use amx_random_map then you'll get a "Access Denied" error, the 1 is a must.

I'll close the file in the next version.

Quote:

Originally Posted by zacky (Post 918855)
And what if you use maps.ini? o.0

I'll add a maps.ini seperate plugin once I release v1.1

Arkshine 08-31-2009 10:19

Re: AMX Random Map - Version 1.0 [8/31/09]
 
Then in cmd_access(), change 2 by 1... Are you sure it's you who have written the plugin ? :mrgreen:

Quote:

I'll add a maps.ini seperate plugin once I release v1.1
Just make a cvar so people can provide the file used.

BOYSplayCS 08-31-2009 10:22

Re: AMX Random Map - Version 1.0 [8/31/09]
 
Quote:

Originally Posted by Arkshine (Post 918874)
Then in cmd_access(), change 2 by 1... Are you sure it's you who have written the plugin ? :mrgreen:



Just make a cvar so people can provide the file used.

Oh, really? I never looked up how to use cmd_access(), so don't blame me haha. Also, I wrote the original, non-working plugin and Exolent wrote the working version.

BOYSplayCS 08-31-2009 10:49

Re: AMX Random Map - Version 1.1 [8/31/09]
 
Update: Uploaded new version (1.1) and fixed a few bugs. See changelog.

To-Do:
Add cvar to switch between mapcycle.txt and maps.ini

Arkshine 08-31-2009 11:07

Re: AMX Random Map - Version 1.1 [8/31/09]
 
File is not close in if (!iFile) {} and if (!iTotal) {}

and the client_print saying "[AMXX] Access Denied blabla" is pointless since you have already such message when you use cmd_access().

Quote:

Add cvar to switch between mapcycle.txt and maps.ini
Just to note that it may another file than these ones. It should be a cvar to specify a map cycle file name, not a switch between 2 files.

Alucard^ 08-31-2009 22:01

Re: AMX Random Map - Version 1.1 [8/31/09]
 
Also you can add a cvar that when the first map end, the next map is RANDOM... obviusly you have to advertise ppl to pause plugins like mapchooser, galileo, etc..

And yes, like Arkshine said... in cmd_acces the number "2" means the COMMAND and the VALUE, so if you use number "1" you are only using the COMMAND.

xPaw 09-01-2009 04:27

Re: AMX Random Map - Version 1.1 [8/31/09]
 
register_cvar("amx_random_map", "1.1", FCVAR_SERVER | FCVAR_SPONLY);

-> :mrgreen:

register_cvar("amx_random_map", VERSION, FCVAR_SERVER | FCVAR_SPONLY);

And remove
PHP Code:

else
        
client_print(idprint_chat"[AMXX] Access Denied || Correct Usage: amx_random_map"); 

cmd_access already prints denied msg..

EDIT: @Arkshine: you said close file in if (!iFile) {}, its even not opened.. iFile is 0.


All times are GMT -4. The time now is 17:09.

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