Raised This Month: $114 Target: $400
 28% 

Random Skies


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   Hawk552 (427)
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 02-21-2009 , 17:29   Random Skies
Reply With Quote #1

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
[IMG]http://img22.**************/img22/6010/65381564.th.png[/IMG]
After a restart
[IMG]http://img16.**************/img16/7215/41732585.th.png[/IMG]
After another restart
[IMG]http://img16.**************/img16/8630/40075091.th.png[/IMG]


Attached Files
File Type: sma Get Plugin or Get Source (randomskies.sma - 1835 views - 812 Bytes)
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx


Last edited by tuty; 02-28-2012 at 12:35.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-21-2009 , 18:21   Re: Random Skies
Reply With Quote #2

Nice Idea btw

Last edited by fysiks; 02-22-2009 at 02:35.
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-21-2009 , 18:59   Re: Random Skies
Reply With Quote #3

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))]);
    }

__________________
- tired and retired -
ConnorMcLeod is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 02-22-2009 , 02:40   Re: Random Skies
Reply With Quote #4

yeah, but in plugin_precache() the sky will change after map end?

EDIT:


Code:
Include amxmisc increase your plugin size.
I use amxx studio and is automatically included. I forgot to remove it..
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx


Last edited by tuty; 02-22-2009 at 02:47.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-22-2009 , 02:44   Re: Random Skies
Reply With Quote #5

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.
fysiks is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 02-22-2009 , 03:07   Re: Random Skies
Reply With Quote #6

I updated the plugin, but connor, your version doesn't work because i tested it... my version now, should work fine 4 all players
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx

tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 02-22-2009 , 05:25   Re: Random Skies
Reply With Quote #7

Good idea and well done
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-22-2009 , 06:39   Re: Random Skies
Reply With Quote #8

Quote:
Originally Posted by tuty View Post
I use amxx studio and is automatically included. I forgot to remove it..
I think if you use pawn studio you can configure wheter you include it or not by default.
__________________
- tired and retired -
ConnorMcLeod is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-22-2009 , 08:21   Re: Random Skies
Reply With Quote #9

@ fysiks d-o made on like this long ago for dod, you should check that out
__________________
Dr.G is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-22-2009 , 16:52   Re: Random Skies
Reply With Quote #10

Nice.
PS: Poate il fac eu din nou ^^ glumesc
__________________

anakin_cstrike is offline
Reply


Thread Tools
Display Modes

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 17:41.


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