Проблема с AcceptEntityInput

Vit_ amin

Добрая душа
Сообщения
1,525
Реакции
688
Есть код
PHP:
#include <sdktools_entinput> 
#include <sdktools_functions> 

int b_tank_count = 0; 

public Plugin myinfo = 
{ 
    name = "L4D Tank Functions", 
    author = "Vitamin", 
    description = "Shows tank Health and Fix CheckPoint Doors When Tank is Spawned", 
    version = "1.1", 
    url = "http://l4d-zone.ru" 
}; 

public void OnPluginStart() 
{ 
    HookEvent("tank_spawn", Event_TankSpawn); 
    HookEvent("tank_killed", Event_TankKilled); 
    HookEvent("player_hurt", Event_PlayerHurt); 
    LoadTranslations("common.phrases"); 
} 

public OnMapStart() 
{ 
    if (b_tank_count) 
    { 
        b_tank_count = 0; 
    } 
} 

public void Event_TankSpawn(Event event, const char[] name, bool dontBroadcast) 
{ 
    b_tank_count++; 
    if (b_tank_count ==    1) 
    { 
        DoorState_Func("Close,SetSpeed 0"); 
        PrintToChatAll("\x01[\x03L4D-Zone.RU\x01] %t", "DoorState Lock"); 
    } 
    PrintHintTextToAll("%t", "Tank Health", GetClientHealth(GetClientOfUserId(event.GetInt("userid")))); 
} 

public void Event_PlayerHurt(Event event, const char[] name, bool dontBroadcast) 
{ 
    int client = GetClientOfUserId(event.GetInt("userid")); 
    if (GetEntProp(client, Prop_Send, "m_zombieClass") == 5) 
    { 
        if (GetEntityFlags(client) & FL_ONFIRE) 
        { 
            PrintHintTextToAll("%t", "Tank At Fire"); 
        } 
        else 
        { 
            if (event.GetInt("type") != 131072) 
            { 
                int tank_health = event.GetInt("health"); 
                if (IsPlayerAlive(client)) 
                { 
                    PrintHintTextToAll("%t", "Tank Health", tank_health); 
                } 
            } 
        } 
    } 
} 


public void Event_TankKilled(Event event, const char[] name, bool dontBroadcast) 
{ 
    b_tank_count--; 
    if (!b_tank_count) 
    { 
        DoorState_Func("Open,SetSpeed 200"); 
        PrintToChatAll("\x01[\x03L4D-Zone.RU\x01] %t", "DoorState Unlock"); 
    } 
    PrintHintTextToAll("%t", "Tank Health Zero"); 
} 

void DoorState_Func(const char[] input) 
{ 
    char input_commands[2][16]; 
    ExplodeString (input, ",", input_commands, 2, sizeof(input_commands[])); 
    int ent_index = -1; 
    while ((ent_index = FindEntityByClassname(ent_index, "prop_door_rotating_checkpoint")) > 0) 
    { 
        for (int index = 0; index <= 1; index++) 
        { 
            PrintToChatAll("Input %s", input_commands[index]); 
            StripQuotes(input_commands[index]); 
            AcceptEntityInput(ent_index, input_commands[index]); 
        } 
    } 
}
Не могу понять почему не делается AcceptEntityInput на SetSpeed, с Close/Open все нормально
 
Сверху Снизу