I’m going back
Участник
- Сообщения
- 8
- Реакции
- 0
- Операционная система
- Linux
У меня минигейм сервер и нужно полностью заблокировать игроку заход за кт. Буду очень рад вашей помощи.
#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);
}
}
}
#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);
}
}
тут потому что на 11 строке надо было добавить "int ent, i = MaxClients+1;"@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); } }
проверь мою версию плагина.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
пофиксил код вышеException reported: Client 64 is not in game
Тоже ошибкапроверь мою версию плагина.
изменил. проверь когда сможешь, мой первый пост.Тоже ошибка
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
Я его и использовализменил. проверь когда сможешь, мой первый пост.
так я же его изменил, добавил другой код.Я его и использовал
изменил. проверь когда сможешь, мой первый пост.
Он не работает выдаёт ошибку, и на мг картах я могу зайти за кттак я же его изменил, добавил другой код.
есть вообще квар, который разрешает людям заходить только за какую-то из командОн не работает выдаёт ошибку, и на мг картах я могу зайти за кт