Help CSDM spawns problem

Midnight1337

Пользователь
Регистрация
8 Дек 2018
Сообщения
72
Симпатии
10
OS
Linux
Amx Mod X
AMXX 1.10.0
Билд
ReHLDS version: 3.7.0.706-dev Build date: 07:17:37 Oct 24 2020 (2387)
ReGamedll
ReGameDLL version: 5.18.0.474-dev Build date: 11:07:34 Jul 16 2020
Metamod
Metamod-r v1.3.0.128, API (5:13) Metamod-r build: 17:47:54 Aug 24 201
Meta модули
Код:
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5406 ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 3] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 4] MySQL RUN - mysql_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
[ 5] CSX RUN - csx_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
[ 6] ReAPI RUN - reapi_amxx_i386.so v5.15.0.197-dev pl1 ANY Never
[ 7] Engine RUN - engine_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
[10] Fun RUN - fun_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5402 pl1 ANY ANY
11 plugins, 11 running
Плагины
Код:
Currently loaded plugins:
id name version author url file status
[ 1] 0 Admin Loader 1.3 neugomon admin_loade running
[ 2] 1 Element Bans 2.3 mIDnight element_ban running
[ 3] 2 Admin Commands Colored 1.10.0.540 AMXX Dev Team admincmd.am running
[ 4] 3 Server AMXMODMENU [INI 1.0 Leo_[BH] amxmodmenu. running
[ 5] 4 Players Menu 1.7 neugomon players_men running
[ 6] 5 Element Admin ESP 1.0 mIDnight ele_admines running
[ 7] 6 Element GAG 0.1 mIDnight element_gag running
[ 8] 7 Std Admin Color Chat 1.1.1 Van der Cal unknown cyber_admin running
[ 9] 8 Ultimate Chat 1.2 [ --<-@ ] ultimate_ch running
[ 10] 9 Autoresponder/Advertis 0.5 MaximusBrood ad_manager. running

[ 11] 10 ResetScore 0.1 mIDnight rs_scoredm. running
[ 12] 11 AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_ running
[ 13] 12 CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sq running
[ 14] 13 [ReAPI] No name change 1.2 mIDnight renonamecha running
[ 15] 14 Auto join on connect 1.0 mIDnight auto_join_o running
[ 16] 15 Spectator Bots 1.0 mIDnight spectator_b running
[ 17] 16 RankLevelXPSystem 1.0 Supremache RankSystem. running
[ 18] 17 Frag Counter 1.0 RateX killscounte running
[ 19] 18 Vampire 1.0 Shalfey vampire.amx running
[ 20] 19 ReCSDM Spawns re ReCSDM Team csdm_spawn_ running
[ 21] 20 CSDM Weapons Menu 1.0 mIDnight weapons.amx debug

[ 22] 21 Refill Weapon On Kill 0.0.1 Vaqtincha refill_weap running
22 plugins, 22 running
Amxx Модули
Код:
Currently loaded modules:
name version author status
MySQL 1.10.0.540 AMX Mod X Dev Team running
CSX 1.10.0.540 AMX Mod X Dev Team running
ReAPI 5.15.0.197 Asmodai & s1lent running
Engine 1.10.0.540 AMX Mod X Dev Team running
CStrike 1.10.0.540 AMX Mod X Dev Team running
FakeMeta 1.10.0.540 AMX Mod X Dev Team running
Fun 1.10.0.540 AMX Mod X Dev Team running
nVault 1.10.0.540 AMX Mod X Dev Team running
Ham Sandwich 1.10.0.540 AMX Mod X Dev Team running
RegEx 1.10.0.540 AMX Mod X Dev Team running
10 module
Ошибка
Код:
.
I have problem with this plugin, max spawns is defined on 60 i have added 45 spawns, but can only 20 players join in team others stay in spectators

humans_join_team "ct" is enabled all player joining at ct

Код:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <reapi>

#pragma semicolon 1

#define MAX_SPAWNS 60

new PLUGINNAME[] = "ReCSDM Spawns";
new VERSION[] = "re";
new AUTHORS[] = "ReCSDM Team";

new g_MainMenu[] = "Spawn point manager";
new g_MainMenuID = -1;
new g_cMain;

new g_AddSpawnsMenu[] = "The menu for adding spawn points";
new g_AddSpawnsMenuID;
new g_cAddSpawns;

new g_SpawnVecs[MAX_SPAWNS][3];
new g_SpawnAngles[MAX_SPAWNS][3];
new g_SpawnVAngles[MAX_SPAWNS][3];
new g_SpawnTeam[MAX_SPAWNS];
new g_TotalSpawns = 0;
new g_Ents[MAX_SPAWNS];
new g_Ent[33];
new g_iszInfoTarget;
new Float:red[3] = {255.0,0.0,0.0};
new Float:yellow[3] = {255.0,200.0,20.0};


public plugin_init()
{
    register_plugin(PLUGINNAME,VERSION,AUTHORS);

    register_concmd("edit_spawns", "showmen", ADMIN_MAP, "Editing the spawn point configuration");
    RegisterHookChain(RG_CSGameRules_GetPlayerSpawnSpot , "CSGameRules_GetPlayerSpawnSpot", true);
   
    g_iszInfoTarget = engfunc(EngFunc_AllocString, "info_target");
}

public plugin_cfg()
{
    readSpawns();
}

readSpawns()
{
    new Map[32], config[32],  MapFile[256];

    get_mapname(Map, charsmax(Map));
    get_configsdir(config, charsmax(config));
    formatex(MapFile, charsmax(MapFile), "%s\csdm\%s.spawns.cfg", config, Map);

    g_TotalSpawns = 0;

    if (file_exists(MapFile))
    {
        new Data[124], pos[12][8], len, line;

        while(g_TotalSpawns < MAX_SPAWNS && (line = read_file(MapFile, line, Data, charsmax(Data), len)) != 0)
        {
            if (Data[0] == '[' || strlen(Data) < 2) {
                continue;
}

            parse(Data, pos[1], 7, pos[2], 7, pos[3], 7, pos[4], 7, pos[5], 7, pos[6], 7, pos[7], 7, pos[8], 7, pos[9], 7, pos[10], 7);

            g_SpawnVecs[g_TotalSpawns][0] = str_to_num(pos[1]);
            g_SpawnVecs[g_TotalSpawns][1] = str_to_num(pos[2]);
            g_SpawnVecs[g_TotalSpawns][2] = str_to_num(pos[3]);

            g_SpawnAngles[g_TotalSpawns][0] = str_to_num(pos[4]);
            g_SpawnAngles[g_TotalSpawns][1] = str_to_num(pos[5]);
            g_SpawnAngles[g_TotalSpawns][2] = str_to_num(pos[6]);

            g_SpawnTeam[g_TotalSpawns] = str_to_num(pos[7]);

            g_SpawnVAngles[g_TotalSpawns][0] = str_to_num(pos[8]);
            g_SpawnVAngles[g_TotalSpawns][1] = str_to_num(pos[9]);
            g_SpawnVAngles[g_TotalSpawns][2] = str_to_num(pos[10]);

            g_TotalSpawns++;
        }
}

    if (g_TotalSpawns) {
        log_amx("Loaded %d spawn points for map %s.", g_TotalSpawns, Map);
    } else {
        log_amx("No spawn points file found (%s)", MapFile);
    }

    return 1;
}

public CSGameRules_GetPlayerSpawnSpot(id) {
    if (g_TotalSpawns < 2)
        return HC_CONTINUE ;

    new players[32], n, x, num, locnum, final = -1;
    new Float:loc[32][3];
    new Float:FSpawnVecs[3];
    new Float:FSpawnAngles[3];
    new Float:FSpawnVAngles[3];

    get_players(players, num);

    for (new i = 0; i < num; i++)
    {
        if (is_user_alive(players[i])) {
            pev(players[i], pev_origin, loc[locnum]);
            locnum++;
        }
}

    num = 0;

    n = random_num(0, g_TotalSpawns - 1);

    while (num <= g_TotalSpawns)
    {
        if (num == g_TotalSpawns) {
            break;
}

        if (n < g_TotalSpawns - 1) {
            n++;
        } else {
            n = 0;
        }

        num++;

        final = n;
        IVecFVec(g_SpawnVecs[n], FSpawnVecs);

        for (x = 0; x < locnum; x++)
        {
            new Float:distance = get_distance_f(FSpawnVecs, loc[x]);

            if (distance < 500.0) {
                final = -1;
                break;
}
}

        if (final == -1) {
            continue;
}

        if (locnum < 1 || final != -1) {
            break;
}
}

    if (final != -1)
    {
        new Float:mins[3], Float:maxs[3];

        IVecFVec(g_SpawnVecs[final], FSpawnVecs);
        IVecFVec(g_SpawnAngles[final], FSpawnAngles);
        IVecFVec(g_SpawnVAngles[final], FSpawnVAngles);

        pev(id, pev_mins, mins);
        pev(id, pev_maxs, maxs);

        engfunc(EngFunc_SetSize, id, mins, maxs);
        engfunc(EngFunc_SetOrigin, id, FSpawnVecs);

        set_pev(id, pev_fixangle, 1);
        set_pev(id, pev_angles, FSpawnAngles);
        set_pev(id, pev_v_angle, FSpawnVAngles);
        set_pev(id, pev_fixangle, 1);

        return HC_SUPERCEDE;
    }

    return HC_CONTINUE ;
}


buildMenu() {
    g_MainMenuID = menu_create(g_MainMenu, "m_MainHandler");

    g_cMain = menu_makecallback("c_Main");

    menu_additem(g_MainMenuID, "Add current spawn position","1", 0, g_cMain);
    menu_additem(g_MainMenuID, "Edit nearest spawn point (yellow) at current position","2", 0, g_cMain);
    menu_additem(g_MainMenuID, "Remove nearest spawn point","3", 0, g_cMain);
    menu_additem(g_MainMenuID, "Refresh closest spawn point", "4", 0, g_cMain);
    menu_additem(g_MainMenuID, "Show statistics", "5", 0, -1);

    g_AddSpawnsMenuID = menu_create(g_AddSpawnsMenu, "m_AddSpawnsHandler");
    g_cAddSpawns = menu_makecallback("c_AddSpawns");

    menu_additem(g_AddSpawnsMenuID, "Add to the current position to revive everyone","1", 0, g_cAddSpawns);
    menu_additem(g_AddSpawnsMenuID, "Add current position to respawn T","2", 0, g_cAddSpawns);
    menu_additem(g_AddSpawnsMenuID, "Add current spawn position CT","3", 0, g_cAddSpawns);
    menu_additem(g_AddSpawnsMenuID, "Back","4", 0, -1);    
}

public m_MainHandler(id, menu, item) {
    if (item == MENU_EXIT) {
        ent_remove(-1);
        menu_destroy(menu);    
        return PLUGIN_HANDLED;
    }

    new cmd[6], iName[64], access, callback;

    menu_item_getinfo(menu, item, access, cmd, charsmax(cmd), iName, charsmax(iName), callback);

    switch(str_to_num(cmd))
    {
        case 1: menu_display(id, g_AddSpawnsMenuID, 0);
        case 2:
        {
            new Float:vecs[3], vec[3];
            new Float:angles[3], angle[3];
            new Float:vangles[3], vangle[3];

            pev(id, pev_origin, vecs);
            pev(id, pev_angles, angles);
            pev(id, pev_v_angle, vangles);

            FVecIVec(vecs,vec);
            FVecIVec(angles, angle);
            FVecIVec(vangles, vangle);

            vec[2] += 15;
            edit_spawn(g_Ent[id], vec, angle,vangle);
            menu_display(id, g_MainMenuID, 0);
        }
        case 3:
        {
            ent_unglow(g_Ent[id]);
            delete_spawn(g_Ent[id]);
            g_Ent[id] = closest_spawn(id);
            menu_display(id, g_MainMenuID, 0);                
        }
        case 4:
        {
            ent_unglow(g_Ent[id]);
            g_Ent[id] = closest_spawn(id);
            ent_glow(g_Ent[id], yellow);
            menu_display(id, g_MainMenuID, 0);

            new szteam[8];

            switch(g_SpawnTeam[g_Ent[id]])
            {
                case 0: formatex(szteam, charsmax(szteam), "random");
                case 1: formatex(szteam, charsmax(szteam), "T");
                case 2: formatex(szteam,charsmax(szteam), "CT");
            }

            client_print(id,print_chat,"Nearest spawn point: number %d , def: team = %s, org[%d,%d,%d], ang[%d,%d,%d], vang[%d,%d,%d]",
                g_Ent[id] + 1, szteam, g_SpawnVecs[g_Ent[id]][0], g_SpawnVecs[g_Ent[id]][1], g_SpawnVecs[g_Ent[id]][2], 
                g_SpawnAngles[g_Ent[id]][0], g_SpawnAngles[g_Ent[id]][1], g_SpawnAngles[g_Ent[id]][2], 
                g_SpawnVAngles[g_Ent[id]][0], g_SpawnVAngles[g_Ent[id]][1], g_SpawnVAngles[g_Ent[id]][2]);
        }
        case 5:
        {    
            new Float:Org[3], RD_num, TR_num, CT_num;

            pev(id, pev_origin, Org);

            for (new x = 0; x < g_TotalSpawns; x++)
            {
                if (g_SpawnTeam[x] == 0)
                    RD_num++;
                if (g_SpawnTeam[x] == 1)
                    TR_num++;
                if (g_SpawnTeam[x] == 2)
                    CT_num++;
            }

            client_print(id,print_chat,"Total points: %d; For all: %d; T: %d; CT: %d.^nOriginal: X: %f  Y: %f  Z: %f",
                g_TotalSpawns, RD_num, TR_num, CT_num, Org[0], Org[1], Org[2]);

            menu_display(id, g_MainMenuID, 0);
        }
}

    return PLUGIN_HANDLED;
}

public c_Main(id, menu, item) {
    if (item == MENU_EXIT)
        return PLUGIN_CONTINUE;

    new cmd[6], fItem[326], iName[64], access, callback;

    menu_item_getinfo(menu, item, access, cmd, charsmax(cmd), iName, charsmax(iName), callback);

    switch(str_to_num(cmd))
    {
        case 1:
        {
            if (g_TotalSpawns == MAX_SPAWNS) {
                formatex(fItem, charsmax(fItem),"Added the maximum number of spawn points");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;
            } else {
                formatex(fItem, charsmax(fItem),"Add current spawn position");
                menu_item_setname(menu, item, fItem);
                return ITEM_ENABLED;
            }
}
        case 2:
        {
            if (g_TotalSpawns < 1) {
                formatex(fItem, charsmax(fItem),"Edit Point - No Points Available");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

            } else if (g_Ents[g_Ent[id]] == 0) {
                formatex(fItem, charsmax(fItem),"Edit Point - No Points Selected");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

} else {
                formatex(fItem, charsmax(fItem),"Edit the nearest spawn point (yellow) at the current position");
                menu_item_setname(menu, item, fItem);
                return ITEM_ENABLED;
            }
}
        case 3:
        {
            if (g_TotalSpawns < 1) {
                formatex(fItem, charsmax(fItem),"Remove point - No respawn points available");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

            } else if (g_Ents[g_Ent[id]] == 0) {
                formatex(fItem, charsmax(fItem),"Delete point - no spawn points selected");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

} else {
                new iorg[3];
                get_user_origin(id, iorg);

                new distance = get_distance(iorg, g_SpawnVecs[g_Ent[id]]);

                if (distance > 200) {
                    formatex(fItem, charsmax(fItem),"Delete point - the selected point is far away");
                    menu_item_setname(menu, item, fItem);
                    return ITEM_DISABLED;

} else {
                    formatex(fItem, charsmax(fItem),"Remove nearest spawn point");
                    menu_item_setname(menu, item, fItem);
                    return ITEM_ENABLED;
                }
}
}
}

    return PLUGIN_HANDLED;
}

public m_AddSpawnsHandler(id, menu, item) {
    if (item < 0) {
        ent_remove(-1);        
        return PLUGIN_HANDLED;
    }

    new cmd[6], iName[64], access, callback;

    menu_item_getinfo(menu, item, access, cmd, charsmax(cmd), iName, charsmax(iName), callback);

    new iChoice = str_to_num(cmd);

    if (iChoice == 4) {
        menu_display (id, g_MainMenuID, 0);
        return PLUGIN_HANDLED;
    }

    new Float:vecs[3], vec[3];
    new Float:angles[3], angle[3];
    new Float:vangles[3], vangle[3];
    new team;

    switch(iChoice)
    {
        case 1: team = 0;
        case 2: team = 1;
        case 3: team = 2;
    }

    pev(id, pev_origin, vecs);
    pev(id, pev_angles, angles);
    pev(id, pev_v_angle, vangles);

    FVecIVec(vecs, vec);
    FVecIVec(angles, angle);
    FVecIVec(vangles, vangle);

    vec[2] += 15;
    add_spawn(vec, angle, vangle, team);

    menu_display (id, g_AddSpawnsMenuID, 0);

    return PLUGIN_HANDLED;
}

public c_AddSpawns(id, menu, item) {
    if (item < 0)
        return PLUGIN_CONTINUE;

    new cmd[6], fItem[326], iName[64], access, callback;

    menu_item_getinfo(menu, item, access, cmd, charsmax(cmd), iName, charsmax(iName), callback);

    switch (str_to_num(cmd))
    {
        case 1:
        {
            if (g_TotalSpawns == MAX_SPAWNS) {
                formatex(fItem, charsmax(fItem),"Add a spawn point for everyone - Reach the point limit");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

} else {
                formatex(fItem, charsmax(fItem),"Add a spawn point for everyone");
                menu_item_setname(menu, item, fItem);
                return ITEM_ENABLED;
            }
}
        case 2:
        {
            if (g_TotalSpawns == MAX_SPAWNS) {
                formatex(fItem, charsmax(fItem),"Add spawn point for T - points limit reached");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

} else {
                formatex(fItem, charsmax(fItem),"Add current spawn position T");
                menu_item_setname(menu, item, fItem);
                return ITEM_ENABLED;
            }
}
        case 3:
        {
            if (g_TotalSpawns == MAX_SPAWNS) {
                formatex(fItem, charsmax(fItem),"Add spawn point for CT - points limit reached");
                menu_item_setname(menu, item, fItem);
                return ITEM_DISABLED;

} else {
                formatex(fItem, charsmax(fItem),"Add current position for CT spawn");
                menu_item_setname(menu, item, fItem);
                return ITEM_ENABLED;
            }
}
}

    return PLUGIN_HANDLED;
}

add_spawn(vecs[3], angles[3], vangles[3], team) {
    new Map[32], config[32],  MapFile[256], line[128];

    get_mapname(Map, charsmax(Map));
    get_configsdir(config, charsmax(config));

    formatex(MapFile, charsmax(MapFile), "%s\csdm\%s.spawns.cfg", config, Map);

    formatex(line, charsmax(line), "%d %d %d %d %d %d %d %d %d %d", vecs[0], vecs[1], vecs[2], angles[0], angles[1], angles[2], team, vangles[0], vangles[1], vangles[2]);
    write_file(MapFile, line, -1);

    g_SpawnVecs[g_TotalSpawns][0] = vecs[0];
    g_SpawnVecs[g_TotalSpawns][1] = vecs[1];
    g_SpawnVecs[g_TotalSpawns][2] = vecs[2];

    g_SpawnAngles[g_TotalSpawns][0] = angles[0];
    g_SpawnAngles[g_TotalSpawns][1] = angles[1];
    g_SpawnAngles[g_TotalSpawns][2] = angles[2];

    g_SpawnTeam[g_TotalSpawns] = team;

    g_SpawnVAngles[g_TotalSpawns][0] = vangles[0];
    g_SpawnVAngles[g_TotalSpawns][1] = vangles[1];
    g_SpawnVAngles[g_TotalSpawns][2] = vangles[2];

    ent_make(g_TotalSpawns);

    g_TotalSpawns++;
}

edit_spawn(ent, vecs[3], angles[3], vangles[3]) {
    new Map[32], config[32],  MapFile[256];

    get_mapname(Map, charsmax(Map));
    get_configsdir(config, charsmax(config));

    formatex(MapFile, charsmax(MapFile), "%s\csdm\%s.spawns.cfg", config, Map);

    if (file_exists(MapFile))
    {
        new Data[124], len, line, pos[11][8], currentVec[3], newSpawn[128], team;

        while ((line = read_file(MapFile, line, Data, charsmax(Data), len)) != 0)
        {
            if (strlen(Data) < 2) {
                continue;
}

            parse(Data, pos[1], 7, pos[2], 7, pos[3], 7, pos[4], 7, pos[5], 7, pos[6], 7, pos[7], 7, pos[8], 7, pos[9], 7, pos[10], 7);

            currentVec[0] = str_to_num(pos[1]);
            currentVec[1] = str_to_num(pos[2]);
            currentVec[2] = str_to_num(pos[3]);

            team = str_to_num(pos[7]);

            if (g_SpawnVecs[ent][0] == currentVec[0] && g_SpawnVecs[ent][1] == currentVec[1] && (g_SpawnVecs[ent][2] - currentVec[2]) <= 15) {

                formatex(newSpawn, 127, "%d %d %d %d %d %d %d %d %d %d",vecs[0], vecs[1], vecs[2], angles[0], angles[1], angles[2], team,
                    vangles[0], vangles[1], vangles[2]);

                write_file(MapFile, newSpawn, line-1);

                ent_remove(ent);

                g_SpawnVecs[ent][0] = vecs[0];
                g_SpawnVecs[ent][1] = vecs[1];
                g_SpawnVecs[ent][2] = vecs[2];

                g_SpawnAngles[ent][0] = angles[0];
                g_SpawnAngles[ent][1] = angles[1];
                g_SpawnAngles[ent][2] = angles[2];

                g_SpawnVAngles[ent][0] = vangles[0];
                g_SpawnVAngles[ent][1] = vangles[1];
                g_SpawnVAngles[ent][2] = vangles[2];

                ent_make(ent);
                ent_glow(ent,red);

break;
}
}
}
}

delete_spawn(ent) {
    new Map[32], config[32], MapFile[256];

    get_mapname(Map, charsmax(Map));
    get_configsdir(config, charsmax(config));

    formatex(MapFile, charsmax(MapFile), "%s\csdm\%s.spawns.cfg", config, Map);

    if (file_exists(MapFile))
    {
        new Data[124], len, line, pos[11][8], currentVec[3];
   
        while ((line = read_file(MapFile, line, Data, charsmax(Data), len)) != 0)
        {
            if (strlen(Data) < 2) {
                continue;
}

            parse(Data,pos[1], 7, pos[2], 7, pos[3], 7);

            currentVec[0] = str_to_num(pos[1]);
            currentVec[1] = str_to_num(pos[2]);
            currentVec[2] = str_to_num(pos[3]);

            if (g_SpawnVecs[ent][0] == currentVec[0] && g_SpawnVecs[ent][1] == currentVec[1] && (g_SpawnVecs[ent][2] - currentVec[2]) <= 15)
            {
                write_file(MapFile, "", line-1);

                ent_remove(-1);
                readSpawns();
                ent_make(-1);

break;
}
}
}
}

closest_spawn(id) {
    new origin[3], lastDist = 999999, closest;

    get_user_origin(id, origin);

    for (new x = 0; x < g_TotalSpawns; x++)
    {
        new distance = get_distance(origin, g_SpawnVecs[x]);

        if (distance < lastDist) {
            lastDist = distance;
            closest = x;
        }
}

    return closest;
}

ent_make(id) {
    new iEnt;

    if(id < 0)
    {
        for (new x = 0; x < g_TotalSpawns; x++)
        {
            iEnt = engfunc(EngFunc_CreateNamedEntity, g_iszInfoTarget);
            set_pev(iEnt, pev_classname, "view_spawn");

            switch(g_SpawnTeam[x])
            {
                case 0: engfunc(EngFunc_SetModel, iEnt, "models/player/vip/vip.mdl");
                case 1: engfunc(EngFunc_SetModel, iEnt, "models/player/terror/terror.mdl");
                case 2: engfunc(EngFunc_SetModel, iEnt, "models/player/urban/urban.mdl");
            }

            set_pev(iEnt, pev_solid, SOLID_SLIDEBOX);
            set_pev(iEnt, pev_movetype, MOVETYPE_NOCLIP);
            set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) & FL_ONGROUND);
            set_pev(iEnt, pev_sequence, 1);

            if (g_Ents[x]) {
                engfunc(EngFunc_RemoveEntity, g_Ents[x]);
            }

            g_Ents[x] = iEnt;
            ent_unglow(x);
        }

} else {

        if (g_SpawnTeam[id] >= 0 && g_SpawnTeam[id] < 3)
        {
            iEnt = engfunc(EngFunc_CreateNamedEntity, g_iszInfoTarget);
            set_pev(iEnt, pev_classname, "view_spawn");

            switch (g_SpawnTeam[id])
            {
                case 0:    
                {
                    engfunc(EngFunc_SetModel, iEnt, "models/player/vip/vip.mdl");
                }
                case 1:
                {
                    engfunc(EngFunc_SetModel, iEnt, "models/player/terror/terror.mdl");
                }
                case 2:
                {
                    engfunc(EngFunc_SetModel, iEnt, "models/player/urban/urban.mdl");
                }
}

            set_pev(iEnt, pev_solid, SOLID_SLIDEBOX);
            set_pev(iEnt, pev_movetype, MOVETYPE_NOCLIP);
            set_pev(iEnt, pev_sequence, 1);
            set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) & FL_ONGROUND);

            if (g_Ents[id]) {
                engfunc(EngFunc_RemoveEntity, g_Ents[id]);
            }

            g_Ents[id] = iEnt;            
            ent_unglow(id);
        }
}
}

ent_remove(ent) {
    if(ent < 0)
    {
        for(new i = 0; i < g_TotalSpawns; i++)
        {
            if(pev_valid(g_Ents[i])) {
                engfunc(EngFunc_RemoveEntity, g_Ents[i]);
                g_Ents[i] = 0;
            }
}

} else {

        if(pev_valid(g_Ents[ent])) {
            engfunc(EngFunc_RemoveEntity, g_Ents[ent]);
            g_Ents[ent] = 0;
        }
}
}

ent_glow(ent,Float:color[3])
{
    new iEnt = g_Ents[ent];

    if (iEnt)
    {
        set_ent_pos(ent);

        set_pev(iEnt, pev_renderfx, kRenderFxGlowShell);
        set_pev(iEnt, pev_renderamt, 127.0);
        set_pev(iEnt, pev_rendermode, kRenderTransAlpha);
        set_pev(iEnt, pev_rendercolor, color);
    }
}

ent_unglow(ent)
{
    new iEnt = g_Ents[ent];

    if (iEnt)
    {
        set_ent_pos(ent);

        set_pev(iEnt, pev_renderfx, kRenderFxNone);
        set_pev(iEnt, pev_renderamt, 127.0);
        set_pev(iEnt, pev_rendermode, kRenderTransAlpha);        
    }
}

set_ent_pos(ent)
{
    new iEnt, Float:org[3], Float:ang[3], Float:vang[3];

    iEnt = g_Ents[ent];

    IVecFVec(g_SpawnVecs[ent], org);
    set_pev( iEnt, pev_origin, org);

    IVecFVec(g_SpawnAngles[ent], ang);
    set_pev(iEnt, pev_angles, ang);

    IVecFVec(g_SpawnVAngles[ent], vang);
    set_pev(iEnt, pev_v_angle, vang);

    set_pev(iEnt, pev_fixangle, 1);
}

public showmen(id, level, cid) {
    if (!cmd_access(id, level, cid, 1)) {
        return PLUGIN_HANDLED;
    }

    buildMenu();
    ent_make(-1);
    menu_display (id, g_MainMenuID, 0);

    return PLUGIN_HANDLED;
}
 

Вложения

angrybot

Администратор
Модератор
Разработчик
Постоялец
Пользователь
Дизайнер
Регистрация
15 Дек 2019
Сообщения
166
Симпатии
60
Open menu, press Show statistic and post result here.
 

Midnight1337

Пользователь
Регистрация
8 Дек 2018
Сообщения
72
Симпатии
10
angrybot

Total points: 46; For all: 0; T: 0; CT: 46.
Original: X: 1375.325561 Y: 1985.918701 Z: 36.03125030.jpg
 

angrybot

Администратор
Модератор
Разработчик
Постоялец
Пользователь
Дизайнер
Регистрация
15 Дек 2019
Сообщения
166
Симпатии
60
Execute in server console: mp_autoteambalance; mp_limitteams.
Post output here.
 

angrybot

Администратор
Модератор
Разработчик
Постоялец
Пользователь
Дизайнер
Регистрация
15 Дек 2019
Сообщения
166
Симпатии
60
Use amx_showrcon instead.
 

angrybot

Администратор
Модератор
Разработчик
Постоялец
Пользователь
Дизайнер
Регистрация
15 Дек 2019
Сообщения
166
Симпатии
60
I don’t know how to explain to you what I need, but apparently you don’t know how to use it all.
There are no clearly plugin issues.
Disable all other plugins, check one by one.
Try to add 1 spawn point for the TT.
 

Vaqtincha

aggressive
Разработчик
Скриптер
Регистрация
28 Янв 2018
Сообщения
963
Симпатии
685
Пол
Мужской
По сути плагин не добавляет спавны (энтити спавнов) а точки который храниться в памяти и перемещает игрока туда же после спавна. А если на карте мало (как и тут 20 например) то игроки не могут спавнится. Хакнут это можно применив офсеты нужные или просто создать спавн энтити.
 
Сверху Снизу