Написание плагинов

7pElllHuK

Участник
Сообщения
1,654
Реакции
639

Grey83

не пишу плагины с весны 2022
Сообщения
8,805
Реакции
5,254
@7pElllHuK, легко: отправляшь на страницу где эта инфа выводится и всё.
Там только сделать саму страницу на сервере, где статистика хранится (можно и на другом, прост нужен доступ страницы к серваку, где БД статистики).
 

7pElllHuK

Участник
Сообщения
1,654
Реакции
639
@7pElllHuK, легко: отправляшь на страницу где эта инфа выводится и всё.
Там только сделать саму страницу на сервере, где статистика хранится (можно и на другом, прост нужен доступ страницы к серваку, где БД статистики).
Понял, спасибо большое
 

-=|УЧЕНИК|=-

вся жизнь,сплошной цирк.
Сообщения
969
Реакции
279
Привет всем!
Можно ли как то сделать через плагин,чтоб не льзя было совершать действие над ботами?
Допустим такое как кикать,или убивать.
Может кто накидает простенький плагин,если по времени не много.
Не какого решения не нашел,может плохо искал.
Заранее благодарю
 

-=|УЧЕНИК|=-

вся жизнь,сплошной цирк.
Сообщения
969
Реакции
279
Последнее редактирование:

7pElllHuK

Участник
Сообщения
1,654
Реакции
639
А в чём проблема? html страница с php? Php выполняется на стороне сервера и игрок видит только html код
В том что когда мы проходили эти темы в колледже мы учились дистанционно и я ничего не запомнил)
 

ColdWind

Участник
Сообщения
72
Реакции
32
Всем добра, помогите скомпилировать плуг на ластовом morecolors
//// adminchat.sp
//
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(5) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(6) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(8) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(10) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(11) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(13) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(14) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(16) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(16) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(18) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(26) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(30) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(38) : error 001: expected token: ";", but found "-identifier-"
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : fatal error 190: too many error messages on one line
//
// Compilation aborted.
// 17 Errors.
//
// Compilation Time: 0,7 sec
// ----------------------------------------
 

Вложения

  • adminchat.sp
    6.1 КБ · Просмотры: 24
  • MoreColors [1.9.2].zip
    9.6 КБ · Просмотры: 14

danil253467

💘Italo-Disco One Love💘
Сообщения
110
Реакции
67
Всем добра, помогите скомпилировать плуг на ластовом morecolors
//// adminchat.sp
//
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(5) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(6) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(8) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(10) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(11) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(13) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(14) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(16) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(16) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(18) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(26) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(30) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(38) : error 001: expected token: ";", but found "-identifier-"
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : fatal error 190: too many error messages on one line
//
// Compilation aborted.
// 17 Errors.
//
// Compilation Time: 0,7 sec
// ----------------------------------------
В morecolors.inc убери вот эту строчку:
PHP:
#pragma newdecls required
И скомпилируй плагин
 

DarkerZ

Участник
Сообщения
466
Реакции
215
Всем добра, помогите скомпилировать плуг на ластовом morecolors
//// adminchat.sp
//
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(5) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(6) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(8) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(10) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(11) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(13) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(14) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(16) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(16) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(18) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(26) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(30) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(38) : error 001: expected token: ";", but found "-identifier-"
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : error 147: new-style declarations are required
// C:\Users\HP\Desktop\COMPILE\adminchat.sp(44) : fatal error 190: too many error messages on one line
//
// Compilation aborted.
// 17 Errors.
//
// Compilation Time: 0,7 sec
// ----------------------------------------
в morecolors.inc закоменти
C-подобный:
#pragma newdecls required
 

7pElllHuK

Участник
Сообщения
1,654
Реакции
639
Всем привет, подскажите пожалуйста как исправить ошибку:
L 06/25/2024 - 00:57:24: [SM] Exception reported: Handle c695055a is invalid (error 1)
L 06/25/2024 - 00:57:24: [SM] Blaming: C4 10 sec 1.1.0.smx
L 06/25/2024 - 00:57:24: [SM] Call stack trace:
L 06/25/2024 - 00:57:24: [SM] [0] CloseHandle
L 06/25/2024 - 00:57:24: [SM] [1] Line 76, D:\ONEdRIVE\Desktop\Компиляторы\1.11 scripting\C4 10 sec 1.1.0.sp::Event_End
L 06/25/2024 - 00:57:24: [SM] [3] CS_TerminateRound
L 06/25/2024 - 00:57:24: [SM] [4] Line 81, C:\Users\Admin\Desktop\kac_new\delayroundend.sp::CS_OnTerminateRound
Плагин:
#pragma semicolon 1
#pragma newdecls required

#include <sdktools_sound>
#include <sdktools_stringtables>

static const char g_szSound[][] =
{
    "sound/kosmicheskiy/c4_explode/3.mp3",
    "sound/kosmicheskiy/c4_explode/4.mp3"
};

Handle
    hTimer;

float
    fTimer;
int
    iPos;

public Plugin myinfo =
{
    name        = "C4 10 seconds",
    version        = "1.1.0 (rewritten by Grey83)",
    description = "Воспроизведение музыки за 10 секунд до взрыва бомбы",
    author        = "Ало, Ва-Вадик?",
    url            = "https://vk.com/kopojlebckuu_7pelllhuk"
}

public void OnPluginStart()
{
    ConVar cvar = FindConVar("mp_c4timer");
    if(!cvar) SetFailState("Can't find convar 'mp_c4timer'!");

    cvar.AddChangeHook(CVarChange);
    CVarChange(cvar, "", "");

    HookEvent("bomb_planted", Event_BombPlanted, EventHookMode_Pre);
    HookEvent("round_start", Event_End, EventHookMode_PostNoCopy);
    HookEvent("round_end", Event_End, EventHookMode_PostNoCopy);
}

public void CVarChange(ConVar cvar, const char[] oldValue, const char[] newValue)
{
    fTimer = cvar.FloatValue - 10;
}

public void OnMapStart()
{
    hTimer = null;
    for(int i; i < sizeof(g_szSound); i++)
    {
        AddFileToDownloadsTable(g_szSound[i]);
        PrecacheSound(g_szSound[i][6]);
    }
}

public void Event_BombPlanted(Event event, const char[] name, bool dontBroadcast)
{
    if(fTimer >= 0.0) hTimer = CreateTimer(fTimer, Timer_Countdown, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action Timer_Countdown(Handle timer)
{
    hTimer = null;
    int i;
    while((i = GetRandomInt(0, sizeof(g_szSound)-1)) == iPos) {}
    iPos = i;
    EmitSoundToAll(g_szSound[i][6]);

    return Plugin_Stop;
}

public void Event_End(Event event, const char[] name, bool dontBroadcast)
{
    if (hTimer) CloseHandle(hTimer);
}
 

Ice_Sochi

Участник
Сообщения
738
Реакции
433
Всем привет, подскажите пожалуйста как исправить ошибку:
L 06/25/2024 - 00:57:24: [SM] Exception reported: Handle c695055a is invalid (error 1)
L 06/25/2024 - 00:57:24: [SM] Blaming: C4 10 sec 1.1.0.smx
L 06/25/2024 - 00:57:24: [SM] Call stack trace:
L 06/25/2024 - 00:57:24: [SM] [0] CloseHandle
L 06/25/2024 - 00:57:24: [SM] [1] Line 76, D:\ONEdRIVE\Desktop\Компиляторы\1.11 scripting\C4 10 sec 1.1.0.sp::Event_End
L 06/25/2024 - 00:57:24: [SM] [3] CS_TerminateRound
L 06/25/2024 - 00:57:24: [SM] [4] Line 81, C:\Users\Admin\Desktop\kac_new\delayroundend.sp::CS_OnTerminateRound
Плагин:
#pragma semicolon 1
#pragma newdecls required

#include <sdktools_sound>
#include <sdktools_stringtables>

static const char g_szSound[][] =
{
    "sound/kosmicheskiy/c4_explode/3.mp3",
    "sound/kosmicheskiy/c4_explode/4.mp3"
};

Handle
    hTimer;

float
    fTimer;
int
    iPos;

public Plugin myinfo =
{
    name        = "C4 10 seconds",
    version        = "1.1.0 (rewritten by Grey83)",
    description = "Воспроизведение музыки за 10 секунд до взрыва бомбы",
    author        = "Ало, Ва-Вадик?",
    url            = "https://vk.com/kopojlebckuu_7pelllhuk"
}

public void OnPluginStart()
{
    ConVar cvar = FindConVar("mp_c4timer");
    if(!cvar) SetFailState("Can't find convar 'mp_c4timer'!");

    cvar.AddChangeHook(CVarChange);
    CVarChange(cvar, "", "");

    HookEvent("bomb_planted", Event_BombPlanted, EventHookMode_Pre);
    HookEvent("round_start", Event_End, EventHookMode_PostNoCopy);
    HookEvent("round_end", Event_End, EventHookMode_PostNoCopy);
}

public void CVarChange(ConVar cvar, const char[] oldValue, const char[] newValue)
{
    fTimer = cvar.FloatValue - 10;
}

public void OnMapStart()
{
    hTimer = null;
    for(int i; i < sizeof(g_szSound); i++)
    {
        AddFileToDownloadsTable(g_szSound[i]);
        PrecacheSound(g_szSound[i][6]);
    }
}

public void Event_BombPlanted(Event event, const char[] name, bool dontBroadcast)
{
    if(fTimer >= 0.0) hTimer = CreateTimer(fTimer, Timer_Countdown, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action Timer_Countdown(Handle timer)
{
    hTimer = null;
    int i;
    while((i = GetRandomInt(0, sizeof(g_szSound)-1)) == iPos) {}
    iPos = i;
    EmitSoundToAll(g_szSound[i][6]);

    return Plugin_Stop;
}

public void Event_End(Event event, const char[] name, bool dontBroadcast)
{
    if (hTimer) CloseHandle(hTimer);
}
Если сделать вместо CloseHandle > hTimer = null; тоже ошибка будет?
 

7pElllHuK

Участник
Сообщения
1,654
Реакции
639
Если сделать вместо CloseHandle > hTimer = null; тоже ошибка будет?
Пробовал делать delete hTimer, насколько я знаю delete приравнивает к null значение. Ошибка оставалась
Сообщения автоматически склеены:

Если сделать вместо CloseHandle > hTimer = null; тоже ошибка будет?
Сейчас попробую, отпишусь
 
Последнее редактирование:

Grey83

не пишу плагины с весны 2022
Сообщения
8,805
Реакции
5,254
@7pElllHuK,
C-подобный:
    if (hTimer) CloseHandle(hTimer);
замени на
C-подобный:
    if (hTimer)
    {
        CloseHandle(hTimer);
        hTimer = null;
    }
 
Сверху Снизу