AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Random Skies (https://forums.alliedmods.net/showthread.php?t=86156)

tuty 02-21-2009 16:29

Random Skies
 
1 Attachment(s)
Random Skies
version 1.1

Description:

- On map end or server restart, the server sky will change.

Cvars:

- sv_skies_mode:

0 - if is set to 0, will remain the default map skyname.
1 - if is set to 1, the sky will change on map end or server restart.

Note!:

- Updated to version 1.1
- thanks Connor

Images:

Before a restart :arrow:
[IMG]http://img22.**************/img22/6010/65381564.th.png[/IMG]
After a restart :arrow:
[IMG]http://img16.**************/img16/7215/41732585.th.png[/IMG]
After another restart :arrow:
[IMG]http://img16.**************/img16/8630/40075091.th.png[/IMG]



fysiks 02-21-2009 17:21

Re: Random Skies
 
Nice Idea btw

ConnorMcLeod 02-21-2009 17:59

Re: Random Skies
 
You should set the cvar in plugin_precache function.
Your random should start from 0, not 1, and the rand variable is useless since you use it only 1 time.
Hardcode skies size prevents user from disabling some skies names, you don't need to specify the since as it's a const, you can use sizeof or charsmax in your code.
Include amxmisc increase your plugin size.

PHP Code:

#include <amxmodx>

#define PLUGIN "Random Skies"
#define VERSION "1.0"
#define AUTHOR "tuty"

new const skies[][] = {

    
"2desert""alien1""alien2""alien3""black",
    
"city""cliffe""desert""dusk""morning"
    
"neb1""neb6""neb7""night""space",
    
"xen10""xen8""xen9""night""black",
    
"green""blue""backalley""city1""morningdew",
    
"hav""cliff""office""grnplsnt""tornsky",
    
"doom1""cx""de_storm""snowlake_""tornsky",
    
"trainyard""tsccity_""snow""2desert""des"
};

public 
plugin_precache()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    new 
PluginMode register_cvar("sv_skies_mode""1"); // 0 - disabled, 1 - random skies

    
if( get_pcvar_num(PluginMode) )
    {
        
set_cvar_string("sv_skyname"skies[random_num(0charsmax(skies))]);
    }



tuty 02-22-2009 01:40

Re: Random Skies
 
yeah, but in plugin_precache() the sky will change after map end? :shock:

EDIT:


Code:

Include amxmisc increase your plugin size.
I use amxx studio and is automatically included. I forgot to remove it..:oops:

fysiks 02-22-2009 01:44

Re: Random Skies
 
I think it would change it for the current map but I'm not sure. At the begining or at the end shouldn't really matter except the very first boot of the server won't be random if it changes it at the end.

tuty 02-22-2009 02:07

Re: Random Skies
 
I updated the plugin, but connor, your version doesn't work because i tested it... my version now, should work fine 4 all players :crab:

crazyeffect 02-22-2009 04:25

Re: Random Skies
 
Good idea and well done :D

ConnorMcLeod 02-22-2009 05:39

Re: Random Skies
 
Quote:

Originally Posted by tuty (Post 766437)
I use amxx studio and is automatically included. I forgot to remove it..:oops:

I think if you use pawn studio you can configure wheter you include it or not by default.

Dr.G 02-22-2009 07:21

Re: Random Skies
 
@ fysiks d-o made on like this long ago for dod, you should check that out

anakin_cstrike 02-22-2009 15:52

Re: Random Skies
 
Nice.
PS: Poate il fac eu din nou ^^ glumesc :P


All times are GMT -4. The time now is 07:35.

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