alexmy
Участник
- Сообщения
- 284
- Реакции
- 13
Всем привет, помогите не могу допилить. Команда для активации "Вид третьего лица" всегда включается с второй попытке что не так?
Оффтоп
Оффтоп
PHP:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <colors>
#define PLUGIN_VERSION "2.12"
#define CVAR_FLAGS FCVAR_PLUGIN|FCVAR_NOTIFY
#define DEBUG 0
new Handle:timer_handle=INVALID_HANDLE;
public void OnPluginStart()
{
HookEvent("round_start", Event_RoundStart);
HookEvent("round_end", Event_RoundEnd);
RegConsoleCmd("sm_3", third); //Включаем.
RegConsoleCmd("sm_1", first); //Отключаем.
}
public OnClientPostAdminCheck(client)
{
ClientCommand(client, "bind z sm_3");
}
public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
if(timer_handle != INVALID_HANDLE )
{
KillTimer(timer_handle);
timer_handle=INVALID_HANDLE;
}
if(timer_handle == INVALID_HANDLE)
{
timer_handle=CreateTimer(280.0, Msg, 0, TIMER_REPEAT);
}
return Plugin_Continue;
}
public Action third(int client, int args)
{
ClientCommand(client, "thirdpersonshoulder");
ClientCommand(client, "c_thirdpersonshoulderoffset 0");
ClientCommand(client, "c_thirdpersonshoulderaimdist 720"); //720
ClientCommand(client, "cam_ideallag 0");
ClientCommand(client, "cl_crosshair_dynamic 0"); // При значении 0 прицел двигаться не будет
ClientCommand(client, "cl_crosshair_thickness 1"); //Размер прицела 1, 2, 3, 4, 5,
FakeClientCommand(client, "sm_laser off"); //Отключаем лазер
if(GetClientTeam(client)==3) ClientCommand(client, "cam_idealdist 90");
else ClientCommand(client, "cam_idealdist 40");
decl String:player_name[65];
GetClientName(client, player_name, sizeof(player_name));
CPrintToChat(client, "\x03Выключить Вид \x04!1.");
return Plugin_Handled;
}
public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
if(timer_handle != INVALID_HANDLE )
{
KillTimer(timer_handle);
timer_handle=INVALID_HANDLE;
}
return Plugin_Continue;
}
public Action:Msg(Handle:timer, any:data)
{
// PrintToChatAll("Бла Бла");
return Plugin_Continue;
}
public Action first(int client, int args)
{
ClientCommand(client, "thirdpersonshoulder");
ClientCommand(client, "c_thirdpersonshoulder 0");
ClientCommand(client, "cl_crosshair_dynamic 1"); // При значении 0 прицел двигаться не будет
ClientCommand(client, "cl_crosshair_thickness 3"); //Размер прицела 1, 2, 3, 4, 5,
FakeClientCommand(client, "sm_laser on"); //Включам лазер
return Plugin_Handled;
}