какая версия игры?Добрый вечер, помогите пожалуйста скомпилить исходник под SM 1.6.3
А то у меня ошибки выдаёт а я не разбираюсь в этом!
Заранее огромное спасибо!
#include <sourcemod>
public Plugin:myinfo =
{
name = "Admins_Autoregeneration_HP",
author = "AlmazON",
description = "Авторегенерация HP Админов",
version = "1.0.0",
url = "http://www.hlmod.ru"
}
new Float:fRS, Handle:hTRA, iA[MAXPLAYERS - 1], iAH, iAT, iOH, iP[MAXPLAYERS + 1], iRF, iRP, iRU, String:sPH[32];
public OnPluginStart()
{
HookConVarChange(hTRA = CreateConVar("admin_regen_hp_flags", "", "Flags of the administration for access to regeneration.\n\"\" - all."), RF);
GetConVarString(hTRA, sPH, AdminFlags_TOTAL);
iRF = ReadFlagString(sPH[0] ? sPH:"abcdefghijklmnopqrstz");
HookConVarChange(hTRA = CreateConVar("admin_regen_hp_peak", "100", "The peak amount of regenerated health.", _, true, 2.0), RP);
iRP = GetConVarInt(hTRA);
HookConVarChange(hTRA = CreateConVar("admin_regen_hp_speed", "1.0", "The speed of healing in seconds.", _, true, 0.1), RS);
fRS = GetConVarFloat(hTRA);
HookConVarChange(hTRA = CreateConVar("admin_regen_hp_units", "2", "The number of units healing at a time.\n0 - disable.", _, true, 0.0), RU);
RU(hTRA, sPH, sPH);
if ((iOH = FindSendPropInfo("CCSPlayer", "m_iHealth")) == -1)
{
if (GameConfGetKeyValue((hTRA = LoadGameConfigFile("core.games")), "m_iHealth", sPH, sizeof(sPH)) == false)sPH = "m_iHealth";
CloseHandle(hTRA);
} AutoExecConfig(_, "AdminsAutoregenerationHP");
}
public OnMapEnd()iAT = 0;
public OnRebuildAdminCache(AdminCachePart:P)if (iRU)if (P == AdminCache_Admins)
{
iAH = iAT;
iAT = 0;
for (new i = 1; i <= MaxClients; ++i)
{
if (IsClientInGame(i))if (GetClientTeam(i) > 1)if (GetUserFlagBits(i)&iRF)
{
iP[iA[iAT] = i] = ++iAT;
continue;
} iP[i] = 0;
} if (iAH)
{
if (iAT == 0)CloseHandle(hTRA);
} else if (iAT)TRA();
}
public RF(Handle:C, String:O[], const String:N[])
{
iRF = ReadFlagString(N[0] ? N:"abcdefghijklmnopqrstz");
OnRebuildAdminCache(AdminCache_Admins);
}
public RP(Handle:C, String:O[], String:N[])iRP = GetConVarInt(C);
public RS(Handle:C, String:O[], String:N[])
{
fRS = GetConVarFloat(C);
if (iAT)
{
CloseHandle(hTRA);
TRA();
}
}
public RU(Handle:C, String:O[], String:N[])if (iRU)
{
if ((iRU = GetConVarInt(C)) == 0)
{
UnhookEvent("player_team", PT);
if (iAT)
{
iAT = 0;
CloseHandle(hTRA);
}
}
} else if ((iRU = GetConVarInt(C)))
{
HookEvent("player_team", PT);
OnRebuildAdminCache(AdminCache_Admins);
}
public PT(Handle:E, String:N[], bool:B)if (GetEventInt(E, "oldteam") > 1)
{
if (GetEventBool(E, "disconnect") || GetEventInt(E, "team") < 2)if (iP[(iAH = GetClientOfUserId(GetEventInt(E, "userid")))])
{
if (--iAT)iP[iA[iP[iAH] - 1] = iA[iAT]] = iP[iAH];
else CloseHandle(hTRA);
iP[iAH] = 0;
}
} else if (GetEventInt(E, "team") > 1)if (GetUserFlagBits((iAH = GetClientOfUserId(GetEventInt(E, "userid"))))&iRF)if ((iP[iA[iAT] = iAH] = ++iAT) == 1)TRA();
public Action:RA(Handle:T)
{
new i;
do if (0 < (iAH = GetClientHealth(iA[i])) < iRP)SetEntProp(iA[i], Prop_Send, sPH, iAH + iRU < iRP ? iAH + iRU:iRP);
while (++i < iAT);
return Plugin_Continue;
}
public Action:RO(Handle:T)
{
new i;
do if (0 < (iAH = GetEntData(iA[i], iOH)) < iRP)SetEntData(iA[i], iOH, iAH + iRU < iRP ? iAH + iRU:iRP);
while (++i < iAT);
return Plugin_Continue;
}
TRA()hTRA = CreateTimer(fRS, iOH == -1 ? RA:RO, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
L 06/03/2020 - 20:41:06: SourceMod error session started
L 06/03/2020 - 20:41:06: Info (map "de_dust2") (file "errors_20200603.log")
L 06/03/2020 - 20:41:06: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:06: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:06: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:07: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:07: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:07: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:08: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:08: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:08: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:09: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:09: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:09: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:10: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:10: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:10: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:11: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:11: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:11: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:12: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:12: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:12: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:13: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:13: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:13: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:14: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:14: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:14: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
L 06/03/2020 - 20:41:15: [SM] Native "GetEntData" reported: Entity 11 (11) is invalid
L 06/03/2020 - 20:41:15: [SM] Displaying call stack trace for plugin "Admins_Autoregeneration_HP.smx":
L 06/03/2020 - 20:41:15: [SM] [0] Line 101, Admins_Autoregeneration_HP.sp::RO()
/**
* HpRegeneration plugin by bl4nk
*
* Description:
* When a player gets hurt, they regenerate 'x' amount of life every 'y' seconds until they reach 'z' health.
*
* Commands and Examples:
* sm_hpregeneration_enable - Enables the HpRegeneration plugin.
* - 0 = off
* - 1 = on (default)
* sm_hpregeneration_amount - Amount of life to heal per regeneration tick.
* - 10 = 10 health per tick (default)
* - 25 = 25 health per tick
* sm_hpregeneration_health - Health to regenerate to, based on the control mode.
* - 100 = Regenerate to 100 health (default)
* - 150 = Regenerate to 150 health
* sm_hpregeneration_tickrate - Time, in seconds, between each regeneration tick.
* - 5 = Regenerate health every 5 seconds
* - 10 = Regenerate health every 10 seconds (default)
* sm_hpregeneration_respawn - Enables healing through respawns.
* - 0 = When a player respawns, their health will stop regenerating (default)
* - 1 = When a player respawns, their health will continue to regenerate
* sm_hpregeneration_bots - Enables bots regenerating their life.
* - 0 = Bots do not regenerate life (default)
* - 1 = Bots do regenerate life
* sm_hpregeneration_mode - Controls the regeneration mode.
* - 1 = Players heal to the amount of life defined by the health cvar (default)
* - 2 = Players heal to their default max life plus the amount of life defined by the health cvar
*
* Thanks to:
* MaTTe (mateo10) for making the original "HP Regeneration" plugin.
*
* Changelog at http://forums.alliedmods.net/showthread.php?t=66154
*/
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.1.1"
new MaxHealth[MAXPLAYERS + 1];
new bool:isHooked = false;
new bool:Respawn = false;
new bool:Mode = false;
new Handle:cvarEnable;
new Handle:cvarAmount;
new Handle:cvarHealth;
new Handle:cvarTickRate;
new Handle:cvarRespawn;
new Handle:cvarBot;
new Handle:cvarMode;
new Handle:clientTimer[MAXPLAYERS + 1];
new String:modName[32];
public Plugin:myinfo =
{
name = "HpRegeneration",
author = "bl4nk",
description = "After being damaged, regenerate health over time.",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net"
};
public OnPluginStart()
{
CreateConVar("sm_hpregeneration_version", PLUGIN_VERSION, "HpRegeneration Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
cvarEnable = CreateConVar("sm_hpregeneration_enable", "1", "Enables the HpRegeneration plugin.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
cvarAmount = CreateConVar("sm_hpregeneration_amount", "10", "Amount of life to heal per regeneration tick (Def 10)", FCVAR_PLUGIN, true, 0.0, false, _);
cvarHealth = CreateConVar("sm_hpregeneration_health", "100", "Health to regenerate to, based on the control mode (Def 100)", FCVAR_PLUGIN, true, 0.0, false, _);
cvarTickRate = CreateConVar("sm_hpregeneration_tickrate", "10", "Time, in seconds, between each regeneration tick (Def 10)", FCVAR_PLUGIN, true, 1.0, false, _);
cvarRespawn = CreateConVar("sm_hpregeneration_respawn", "0", "Enables healing through respawns.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
cvarBot = CreateConVar("sm_hpregeneration_bots", "0", "Enables bots regenerating their life.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
cvarMode = CreateConVar("sm_hpregeneration_mode", "1", "Controls the regeneration mode (Def 1)", FCVAR_PLUGIN, true, 1.0, true, 2.0);
AutoExecConfig(true, "plugin.hpregeneration");
CreateTimer(3.0, OnPluginStart_Delayed);
GetGameFolderName(modName, sizeof(modName));
}
public Action:OnPluginStart_Delayed(Handle:timer)
{
if (GetConVarInt(cvarEnable))
{
isHooked = true;
LogMessage("[HpRegeneration] - Loaded");
}
if (GetConVarInt(cvarRespawn))
Respawn = true;
if (GetConVarInt(cvarMode) == 1)
Mode = true;
HookEvent("player_hurt", event_PlayerHurt);
HookEvent("player_spawn", event_PlayerSpawn);
HookConVarChange(cvarEnable, CvarChange);
HookConVarChange(cvarRespawn, CvarChange);
HookConVarChange(cvarMode, CvarChange);
HookConVarChange(cvarTickRate, CvarChange);
}
public event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
if (isHooked)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsFakeClient(client) && !GetConVarInt(cvarBot))
return;
if (clientTimer[client] == INVALID_HANDLE)
clientTimer[client] = CreateTimer(GetConVarFloat(cvarTickRate), RegenTick, client, TIMER_REPEAT);
}
}
public Action:RegenTick(Handle:timer, any:client)
{
new clientHp = GetPlayerHealth(client);
if (Mode)
{
if (clientHp < GetConVarInt(cvarHealth))
{
if (clientHp + GetConVarInt(cvarAmount) > GetConVarInt(cvarHealth))
{
if (strcmp(modName, "tf") == 0)
if (clientHp + GetConVarInt(cvarAmount) > MaxHealth[client])
SetPlayerHealth(client, GetConVarInt(cvarHealth), true);
else
SetPlayerHealth(client, GetConVarInt(cvarHealth), true, true);
else
SetPlayerHealth(client, GetConVarInt(cvarHealth));
KillClientTimer(client);
}
else
{
if (strcmp(modName, "tf") == 0)
if (clientHp + GetConVarInt(cvarAmount) > MaxHealth[client])
SetPlayerHealth(client, clientHp + GetConVarInt(cvarAmount), true);
else
SetPlayerHealth(client, clientHp + GetConVarInt(cvarAmount), true, true);
else
SetPlayerHealth(client, clientHp + GetConVarInt(cvarAmount));
}
}
else
KillClientTimer(client);
}
else
{
if (clientHp < MaxHealth[client] + GetConVarInt(cvarHealth))
{
if (clientHp + GetConVarInt(cvarAmount) > MaxHealth[client] + GetConVarInt(cvarHealth))
{
if (strcmp(modName, "tf") == 0)
SetPlayerHealth(client, MaxHealth[client] + GetConVarInt(cvarHealth), true);
else
SetPlayerHealth(client, MaxHealth[client] + GetConVarInt(cvarHealth));
KillClientTimer(client);
}
else if (strcmp(modName, "tf") == 0)
if (clientHp + GetConVarInt(cvarAmount) > MaxHealth[client])
SetPlayerHealth(client, clientHp + GetConVarInt(cvarAmount), true);
else
SetPlayerHealth(client, clientHp + GetConVarInt(cvarAmount), true, true);
else
SetPlayerHealth(client, clientHp + GetConVarInt(cvarAmount));
}
else
KillClientTimer(client);
}
}
public event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
CreateTimer(0.0, getMaxHealth, client);
if (!Respawn)
{
if (clientTimer[client] != INVALID_HANDLE)
KillClientTimer(client);
}
}
public Action:getMaxHealth(Handle:timer, any:client)
MaxHealth[client] = GetPlayerHealth(client, true);
public CvarChange(Handle:convar, const String:oldValue[], const String:newValue[])
{
if (convar == cvarEnable)
{
if (!GetConVarInt(cvarEnable))
{
if (isHooked)
{
isHooked = false;
KillClientTimer(_, true);
LogMessage("[HpRegeneration] - Plugin disabled.");
}
}
else if (!isHooked)
{
isHooked = true;
LogMessage("[HpRegeneration] - Plugin enabled.");
}
}
else if (convar == cvarRespawn)
{
if (!GetConVarInt(cvarRespawn))
{
if (Respawn)
{
Respawn = false;
LogMessage("[HpRegeneration] - Regeneration through respawn disabled.");
}
}
else if (!Respawn)
{
Respawn = true;
LogMessage("[HpRegeneration] - Regeneration through respawn enabled.");
}
}
else if (convar == cvarMode)
{
if (GetConVarInt(cvarMode) == 2)
{
if (Mode)
{
Mode = false;
LogMessage("[HpRegeneration] - Regeneration mode changed to 2.");
}
}
else if (!Mode)
{
Mode = true;
LogMessage("[HpRegeneration] - Regeneration mode changed to 1.");
}
}
else if (convar == cvarTickRate)
ChangeTickRate();
}
public OnClientDisconnect(client)
if (clientTimer[client] != INVALID_HANDLE)
KillClientTimer(client);
public OnMapEnd()
KillClientTimer(_, true);
GetPlayerHealth(entity, bool:maxHealth=false)
{
if (maxHealth)
{
if (strcmp(modName, "tf") == 0)
return GetEntData(entity, FindDataMapOffs(entity, "m_iMaxHealth"));
else
return 100;
}
return GetEntData(entity, FindDataMapOffs(entity, "m_iHealth"));
}
SetPlayerHealth(entity, amount, bool:maxHealth=false, bool:ResetMax=false)
{
if (maxHealth)
if (ResetMax)
SetEntData(entity, FindDataMapOffs(entity, "m_iMaxHealth"), MaxHealth[entity], 4, true);
else
SetEntData(entity, FindDataMapOffs(entity, "m_iMaxHealth"), amount, 4, true);
SetEntityHealth(entity, amount);
}
KillClientTimer(client=0, bool:all=false)
{
if (all)
{
for (new i; i <= MAXPLAYERS; i++)
{
if (clientTimer[i] != INVALID_HANDLE)
{
KillTimer(clientTimer[client]);
clientTimer[client] = INVALID_HANDLE;
}
}
return;
}
KillTimer(clientTimer[client]);
clientTimer[client] = INVALID_HANDLE;
}
ChangeTickRate()
{
for (new i; i <= MAXPLAYERS; i++)
{
if (clientTimer[i] != INVALID_HANDLE)
{
KillClientTimer(i);
clientTimer[i] = CreateTimer(GetConVarFloat(cvarTickRate), RegenTick, i, TIMER_REPEAT);
}
}
}
#include <sourcemod>
public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
if (client && IsClientInGame(client))
{
if (attacker != 0 && IsClientInGame(attacker))
{
if (attacker != client)
{
char weapon[32];
GetEventString(event, "weapon", weapon, sizeof(weapon));
if (!GetEntProp(attacker, Prop_Send, "m_bIsScoped") && strcmp(weapon, "awp", false) == 0 || strcmp(weapon, "scout", false) == 0)
{
PrintToChatAll("\x073CFF3C[nozoom] \x07FF0000%N \x01убил без прицела \x07FF0000%N", attacker, client);
}
}
}
}
}
public Plugin:myinfo =
{
name = "Admins_Autoregeneration_HP",
version = "1.0.0",
description = "Авторегенерация HP Админов",
author = "AlmazON (человек-обфускатор)",
url = "http://www.hlmod.ru"
}
new Float:fSpeed,
Handle:hBuffer,
iAdmins[MAXPLAYERS-1],
iBuffer,
iAdminsNum,
m_iHealth,
iPlayers[MAXPLAYERS+1],
iFlags,
iPeak,
iUnits,
String:sBuffer[32];
public OnPluginStart()
{
HookConVarChange(hBuffer = CreateConVar("admin_regen_hp_flags", "", "Flags of the administration for access to regeneration.\n\"\" - all."), CVarChange_Flags);
GetConVarString(hBuffer, sBuffer, AdminFlags_TOTAL);
iFlags = ReadFlagString(sBuffer[0] ? sBuffer : "abcdefghijklmnopqrstz");
HookConVarChange(hBuffer = CreateConVar("admin_regen_hp_peak", "100", "The peak amount of regenerated health.", _, true, 2.0), CVarChange_Peak);
iPeak = GetConVarInt(hBuffer);
HookConVarChange(hBuffer = CreateConVar("admin_regen_hp_speed", "1.0", "The speed of healing in seconds.", _, true, 0.1), CVarChange_Speed);
fSpeed = GetConVarFloat(hBuffer);
HookConVarChange(hBuffer = CreateConVar("admin_regen_hp_units", "2", "The number of units healing at a time.\n0 - disable.", _, true), CVarChange_Units);
CVarChange_Units(hBuffer, sBuffer, sBuffer);
if((m_iHealth = FindSendPropInfo("CCSPlayer", "m_iHealth")) == -1)
{
if(!GameConfGetKeyValue((hBuffer = LoadGameConfigFile("core.games")), "m_iHealth", sBuffer, sizeof(sBuffer)))
sBuffer = "m_iHealth";
CloseHandle(hBuffer);
}
AutoExecConfig(_, "AdminsAutoregenerationHP");
}
public OnMapEnd()
{
iAdminsNum = 0;
}
public OnRebuildAdminCache(AdminCachePart:P)
if(iUnits) if(P == AdminCache_Admins)
{
iBuffer = iAdminsNum;
iAdminsNum = 0;
for(new i = 1; i <= MaxClients; ++i)
{
if(IsClientInGame(i) && GetClientTeam(i) > 1 && GetUserFlagBits(i)&iFlags)
{
iPlayers[iAdmins[iAdminsNum] = i] = ++iAdminsNum;
continue;
}
iPlayers[i] = 0;
}
if(iBuffer)
{
if(!iAdminsNum) CloseHandle(hBuffer);
}
else if(iAdminsNum) StartTimer();
}
public CVarChange_Flags(Handle:C, String:O[], const String:N[])
{
iFlags = ReadFlagString(N[0] ? N : "abcdefghijklmnopqrstz");
OnRebuildAdminCache(AdminCache_Admins);
}
public CVarChange_Peak(Handle:C, String:O[], String:N[])
{
iPeak = GetConVarInt(C);
}
public CVarChange_Speed(Handle:C, String:O[], String:N[])
{
fSpeed = GetConVarFloat(C);
if(iAdminsNum)
{
CloseHandle(hBuffer);
StartTimer();
}
}
public CVarChange_Units(Handle:C, String:O[], String:N[])
{
if(iUnits)
{
if(!(iUnits = GetConVarInt(C)))
{
UnhookEvent("player_team", Event_Team);
if(iAdminsNum)
{
iAdminsNum = 0;
CloseHandle(hBuffer);
}
}
}
else if((iUnits = GetConVarInt(C)))
{
HookEvent("player_team", Event_Team);
OnRebuildAdminCache(AdminCache_Admins);
}
}
public Event_Team(Handle:E, String:N[], bool:B)
{
if(GetEventInt(E, "oldteam") > 1)
{
if((GetEventBool(E, "disconnect") || GetEventInt(E, "team") < 2)
&& iPlayers[(iBuffer = GetClientOfUserId(GetEventInt(E, "userid")))])
{
if(--iAdminsNum) iPlayers[iAdmins[iPlayers[iBuffer] - 1] = iAdmins[iAdminsNum]] = iPlayers[iBuffer];
else CloseHandle(hBuffer);
iPlayers[iBuffer] = 0;
}
}
else if(GetEventInt(E, "team") > 1
&& GetUserFlagBits((iBuffer = GetClientOfUserId(GetEventInt(E, "userid")))) & iFlags
&& (iPlayers[iAdmins[iAdminsNum] = iBuffer] = ++iAdminsNum) == 1)
StartTimer();
}
public Action:Timer_RegenA(Handle:T)
{
new i;
do if(0 < (iBuffer = GetClientHealth(iAdmins[i])) && iBuffer < iPeak)
SetEntProp(iAdmins[i], Prop_Send, sBuffer, iBuffer + iUnits < iPeak ? iBuffer + iUnits : iPeak);
while(++i < iAdminsNum);
return Plugin_Continue;
}
public Action:Timer_RegenO(Handle:T)
{
new i;
do if(0 < (iBuffer = GetEntData(iAdmins[i], m_iHealth)) && iBuffer < iPeak)
SetEntData(iAdmins[i], m_iHealth, iBuffer + iUnits < iPeak ? iBuffer + iUnits : iPeak);
while(++i < iAdminsNum);
return Plugin_Continue;
}
StartTimer()
{
hBuffer = CreateTimer(fSpeed, m_iHealth == -1 ? Timer_RegenA : Timer_RegenO, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
#include <sourcemod>
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
if (attacker && client != attacker)
{
char weapon[32];
event.GetString("weapon", weapon, sizeof(weapon));
if ((strcmp(weapon, "awp", false) == 0 || strcmp(weapon, "scout", false) == 0) && !GetEntProp(attacker, Prop_Send, "m_bIsScoped"))
{
PrintToChatAll("\x073CFF3C[nozoom] \x07FF0000%N \x01убил без прицела \x07FF0000%N", attacker, client);
}
}
}
public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
static int client, attacker;
if(!(client = GetClientOfUserId(event.GetInt("userid"))) || !(attacker = GetClientOfUserId(event.GetInt("attacker")))
|| attacker == client)
return;
static char wpn[8];
GetEventString(event, "weapon", wpn, sizeof(wpn));
if(!GetEntProp(attacker, Prop_Send, "m_bIsScoped") && (!strcmp(wpn, "awp", false) || !strcmp(wpn, "scout", false)))
PrintToChatAll("\x073CFF3C[nozoom] \x07FF0000%N \x01убил без прицела \x07FF0000%N", attacker, client);
}
А можно перевести это на русский?его как бы убивало, но при этом не отнимался фраг
Игрок умирает,но статистика убийств и смертей не затрагиваетсяА можно перевести это на русский?
Скачал плагин fov с - [ANY] Unrestricted FOV - AlliedModders
Игра: CS:GO
В итоге еррор логах спамит ошибку Помогите пожалуйста исправить
@frai-fraevich, не знаю точно, что в киллфиде выводит, но если awp и scout, то так оно должно работать:
P.S. А может в 34 m_bIsScoped не устанавливается. Есть же плагины готовые.
C-подобный:#include <sourcemod> public void OnPluginStart() { HookEvent("player_death", Event_PlayerDeath); } public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); int attacker = GetClientOfUserId(event.GetInt("attacker")); if (attacker && client != attacker) { char weapon[32]; event.GetString("weapon", weapon, sizeof(weapon)); if ((strcmp(weapon, "awp", false) == 0 || strcmp(weapon, "scout", false) == 0) && !GetEntProp(attacker, Prop_Send, "m_bIsScoped")) { PrintToChatAll("\x073CFF3C[nozoom] \x07FF0000%N \x01убил без прицела \x07FF0000%N", attacker, client); } } }
frai-fraevich, у тебя проверка оружия не заключена в скобки, а ИЛИ имеет более высокий приоритет, чем И. Поэтому проверка точно работает неправильно.
Попробуй вот так:И ещё: в CSS нет параметра m_bIsScoped (он есть только в CSGO).C-подобный:public OnPluginStart() { HookEvent("player_death", Event_PlayerDeath); } public Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { static int client, attacker; if(!(client = GetClientOfUserId(event.GetInt("userid"))) || !(attacker = GetClientOfUserId(event.GetInt("attacker"))) || attacker == client) return; static char wpn[8]; GetEventString(event, "weapon", wpn, sizeof(wpn)); if(!GetEntProp(attacker, Prop_Send, "m_bIsScoped") && (!strcmp(wpn, "awp", false) || !strcmp(wpn, "scout", false))) PrintToChatAll("\x073CFF3C[nozoom] \x07FF0000%N \x01убил без прицела \x07FF0000%N", attacker, client); }
Можно мою версию плагина использовать (ну или часть кода из него). При использовании плагина нужно ещё взять файлы переводов из комментов выше в той теме.
кто бы сомневалсякороче не работает
И ещё: в CSS нет параметра m_bIsScoped (он есть только в CSGO).![]()