Ceata

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

21 Jul 2012, 14:39

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

// constats
new const PLUGIN_NAME[] = "Rain Events";
new const PLUGIN_VERSION[] = "0.1";
new const PLUGIN_AUTHOR[] = "SAMURAI";

new const sCommand[] = "cl_weather 0";

#define MAX_TIME 180

// pcvars;
new pcvar[3];
new gcount = 0;

/********************************************************/
/***************** AMXMODX Plugin ***********************/
/********************************************************/

// stocks
stock samurai_create_ent(const classname[])
{
    // return create a entity called "classname"
    return engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, classname));
}



stock set_keyvalue(ent, key[], value[]) 
{
    new classname[32];
    pev(ent, pev_classname, classname, 31);
    set_kvd(0, KV_ClassName, classname);
    set_kvd(0, KV_KeyName, key);
    set_kvd(0, KV_Value, value);
    set_kvd(0, KV_fHandled, 0);
    dllfunc(DLLFunc_KeyValue, ent, 0);
}




/************** Plugin Precache Forward *****************/
public plugin_precache()
{
    // register the plugin
    register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
    
    // register cvars :
    pcvar[0] = register_cvar("enable_rain","1");
    pcvar[1] = register_cvar("enable_fog","1");

    
    if(get_pcvar_num(pcvar[0]) == 1) {
        // create a env_rain entity
        samurai_create_ent("env_rain");
    }
    
    static fog;
    // create a env_fog entity
    fog = samurai_create_ent("env_fog");
    
    switch(get_pcvar_num(pcvar[1])) {
        case 1:
        {
            // FOG OWNZ
            set_keyvalue(fog,"density","0.001");
            set_keyvalue(fog,"rendercolor","28 28 28");
        }
        
        case 2:
        {
            set_task(300.0,"task_fog",fog+1111,_,_,"a",8);
            set_task(1.0,"task_fog",0,"",0,"b");
        }
    }
            
    
}

/************** Client Connect Forward *******************/
public client_connect(id)
{
    client_cmd(id,"cl_weather 1");
}


/*************** Client Putinserver ***********************/
public client_putinserver(id)
{
    set_task(10.0,"task_display_msg",id);
    
    
}

public task_display_msg(id)
{
    if(is_user_connected(id) ) {
        client_print(id,print_chat,"Pentru a opri ploaia, scrie %s in consola", sCommand);
    }
}


public task_fog(taskid)
{
    new ent = taskid - 1111;
    
    if(gcount < MAX_TIME)
    {
        // AGAIN FOG OWNZ
        set_keyvalue(ent,"density","0.001");
        set_keyvalue(ent,"rendercolor","28 28 28");
    }
    
    else if(gcount >= MAX_TIME)
    {
        // remove the fucking fog entity
        engfunc(EngFunc_RemoveEntity,ent);
        
        gcount = 0;
        
    
    }
        
    gcount += 1;
    
}
Modifici din linia:
| Afiseaza codul
set_keyvalue(ent,"rendercolor","28 28 28");
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
ik1d0x@redfear.ro
Aen
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2054
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1131 times
Contact:

22 Jul 2012, 15:25

""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 19 guests