Патчи на агентов

AD4M

Участник
Сообщения
373
Реакции
58
Дорогие кодеры, здравствуйте.
Что на счёт приделать к плагину выбору агентов выбор патчей? :D
 

NaN

FPE_INTDIV_TRAP
Сообщения
1,513
Реакции
1,487
Они скорее всего сделаны хитрожопно как граффити
 

komashchenko

Идиот
Сообщения
916
Реакции
2,570
C-подобный:
#include <sdktools>
#include <PTaH>
#pragma newdecls required

public void OnPluginStart()
{
    RegConsoleCmd("ag_test", ag_test);
    RegConsoleCmd("ag_test_set", ag_test_set);
}

Action ag_test(int iClient, int arg)
{
    if(iClient < 1) return Plugin_Handled;
    
    int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_vecPlayerPatchEconIndices");
    
    for(int i = 0; i < iSize; i++)
    {
        PrintToChat(iClient, "%d %d", i, GetEntProp(iClient, Prop_Send, "m_vecPlayerPatchEconIndices", 4, i));
    }
    
    return Plugin_Handled;
}

Action ag_test_set(int iClient, int arg)
{
    if(iClient < 1 && !IsPlayerAlive(iClient)) return Plugin_Handled;
    
    decl char sBuf[64];
    
    GetCmdArgString(sBuf, sizeof sBuf);
    
    int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_vecPlayerPatchEconIndices");
    
    for(int i = 0; i < iSize; i++)
    {
        SetEntProp(iClient, Prop_Send, "m_vecPlayerPatchEconIndices", StringToInt(sBuf), 4, i);
    }
    
    PTaH_ForceFullUpdate(iClient); //Нужно что бы отобразило новые, должен быть более гуманный способ заставить клиента обновить инфу о них
    
    return Plugin_Handled;
}
C-подобный:
"patch"
{
    "4550"        "Crazy Banana"
    "4551"        "The Boss"
    "4552"        "Chicken Lover"
    "4553"        "Welcome to the Clutch"
    "4554"        "Dragon"
    "4555"        "Easy Peasy"
    "4556"        "Rage"
    "4557"        "Howl"
    "4558"        "Koi"
    "4559"        "Longevity"
    "4560"        "Wildfire"
    "4561"        "Vigilance"
    "4562"        "Bloodhound"
    "4563"        "Bravo"
    "4564"        "Breakout"
    "4565"        "Danger Zone"
    "4566"        "Hydra"
    "4567"        "Payback"
    "4568"        "Phoenix"
    "4569"        "Shattered Web"
    "4570"        "Vanguard"
}
 

Misssha

Участник
Сообщения
10
Реакции
0
C-подобный:
#include <sdktools>
#include <PTaH>
#pragma newdecls required

public void OnPluginStart()
{
    RegConsoleCmd("ag_test", ag_test);
    RegConsoleCmd("ag_test_set", ag_test_set);
}

Action ag_test(int iClient, int arg)
{
    if(iClient < 1) return Plugin_Handled;
   
    int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_vecPlayerPatchEconIndices");
   
    for(int i = 0; i < iSize; i++)
    {
        PrintToChat(iClient, "%d %d", i, GetEntProp(iClient, Prop_Send, "m_vecPlayerPatchEconIndices", 4, i));
    }
   
    return Plugin_Handled;
}

Action ag_test_set(int iClient, int arg)
{
    if(iClient < 1 && !IsPlayerAlive(iClient)) return Plugin_Handled;
   
    decl char sBuf[64];
   
    GetCmdArgString(sBuf, sizeof sBuf);
   
    int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_vecPlayerPatchEconIndices");
   
    for(int i = 0; i < iSize; i++)
    {
        SetEntProp(iClient, Prop_Send, "m_vecPlayerPatchEconIndices", StringToInt(sBuf), 4, i);
    }
   
    PTaH_ForceFullUpdate(iClient); //Нужно что бы отобразило новые, должен быть более гуманный способ заставить клиента обновить инфу о них
   
    return Plugin_Handled;
}
C-подобный:
"patch"
{
    "4550"        "Crazy Banana"
    "4551"        "The Boss"
    "4552"        "Chicken Lover"
    "4553"        "Welcome to the Clutch"
    "4554"        "Dragon"
    "4555"        "Easy Peasy"
    "4556"        "Rage"
    "4557"        "Howl"
    "4558"        "Koi"
    "4559"        "Longevity"
    "4560"        "Wildfire"
    "4561"        "Vigilance"
    "4562"        "Bloodhound"
    "4563"        "Bravo"
    "4564"        "Breakout"
    "4565"        "Danger Zone"
    "4566"        "Hydra"
    "4567"        "Payback"
    "4568"        "Phoenix"
    "4569"        "Shattered Web"
    "4570"        "Vanguard"
}


Ошибки компиляции
 

EZZY

Участник
Сообщения
377
Реакции
74
Вроде такие
1583408084897.png
 

w0hderful

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

RusJJ

Доброе утро девачьки
Сообщения
2,582
Реакции
1,075
@Misssha, @Alastor, уберите в строке 29 decl
Вот помогаешь, а они даже нормально не могут указать, помогло ли это 🤡👍
 
Последнее редактирование:

Misssha

Участник
Сообщения
10
Реакции
0
@Misssha, @Alastor, уберите в строке 29 decl
Вот помогаешь, а они даже нормально не могут указать, помогло ли это 🤡👍

Дай бог тебе здоровья добрый молодец 👍
Сообщения автоматически склеены:

C-подобный:
#include <sdktools>
#include <PTaH>
#pragma newdecls required

public void OnPluginStart()
{
    RegConsoleCmd("ag_test", ag_test);
    RegConsoleCmd("ag_test_set", ag_test_set);
}

Action ag_test(int iClient, int arg)
{
    if(iClient < 1) return Plugin_Handled;
   
    int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_vecPlayerPatchEconIndices");
   
    for(int i = 0; i < iSize; i++)
    {
        PrintToChat(iClient, "%d %d", i, GetEntProp(iClient, Prop_Send, "m_vecPlayerPatchEconIndices", 4, i));
    }
   
    return Plugin_Handled;
}

Action ag_test_set(int iClient, int arg)
{
    if(iClient < 1 && !IsPlayerAlive(iClient)) return Plugin_Handled;
   
    decl char sBuf[64];
   
    GetCmdArgString(sBuf, sizeof sBuf);
   
    int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_vecPlayerPatchEconIndices");
   
    for(int i = 0; i < iSize; i++)
    {
        SetEntProp(iClient, Prop_Send, "m_vecPlayerPatchEconIndices", StringToInt(sBuf), 4, i);
    }
   
    PTaH_ForceFullUpdate(iClient); //Нужно что бы отобразило новые, должен быть более гуманный способ заставить клиента обновить инфу о них
   
    return Plugin_Handled;
}
C-подобный:
"patch"
{
    "4550"        "Crazy Banana"
    "4551"        "The Boss"
    "4552"        "Chicken Lover"
    "4553"        "Welcome to the Clutch"
    "4554"        "Dragon"
    "4555"        "Easy Peasy"
    "4556"        "Rage"
    "4557"        "Howl"
    "4558"        "Koi"
    "4559"        "Longevity"
    "4560"        "Wildfire"
    "4561"        "Vigilance"
    "4562"        "Bloodhound"
    "4563"        "Bravo"
    "4564"        "Breakout"
    "4565"        "Danger Zone"
    "4566"        "Hydra"
    "4567"        "Payback"
    "4568"        "Phoenix"
    "4569"        "Shattered Web"
    "4570"        "Vanguard"
}

а можно как нибудь внести ID патчей к основному коду?
 
Последнее редактирование:
Сверху Снизу