kill message исправление.

WeSTMan

А вот тут текст!
Сообщения
833
Реакции
516
Ребят, кто шарит эту тему, прошу исправить плагин.
Сама ошибка:
PHP:
0/08/2013 - 20:57:54: Info (map "aim_deagle7k") (file "errors_20131008.log")
L 10/08/2013 - 20:57:54: [SM] Native "ClientCommand" reported: Client 13 is not connected
L 10/08/2013 - 20:57:54: [SM] Displaying call stack trace for plugin "sm_killmessage_framework.smx":
L 10/08/2013 - 20:57:54: [SM]   [0]  Line 62, D:\csgo-astra.ru\css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::ClearScreen()
L 10/08/2013 - 20:57:54: [SM]   [1]  Line 69, D:\csgo-astra.ru\css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::CleanTimer()
L 10/08/2013 - 21:07:29: Error log file session closed.
 

Вложения

  • sm_killmessage_framework.sp
    2.4 КБ · Просмотры: 55

EPacker2

3D-моделист
Сообщения
1,040
Реакции
759
PHP:
L 10/08/2013 - 20:57:54: [SM] Native "ClientCommand" reported: Client 13 is not connected
L 10/08/2013 - 20:57:54: [SM] Displaying call stack trace for plugin "sm_killmessage_framework.smx":
L 10/08/2013 - 20:57:54: [SM]   [0]  Line 62, D:\csgo-astra.ru\css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::ClearScreen()
L 10/08/2013 - 20:57:54: [SM]   [1]  Line 69, D:\csgo-astra.ru\css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::CleanTimer()
Добавляешь IsClientConnected(client) и все. :)
 

Вложения

  • sm_killmessage_framework.sp
    2.5 КБ · Просмотры: 178
  • sm_killmessage_framework.smx
    4.4 КБ · Просмотры: 126

Сергей Бурик

Участник
Сообщения
19
Реакции
0
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "2.2"

new Handle:_atCleanTimer[MAXPLAYERS+1] = INVALID_HANDLE
new Handle:_hTimerLength;
new Float:_dTimerLength;

public Plugin:myinfo =
{
name = "Kill Message Overlays Framework",
author = "Siang Chun & Black Haze & Xeon",
description = "Framework for Kill Message Overlays",
version = PLUGIN_VERSION,
url = "bslw.co.uk & beernweed.com & csgo-astra.ru"
}

public OnPluginStart()
{
_hTimerLength = CreateConVar("sm_killmessage_overlays_length", "3.0", "Length of time an overlay is showed", FCVAR_PLUGIN|FCVAR_REPLICATED, true, 1.0);
_dTimerLength = GetConVarFloat(_hTimerLength);

RegServerCmd("sm_killmessage_show", ShowKillMessage);
RegServerCmd("sm_killmessage_prepare", PrepareOverlay);
}

public Action:ShowKillMessage(args)
{
if (args < 2)
{
return Plugin_Handled;
}

decl String: client_id[192];
GetCmdArg(1, client_id, sizeof(client_id));
new client = GetClientOfUserId(StringToInt(client_id));

if(client > 0 && IsClientConnected(client))
{
decl String: sOverLay[192];
GetCmdArg(2, sOverLay, sizeof(sOverLay));

if(_atCleanTimer[client] !=INVALID_HANDLE)
{
KillTimer(_atCleanTimer[client]);
_atCleanTimer[client] =INVALID_HANDLE;
}

_atCleanTimer[client] = CreateTimer(_dTimerLength,CleanTimer,client);

ClearScreen(client);
ClientCommand(client, "r_screenoverlay \"CombatArms/%s.vtf\"",sOverLay);
}
return Plugin_Handled;
}

public ClearScreen(client)
{
if(client > 0 && IsClientConnected(client))
{
ClientCommand(client, "r_screenoverlay \"\"");
}
}

public Action:CleanTimer(Handle:Timer, any:client)
{
_atCleanTimer[client] = INVALID_HANDLE;
ClearScreen(client);
}

public Action:PrepareOverlay(args)
{
if (args < 1)
{
return Plugin_Handled;
}

decl String: sOverLay[192];
GetCmdArg(1, sOverLay, sizeof(sOverLay));

new String:overlays_file[64];
new String:overlays_dltable[64];

Format(overlays_file,sizeof(overlays_file),"CombatArms/%s.vtf",sOverLay);
PrecacheDecal(overlays_file,true);
Format(overlays_dltable,sizeof(overlays_dltable),"materials/CombatArms/%s.vtf",sOverLay);
AddFileToDownloadsTable(overlays_dltable);
Format(overlays_file,sizeof(overlays_file),"CombatArms/%s.vmt",sOverLay);
PrecacheDecal(overlays_file,true);
Format(overlays_dltable,sizeof(overlays_dltable),"materials/CombatArms/%s.vmt",sOverLay);
AddFileToDownloadsTable(overlays_dltable);

return Plugin_Handled;
}

Добавлено через 45 секунд
вот и в логахпишет часто
L 03/22/2015 - 09:11:34: [SM] Native "ClientCommand" reported: Client 2 is not connected
L 03/22/2015 - 09:11:34: [SM] Displaying call stack trace for plugin "sm_killmessage_framework.smx":
L 03/22/2015 - 09:11:34: [SM] [0] Line 62, D:\Games\CSS_SERVER\steampipe_css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::ClearScreen()
L 03/22/2015 - 09:11:34: [SM] [1] Line 69, D:\Games\CSS_SERVER\steampipe_css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::CleanTimer()
L 03/22/2015 - 09:14:20: Error log file session closed.

Добавлено через 4 минуты
вот второй исходник


#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.2fixed"

new Handle:_hGrenadeOverlay;
new Handle:_hHeadShotOverlay;
new Handle:_hKnifeOverlay;
new Handle:_hCTWinsOverlay;
new Handle:_hTWinsOverlay;
new Handle:_hKillOverlayNaming;
new Handle:_hMaxKillStreak;
new String:_sGrenadeOverlay[32];
new String:_sHeadShotOverlay[32];
new String:_sKnifeOverlay[32];
new String:_sCTWinsOverlay[32];
new String:_sTWinsOverlay[32];
new String:_sKillOverlayNaming[32];
new _iMaxKillStreak;
new _aiKillStreak[MAXPLAYERS+1];
new _abClientDead[MAXPLAYERS+1];

public Plugin:myinfo =
{
name = "Kill Message Overlays Basic Triggers",
author = "Siang Chun & Black Haze",
description = "Basic Triggers for Kill Message Overlays",
version = PLUGIN_VERSION,
url = "bslw.co.uk & beernweed.com"
}

public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
HookEvent("player_spawn", Event_PlayerSpawn);
HookEvent("round_end", Event_RoundEnd);

_hGrenadeOverlay = CreateConVar("sm_killmessage_bs_grenade", "killsilver_grenade", "Name of the grenade kill overlay (no extension)");
_hHeadShotOverlay = CreateConVar("sm_killmessage_bs_headshot", "killsilver_headshot", "Name of the headshot kill overlay (no extension)");
_hKnifeOverlay = CreateConVar("sm_killmessage_bs_knife", "killsilver_knife", "Name of the knife kill overlay (no extension)");
_hCTWinsOverlay = CreateConVar("sm_killmessage_bs_ctwins", "killsilver_ct_wins", "Name of the CT wins overlay (no extension)");
_hTWinsOverlay = CreateConVar("sm_killmessage_bs_twins", "killsilver_t_wins", "Name of the T wins overlay (no extension)");
_hKillOverlayNaming = CreateConVar("sm_killmessage_bs_killnaming", "killsilver_", "Naming convention for the kill overlays (numbers are added automatically,no extension)");
_hMaxKillStreak = CreateConVar("sm_killmessage_bs_maxkillstreak", "4", "Amount of kills allowed in a killstreak (it'll restart at 1 after the end)");

AutoExecConfig(true, "killmessage_basicsupport");
}

public OnConfigsExecuted()
{
GetConVarString(_hGrenadeOverlay, _sGrenadeOverlay, sizeof(_sGrenadeOverlay));
GetConVarString(_hHeadShotOverlay, _sHeadShotOverlay, sizeof(_sHeadShotOverlay));
GetConVarString(_hKnifeOverlay, _sKnifeOverlay, sizeof(_sKnifeOverlay));
GetConVarString(_hCTWinsOverlay, _sCTWinsOverlay, sizeof(_sCTWinsOverlay));
GetConVarString(_hTWinsOverlay, _sTWinsOverlay, sizeof(_sTWinsOverlay));
GetConVarString(_hKillOverlayNaming, _sKillOverlayNaming, sizeof(_sKillOverlayNaming));
_iMaxKillStreak = GetConVarInt(_hMaxKillStreak);

ServerCommand("sm_killmessage_prepare %s",_sGrenadeOverlay);
ServerCommand("sm_killmessage_prepare %s",_sHeadShotOverlay);
ServerCommand("sm_killmessage_prepare %s",_sKnifeOverlay);
ServerCommand("sm_killmessage_prepare %s",_sCTWinsOverlay);
ServerCommand("sm_killmessage_prepare %s",_sTWinsOverlay);

new iCounter;
for (iCounter = 1; iCounter <= _iMaxKillStreak; iCounter++)
{
new String:sCounterTemp[64];
IntToString(iCounter, sCounterTemp,sizeof(sCounterTemp));
ServerCommand("sm_killmessage_prepare %s%s",_sKillOverlayNaming,sCounterTemp);
}
}

public OnClientPutInServer(client)
{
if(client>0)
{
_aiKillStreak[client]=0;
_abClientDead[client]=false;
}
}

public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client;
client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client>0)
{
if(_abClientDead[client])
{
_aiKillStreak[client]=0;
_abClientDead[client]=false;
}
}
}

public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new String:sAttackerID[32];
GetEventString(event, "attacker",sAttackerID, sizeof(sAttackerID));

new victim = GetClientOfUserId(GetEventInt(event, "userid"))

_abClientDead[victim]=true;

if(attacker>0)
{
if(!IsFakeClient(attacker))
{
if(victim != attacker)
{
_aiKillStreak[attacker]++;
if(_aiKillStreak[attacker]>_iMaxKillStreak)
{
_aiKillStreak[attacker]=1;
}
new bool:headshot = GetEventBool(event, "headshot");
new String:weapon[32];
GetEventString(event, "weapon",weapon, sizeof(weapon));

if(StrEqual(weapon, "hegrenade"))
{
ServerCommand("sm_killmessage_show %s %s",sAttackerID,_sGrenadeOverlay);
}
else if(StrEqual(weapon,"knife"))
{
ServerCommand("sm_killmessage_show %s %s",sAttackerID,_sKnifeOverlay);
}
else if(headshot)
{
ServerCommand("sm_killmessage_show %s %s",sAttackerID,_sHeadShotOverlay);
}
else
{
new String:sKillStreakTemp[64];
IntToString(_aiKillStreak[attacker], sKillStreakTemp,sizeof(sKillStreakTemp));
ServerCommand("sm_killmessage_show %s %s%s",sAttackerID,_sKillOverlayNaming,sKillStreakTemp);
}
}
}
}
}

public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
new iWinningTeam = GetEventInt(event, "winner");

if (iWinningTeam == 2)
{
for (new iClientCounter = 1; iClientCounter <= MaxClients; iClientCounter++)
{
if(IsClientInGame(iClientCounter))
{
ServerCommand("sm_killmessage_show %i %s",GetClientUserId(iClientCounter),_sTWinsOverlay);
}
}
}
else if (iWinningTeam == 3)
{
for (new iClientCounter = 1; iClientCounter <= MaxClients; iClientCounter++)
{
if(IsClientInGame(iClientCounter))
{
ServerCommand("sm_killmessage_show %i %s",GetClientUserId(iClientCounter),_sCTWinsOverlay);
}
}
}
}
 
Последнее редактирование:

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,755
Полностью оптимизированные версии уже делал здесь. Правда, по версии может и устарело - какое уж давали для исправления.
 

Сергей Бурик

Участник
Сообщения
19
Реакции
0
но оно точно рабочее логи не созают а то логи пишет и звуки мне от него не нужны
 

Сергей Бурик

Участник
Сообщения
19
Реакции
0
на сноаере стоит соурсмод нормальный тех поддержка сказала что все норм у меня ссоурсмодом
 

Сергей Бурик

Участник
Сообщения
19
Реакции
0
L 03/24/2015 - 20:47:47: [SM] Displaying call stack trace for plugin "sm_killmessage_framework.smx":
L 03/24/2015 - 20:47:47: [SM] [0] Line 62, D:\steampipe_css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::ClearScreen()
L 03/24/2015 - 20:47:47: [SM] [1] Line 69, D:\steampipe_css\cstrike\addons\sourcemod\scripting\sm_killmessage_framework.sp::CleanTimer()
L 03/24/2015 - 20:47:47: [SM] Native "ClientCommand" reported: Client 11 is not connected

Добавлено через 11 часов 7 минут
Ну так кто нибудь поможет ставил только один этот плагин на сервак тоже логи пишит
 
Последнее редактирование:

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,755
Ну так кто нибудь поможет
А сказать, что это твой исходник - никак? Я уж думал, ты и на мою версию жалуешься, но там строки вовсе не совпадают.
Скачивай здесь - версии фактически одинаковые, только Combat Arms допиши везде, как у себя.
 
Сверху Снизу