Raised This Month: $32 Target: $400
 8% 

Rain or snow on your map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MMYTH
BANNED
Join Date: May 2010
Location: Brazil
Old 07-15-2010 , 06:54   Rain or snow on your map
Reply With Quote #1

Well, I apologize for previous posts (confection that I lost my mind) sorry,
let's start the explanation.

First let's add two libraries:
PHP Code:
/* Default Library */
#include <amxmodx>
/* Library function of climate and other things */
#include <fakemeta> 
Then obviously we'll add climate (remembering that for every minute funcar map will register the function in precache):
PHP Code:
public plugin_precache()
{
        
/* rain */
        //engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_rain"))
        /* snow */
        //engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"))

more I want to know how to connect them?
PHP Code:
public plugin_precache()
{
        
/* Just remove the // front */
        // If I want to rain so I'll leave the map
        
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"))
}

//-----------------

// But if you want only snow on the map, place the other function
public plugin_precache()
{
        
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_snow"))

After that we will register the plugin as weather map:
PHP Code:
public plugin_init()
{
        
register_plugin("Weather Map""1.0""MMYTH")

Final Score:
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_precache()
{
        
/* Rain */
        
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"))
        
/* Snow */
        //engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"))
}

public 
plugin_init()
{
        
register_plugin("Weather Map""1.0""MMYTH")

can use too with engine:
PHP Code:
#include <amxmodx>
#include <engine>

public plugin_precache()
{
    
/* Rain */
    
create_entity("env_rain")
    
/* Snow */
    // create_entity("env_snow")
}

public 
plugin_init()
{
    
register_plugin("Weather Map""1.0""MMYTH")

============

I did also you talk to do but don't have rain or snow
Tipe in your console:
PHP Code:
cl_weather 1 

Last edited by MMYTH; 07-16-2010 at 08:09.
MMYTH is offline
Send a message via MSN to MMYTH
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-15-2010 , 07:56   Re: Rain or snow on your map
Reply With Quote #2

I think you can do :

Code:
public plugin_precache() {       create_entity("env_rain")    // create_entity("env_snow") }
__________________
You can do anything you set your mind to, man.

Devil259 is offline
MMYTH
BANNED
Join Date: May 2010
Location: Brazil
Old 07-15-2010 , 08:00   Re: Rain or snow on your map
Reply With Quote #3

Quote:
Originally Posted by Devil259 View Post
I think you can do :

Code:
public plugin_precache() { create_entity("env_rain") // create_entity("env_snow") }
i never test this, is a good idea
he needs the library engine
MMYTH is offline
Send a message via MSN to MMYTH
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-15-2010 , 08:46   Re: Rain or snow on your map
Reply With Quote #4

Using engine will be easier for beginners to understand
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
MMYTH
BANNED
Join Date: May 2010
Location: Brazil
Old 07-15-2010 , 09:13   Re: Rain or snow on your map
Reply With Quote #5

thanks
MMYTH is offline
Send a message via MSN to MMYTH
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-15-2010 , 09:21   Re: Rain or snow on your map
Reply With Quote #6

No problem, i have tested it and it work
__________________
You can do anything you set your mind to, man.

Devil259 is offline
snowyledge
BANNED
Join Date: Dec 2009
Old 07-15-2010 , 23:13   Re: Rain or snow on your map
Reply With Quote #7

Nice tutorial.
snowyledge is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-16-2010 , 03:32   Re: Rain or snow on your map
Reply With Quote #8

Also specify about the game cvar, "cl_weather" that may be 0 and will be no snow/rain.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-16-2010 , 06:43   Re: Rain or snow on your map
Reply With Quote #9

You can set this cvar on 3 at the connection.

Code:
public client_connect(id) {     client_cmd(id, "cl_weather 3") }
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 07-16-2010 at 08:32.
Devil259 is offline
MMYTH
BANNED
Join Date: May 2010
Location: Brazil
Old 07-16-2010 , 08:09   Re: Rain or snow on your map
Reply With Quote #10

thanksē
MMYTH is offline
Send a message via MSN to MMYTH
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 11:50.


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