This good way to change sky of map?

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
7
Реакции
0
Hello !

I just want to know, is this a good way to replace the map sky with our sky? [Check Code]
Because when I play on Zombie Escape servers, the game downloads the sky files from the server, and when I join the server, I see another sky and in all the maps, that is, the sky files were downloaded and not used.
I found a way, but it takes time and I have to delete the “skyname” key from the “.ent” file every time I want to add a new map


Код:
new g_iFwSpawn

public plugin_precache()
{
    if (g_szSkyName[0])
    {
        precache_sky(szSkyName)
        
        //set_cvar_string("sv_skyname", szSkyName)
    }

    // FakeMeta.
    g_iFwSpawn = register_forward(FM_Spawn, "fw_Spawn_Pre")
}

public plugin_init()
{
    // Load Plug-In.
    register_plugin("[ZE] Effects: Weather", ZE_VERSION, ZE_AUTHORS)

    // Disable Hook.
    unregister_forward(FM_Spawn, g_iFwSpawn)

    // Disable some Cvars.
    set_cvar_num("sv_skycolor_r", 0)
    set_cvar_num("sv_skycolor_g", 0)
    set_cvar_num("sv_skycolor_b", 0)
}

public fw_Spawn_Pre(iEnt)
{
    // WorldSpawn?
    if (!iEnt)
    {
        // Set skyname.
        DispatchKeyValue(iEnt, "skyname", g_szSkyName)
    }

    return FMRES_IGNORED
}
 
Сообщения
130
Реакции
7
No, this here is the plugin !!!
Код:
#include <amxmodx>

#pragma semicolon 1

new const SKYNAME[] = "snow"; // skybox name

new g_SkyName;

public plugin_precache() {
    register_plugin("Sky change helper", "0.1", "AMXX.Shop");
    new const SKYNAME_POSTFIXES[][] = {"bk", "dn", "ft", "lf", "rt", "up"};
    new Buffer[96];
    for(new i; i < sizeof SKYNAME_POSTFIXES; i++) {
        formatex(Buffer, charsmax(Buffer), "gfx/env/%s%s.tga", SKYNAME, SKYNAME_POSTFIXES[i]);
        if(!file_exists(Buffer)) {
            format(Buffer, charsmax(Buffer), "File ^"%s^" not found", Buffer);
            set_fail_state(Buffer);
        }
        precache_generic(Buffer);
    }
    g_SkyName = get_cvar_pointer("sv_skyname");
}

public plugin_cfg() {
    set_pcvar_string(g_SkyName, SKYNAME);
}
Put it on each map separately with a different sky if you want.
I will provide the plugin with a config file in a while, but I can't say when at all. I've been interested in pawn recently and besides, I have a lot of work to do...
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу