Block join team

I’m going back

Участник
Сообщения
8
Реакции
0
Операционная система
Linux
У меня минигейм сервер и нужно полностью заблокировать игроку заход за кт. Буду очень рад вашей помощи.
 

Madness aka null138

Участник
Сообщения
713
Реакции
734
Этот плагин заменит все точки спавна CT на T.
C++:
#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    HookEvent("round_start", OnRoundStart);
}

public void OnRoundStart(Event event, const char[] name, bool broadCast)
{
    char clsnm[32];
    float pos[3], ang[3];
    for(int i = MaxClients+1; i < 2048; i++)
    {
        if(!IsValidEntity(i)) continue;

        GetEntityClassname(i, clsnm, 32);
        if(!strcmp(clsnm, "info_player_counterterrorist"))
        {
            GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
            GetEntPropVector(i, Prop_Send, "m_angRotation", ang);
            AcceptEntityInput(i, "kill");
       
            int ent = CreateEntityByName("info_player_terrorist");
            DispatchSpawn(ent);
            TeleportEntity(ent, pos, ang, NULL_VECTOR);
        }
    }
}
 
Последнее редактирование:

Grey83

не пишу плагины с весны 2022
Сообщения
8,521
Реакции
4,982
@Madness aka null138, можно же проще:
C-подобный:
#include <sdktools_entinput>
#include <sdktools_functions>

public void OnPluginStart()
{
    HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
}

public void OnRoundStart(Event event, const char[] name, bool broadCast)
{
    int ent, i = MaxClients+1;
    float pos[3], ang[3];
    while((FindEntityByClassname(i, "info_player_counterterrorist")) != -1)
    {
        GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
        GetEntPropVector(i, Prop_Send, "m_vecAngles", ang);
        AcceptEntityInput(i, "kill");

        if((ent = CreateEntityByName("info_player_terrorist")) == -1) continue;

        TeleportEntity(ent, pos, ang, NULL_VECTOR);
        DispatchSpawn(ent);
    }
}
 
Последнее редактирование:

I’m going back

Участник
Сообщения
8
Реакции
0
L 03/16/2022 - 17:16:47: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:16:47: [SM] Call stack trace:
L 03/16/2022 - 17:16:47: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:16:47: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
 

I’m going back

Участник
Сообщения
8
Реакции
0
L 03/16/2022 - 17:16:20: Error log file session closed.
L 03/16/2022 - 17:16:21: SourceMod error session started
L 03/16/2022 - 17:16:21: Info (map "mg_sonic_course_final_v1") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 17:16:21: [SM] Exception reported: Can't parse modelconfig file for map mg_sonic_course_final_v1.
L 03/16/2022 - 17:16:21: [SM] Blaming: hide_and_seek.smx
L 03/16/2022 - 17:16:21: [SM] Call stack trace:
L 03/16/2022 - 17:16:21: [SM] [0] SetFailState
L 03/16/2022 - 17:16:21: [SM] [1] Line 2252, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::BuildMainMenu
L 03/16/2022 - 17:16:21: [SM] [2] Line 325, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::OnMapStart
L 03/16/2022 - 17:16:21: [SM] Exception reported: Client 64 is not in game
L 03/16/2022 - 17:16:21: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:16:21: [SM] Call stack trace:
L 03/16/2022 - 17:16:21: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:16:21: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 17:16:21: [SM] Exception reported: Native is not bound
L 03/16/2022 - 17:16:21: [SM] Blaming: shavit/shavit-rankings.smx
L 03/16/2022 - 17:16:21: [SM] Call stack trace:
L 03/16/2022 - 17:16:21: [SM] [0] Shavit_GetStyleCount
L 03/16/2022 - 17:16:21: [SM] [1] Line 184, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::Shavit_OnStyleConfigLoaded
L 03/16/2022 - 17:16:21: [SM] [2] Line 241, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::SQL_CreateTable_Callback
L 03/16/2022 - 17:16:27: [SM] Exception reported: Invalid Handle 0 (error: 4)
L 03/16/2022 - 17:16:27: [SM] Blaming: round_end_music.smx
L 03/16/2022 - 17:16:27: [SM] Call stack trace:
L 03/16/2022 - 17:16:27: [SM] [0] GetArraySize
L 03/16/2022 - 17:16:27: [SM] [1] Line 802, ./round_end_music.sp::RequestFrameRoundEnd
L 03/16/2022 - 17:16:47: [SM] Exception reported: Client 64 is not in game
L 03/16/2022 - 17:16:47: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:16:47: [SM] Call stack trace:
L 03/16/2022 - 17:16:47: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:16:47: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 17:18:25: [SM] Exception reported: Client 64 is not in game
L 03/16/2022 - 17:18:25: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:18:25: [SM] Call stack trace:
L 03/16/2022 - 17:18:25: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:18:25: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 17:20:11: [SM] Exception reported: Client 64 is not in game
L 03/16/2022 - 17:20:11: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:20:11: [SM] Call stack trace:
L 03/16/2022 - 17:20:11: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:20:11: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 17:22:26: [SM] Exception reported: Client 64 is not in game
L 03/16/2022 - 17:22:26: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:22:26: [SM] Call stack trace:
L 03/16/2022 - 17:22:26: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:22:26: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 17:24:19: Error log file session closed.
L 03/16/2022 - 17:24:20: SourceMod error session started
L 03/16/2022 - 17:24:20: Info (map "scout_lego_2010") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 17:24:20: [SM] Exception reported: Can't parse modelconfig file for map scout_lego_2010.
L 03/16/2022 - 17:24:20: [SM] Blaming: hide_and_seek.smx
L 03/16/2022 - 17:24:20: [SM] Call stack trace:
L 03/16/2022 - 17:24:20: [SM] [0] SetFailState
L 03/16/2022 - 17:24:20: [SM] [1] Line 2252, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::BuildMainMenu
L 03/16/2022 - 17:24:20: [SM] [2] Line 325, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::OnMapStart
L 03/16/2022 - 17:24:20: [SM] Exception reported: Client 64 is not in game
L 03/16/2022 - 17:24:20: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 17:24:20: [SM] Call stack trace:
L 03/16/2022 - 17:24:20: [SM] [0] FindEntityByClassname
L 03/16/2022 - 17:24:20: [SM] [1] Line 13, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 17:24:22: [SM] Exception reported: Native is not bound
L 03/16/2022 - 17:24:22: [SM] Blaming: shavit/shavit-rankings.smx
L 03/16/2022 - 17:24:22: [SM] Call stack trace:
L 03/16/2022 - 17:24:22: [SM] [0] Shavit_GetStyleCount
L 03/16/2022 - 17:24:22: [SM] [1] Line 184, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::Shavit_OnStyleConfigLoaded
L 03/16/2022 - 17:24:22: [SM] [2] Line 241, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::SQL_CreateTable_Callback
L 03/16/2022 - 17:24:29: [SM] Exception reported: Invalid Handle 0 (error: 4)
L 03/16/2022 - 17:24:29: [SM] Blaming: round_end_music.smx
L 03/16/2022 - 17:24:29: [SM] Call stack trace:
L 03/16/2022 - 17:24:29: [SM] [0] GetArraySize
L 03/16/2022 - 17:24:29: [SM] [1] Line 802, ./round_end_music.sp::RequestFrameRoundEnd
 

Madness aka null138

Участник
Сообщения
713
Реакции
734
@Madness aka null138, можно же проще:
C-подобный:
#include <sdktools_entinput>
#include <sdktools_functions>

public void OnPluginStart()
{
    HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
}

public void OnRoundStart(Event event, const char[] name, bool broadCast)
{
    int ent, i = MaxClients;
    float pos[3], ang[3];
    while((FindEntityByClassname(i, "info_player_counterterrorist")) != -1)
    {
        GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
        GetEntPropVector(i, Prop_Send, "m_vecAngles", ang);
        AcceptEntityInput(i, "kill");

        if((ent = CreateEntityByName("info_player_terrorist")) == -1) continue;

        TeleportEntity(ent, pos, ang, NULL_VECTOR);
        DispatchSpawn(ent);
    }
}
тут потому что на 11 строке надо было добавить "int ent, i = MaxClients+1;"
 

I’m going back

Участник
Сообщения
8
Реакции
0
L 03/16/2022 - 19:26:32: SourceMod error session started
L 03/16/2022 - 19:26:32: Info (map "mg_siberdev_2") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 19:26:32: [SM] Exception reported: Property "m_vecOrigin" not found (entity 65/cs_team_manager)
L 03/16/2022 - 19:26:32: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 19:26:32: [SM] Call stack trace:
L 03/16/2022 - 19:26:32: [SM] [0] GetEntPropVector
L 03/16/2022 - 19:26:32: [SM] [1] Line 15, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
 

Madness aka null138

Участник
Сообщения
713
Реакции
734
L 03/16/2022 - 19:26:32: SourceMod error session started
L 03/16/2022 - 19:26:32: Info (map "mg_siberdev_2") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 19:26:32: [SM] Exception reported: Property "m_vecOrigin" not found (entity 65/cs_team_manager)
L 03/16/2022 - 19:26:32: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 19:26:32: [SM] Call stack trace:
L 03/16/2022 - 19:26:32: [SM] [0] GetEntPropVector
L 03/16/2022 - 19:26:32: [SM] [1] Line 15, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
проверь мою версию плагина.
 

I’m going back

Участник
Сообщения
8
Реакции
0
проверь мою версию плагина.
Тоже ошибка
L 03/16/2022 - 21:03:41: SourceMod error session started
L 03/16/2022 - 21:03:41: Info (map "awp_lego_2") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 21:03:41: [SM] Unable to load extension "SteamWorks.ext": libsteam_api.so: cannot open shared object file: No such file or directory
L 03/16/2022 - 21:03:41: [SM] Unable to load plugin "shavit/wrsj.smx": Native "Shavit_IsReplayEntity" was not found
L 03/16/2022 - 21:03:42: [SM] Exception reported: Can't parse modelconfig file for map awp_lego_2.
L 03/16/2022 - 21:03:42: [SM] Blaming: hide_and_seek.smx
L 03/16/2022 - 21:03:42: [SM] Call stack trace:
L 03/16/2022 - 21:03:42: [SM] [0] SetFailState
L 03/16/2022 - 21:03:42: [SM] [1] Line 2252, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::BuildMainMenu
L 03/16/2022 - 21:03:42: [SM] [2] Line 325, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::OnMapStart
L 03/16/2022 - 21:03:42: [SM] Exception reported: Property "m_vecAngles" not found (entity 44/info_player_counterterrorist)
L 03/16/2022 - 21:03:42: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 21:03:42: [SM] Call stack trace:
L 03/16/2022 - 21:03:42: [SM] [0] GetEntPropVector
L 03/16/2022 - 21:03:42: [SM] [1] Line 21, C:\Users\123\Desktop\sm 1.10\ spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 21:03:43: [SM] Exception reported: Native is not bound
L 03/16/2022 - 21:03:43: [SM] Blaming: shavit/shavit-rankings.smx
L 03/16/2022 - 21:03:43: [SM] Call stack trace:
L 03/16/2022 - 21:03:43: [SM] [0] Shavit_GetStyleCount
L 03/16/2022 - 21:03:43: [SM] [1] Line 184, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::Shavit_OnStyleConfigLoaded
L 03/16/2022 - 21:03:43: [SM] [2] Line 241, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::SQL_CreateTable_Callback
L 03/16/2022 - 21:04:08: Error log file session closed.
L 03/16/2022 - 21:04:09: SourceMod error session started
L 03/16/2022 - 21:04:09: Info (map "bhop_cks_dev2") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 21:04:09: [SM] Exception reported: Can't parse modelconfig file for map bhop_cks_dev2.
L 03/16/2022 - 21:04:09: [SM] Blaming: hide_and_seek.smx
L 03/16/2022 - 21:04:09: [SM] Call stack trace:
L 03/16/2022 - 21:04:09: [SM] [0] SetFailState
L 03/16/2022 - 21:04:09: [SM] [1] Line 2252, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::BuildMainMenu
L 03/16/2022 - 21:04:09: [SM] [2] Line 325, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::OnMapStart
L 03/16/2022 - 21:04:09: [SM] Exception reported: Property "m_vecAngles" not found (entity 68/info_player_counterterrorist)
L 03/16/2022 - 21:04:09: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 21:04:09: [SM] Call stack trace:
L 03/16/2022 - 21:04:09: [SM] [0] GetEntPropVector
L 03/16/2022 - 21:04:09: [SM] [1] Line 21, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
 

Madness aka null138

Участник
Сообщения
713
Реакции
734
Тоже ошибка
L 03/16/2022 - 21:03:41: SourceMod error session started
L 03/16/2022 - 21:03:41: Info (map "awp_lego_2") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 21:03:41: [SM] Unable to load extension "SteamWorks.ext": libsteam_api.so: cannot open shared object file: No such file or directory
L 03/16/2022 - 21:03:41: [SM] Unable to load plugin "shavit/wrsj.smx": Native "Shavit_IsReplayEntity" was not found
L 03/16/2022 - 21:03:42: [SM] Exception reported: Can't parse modelconfig file for map awp_lego_2.
L 03/16/2022 - 21:03:42: [SM] Blaming: hide_and_seek.smx
L 03/16/2022 - 21:03:42: [SM] Call stack trace:
L 03/16/2022 - 21:03:42: [SM] [0] SetFailState
L 03/16/2022 - 21:03:42: [SM] [1] Line 2252, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::BuildMainMenu
L 03/16/2022 - 21:03:42: [SM] [2] Line 325, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::OnMapStart
L 03/16/2022 - 21:03:42: [SM] Exception reported: Property "m_vecAngles" not found (entity 44/info_player_counterterrorist)
L 03/16/2022 - 21:03:42: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 21:03:42: [SM] Call stack trace:
L 03/16/2022 - 21:03:42: [SM] [0] GetEntPropVector
L 03/16/2022 - 21:03:42: [SM] [1] Line 21, C:\Users\123\Desktop\sm 1.10\ spawn_ct_na_t.sp::OnRoundStart
L 03/16/2022 - 21:03:43: [SM] Exception reported: Native is not bound
L 03/16/2022 - 21:03:43: [SM] Blaming: shavit/shavit-rankings.smx
L 03/16/2022 - 21:03:43: [SM] Call stack trace:
L 03/16/2022 - 21:03:43: [SM] [0] Shavit_GetStyleCount
L 03/16/2022 - 21:03:43: [SM] [1] Line 184, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::Shavit_OnStyleConfigLoaded
L 03/16/2022 - 21:03:43: [SM] [2] Line 241, C:\Users\Dima\Desktop\Coding\shavit2.6.0 34\shavit-rankings.sp::SQL_CreateTable_Callback
L 03/16/2022 - 21:04:08: Error log file session closed.
L 03/16/2022 - 21:04:09: SourceMod error session started
L 03/16/2022 - 21:04:09: Info (map "bhop_cks_dev2") (file "/srv/cstrike/addons/sourcemod/logs/errors_20220316.log")
L 03/16/2022 - 21:04:09: [SM] Exception reported: Can't parse modelconfig file for map bhop_cks_dev2.
L 03/16/2022 - 21:04:09: [SM] Blaming: hide_and_seek.smx
L 03/16/2022 - 21:04:09: [SM] Call stack trace:
L 03/16/2022 - 21:04:09: [SM] [0] SetFailState
L 03/16/2022 - 21:04:09: [SM] [1] Line 2252, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::BuildMainMenu
L 03/16/2022 - 21:04:09: [SM] [2] Line 325, D:\Plugins2\hideandseek\addons\sourcemod\scripting\hide_and_seek.sp::OnMapStart
L 03/16/2022 - 21:04:09: [SM] Exception reported: Property "m_vecAngles" not found (entity 68/info_player_counterterrorist)
L 03/16/2022 - 21:04:09: [SM] Blaming: spawn_ct_na_t.smx
L 03/16/2022 - 21:04:09: [SM] Call stack trace:
L 03/16/2022 - 21:04:09: [SM] [0] GetEntPropVector
L 03/16/2022 - 21:04:09: [SM] [1] Line 21, C:\Users\123\Desktop\sm 1.10\spawn_ct_na_t.sp::OnRoundStart
изменил. проверь когда сможешь, мой первый пост.
 

I’m going back

Участник
Сообщения
8
Реакции
0

Grey83

не пишу плагины с весны 2022
Сообщения
8,521
Реакции
4,982
Он не работает выдаёт ошибку, и на мг картах я могу зайти за кт
есть вообще квар, который разрешает людям заходить только за какую-то из команд
есть ещё квар, который принудительно при входе переводит игрока за какую-то команду

вбей в консоль сервера или клиента «find human» и «find team» и смотри в выдаче описания
 
Сверху Снизу