chat messages do not appear. someone can help me?_
.sp file
PHP Code:
#include <sdktools>
#include <cstrike>
#include <multicolors>
new Float:g_c4PlantTime;
new bool:g_DefuseFlag;
new Float:g_activeIncendiary;
new Float:g_bombPosition[3];
public Plugin:myinfo =
{
name = "Hizli Bomba Imha",
description = "Retake modu icin hizli bomba imha etmek.",
author = "",
version = "1.2",
url = "CSP"
};
public OnPluginStart()
{
HookEvent("bomb_begindefuse", Event_BeginDefuse);
HookEvent("bomb_planted", Event_BombPlanted);
HookEvent("round_start", Event_RoundStart);
HookEvent("molotov_detonate", molotov_explode);
g_c4PlantTime = -1.0;
g_activeIncendiary = -1.0;
CreateConVar("CSP_hizlibombaimha_aktif", "1", "Whether the plugin is enabled", 0, false, 0.0, false, 0.0);
AutoExecConfig(true, "CSP_hizlibombaimha");
LoadTranslations("CSP_hizlibombaimha.phrases");
}
public Action:Event_BeginDefuse(Handle:event, String:name[], bool:dontBroadcast)
{
new Float:remaining = GetConVarFloat(FindConVar("mp_c4timer")) - (GetGameTime() - g_c4PlantTime);
new iCount;
new i = 1;
while (i <= MaxClients)
{
if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
{
iCount++;
}
i++;
}
if((GetGameTime()-g_activeIncendiary)<7.0)
{
CPrintToChatAll("[CSP] %t", "MolotofUyarisi");
}
if (GetConVarInt(FindConVar("sm_instadefuse_enabled")) == 1 && iCount < 1 && g_DefuseFlag && ((GetGameTime()-g_activeIncendiary)>=7.0))
{
if (remaining > 10.0 || (remaining > 5.0 && GetEventBool(event, "haskit", false)))
{
new userid = GetEventInt(event, "userid");
CreateTimer(0.0, timer_delay, userid);
CPrintToChatAll("[CSP] %t", "ImhaEdildi", remaining);
g_DefuseFlag = false;
}
if (remaining < 5.0 || (remaining < 10.0 && !GetEventBool(event, "haskit", false)))
{
CS_TerminateRound(1.5, CSRoundEndReason:8, false);
CPrintToChatAll("[CSP] %t", "ImhaEdilemedi", remaining);
g_DefuseFlag = false;
}
}
return Action:0;
}
public Action:Event_BombPlanted(Handle:event, String:name[], bool:dontBroadcast)
{
g_c4PlantTime = GetGameTime();
new ent = -1;
while ((ent = FindEntityByClassname(ent, "planted_c4")) != -1)
{
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", g_bombPosition);
}
return Action:0;
}
public Action:Event_RoundStart(Handle:event, String:name[], bool:dontBroadcast)
{
g_c4PlantTime = -1.0;
g_DefuseFlag = true;
g_activeIncendiary = 0.0;
return Action:0;
}
public Action:timer_delay(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if(client != 0)
{
if(IsPlayerAlive(client))
{
new c4 = FindEntityByClassname(MaxClients+1, "planted_c4");
if(c4 != -1)
{
SetEntPropFloat(c4, Prop_Send, "m_flDefuseCountDown", 0.0);
SetEntProp(client, Prop_Send, "m_iProgressBarDuration", 0);
}
}
}
}
public molotov_explode(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetEventInt(event, "userid");
new client = GetClientOfUserId(userid);
if(GetClientTeam(client) == 2)
{
new Float:f_Pos[3];
f_Pos[0] = GetEventFloat(event, "x");
f_Pos[1] = GetEventFloat(event, "y");
f_Pos[2] = GetEventFloat(event, "z");
if((FloatAbs(g_bombPosition[0])-FloatAbs(f_Pos[0]) < 170 ) && (FloatAbs(g_bombPosition[1])-FloatAbs(f_Pos[1]) < 170 ) && (FloatAbs(g_bombPosition[2])-FloatAbs(f_Pos[2]) < 170 ) )
{
g_activeIncendiary = GetGameTime();
}
}
}
translation file
Code:
"Phrases"
{
"MolotofUyarisi"
{
"en" "Active {green}molotov{default} present, Good luck defusing."
"tr" "Aktif {green}molotof{default} var. Hızlı imha devre dışı."
}
"ImhaEdildi"
{
"#format" "{1:.1f}"
"en" "CT's defused the bomb in time! {green}{1}{default} remaining."
"tr" "CT bombayı imha etti! Bomba patlamasına {green}{1} saniye{default} kalmıştı."
}
"ImhaEdilemedi"
{
"#format" "{1:.1f}"
"en" "CT's didn't defuse in time! {green}{1}{default} remaining."
"tr" "CT bombayı imha edemedi! Bomba patlamasına {green}{1} saniye{default} var. Süre yetersiz."
}
}
__________________