Исправить [ANY] Hook Grab Rope

Статус
В этой теме нельзя размещать новые ответы.

Someone

Участник
Сообщения
1,933
Реакции
1,653
Можешь написать, что нужно исправить? у меня версия hookgrabrope_1.1.5.zip

PHP:
public Action:GrabSearch(Handle:timer, any:client)
{
    if(IsPlayerAlive(client))
    {
        PrintCenterText(client, "%t", "Searching"); // Tell client the plugin is searching for a target
        if( client > 0 &&
            IsClientInGame(client) &&
            g_Status[client][Grab] &&
            !g_Grabbed[client])
        {
            // Init variables
            new Float:clientloc[3], Float:clientang[3];
            GetClientEyePosition(client, clientloc);
            GetClientEyeAngles(client, clientang);
            
            // Grab search traceray
            TR_TraceRayFilter(clientloc, clientang, MASK_ALL, RayType_Infinite, TraceRayGrabEnt); // Create a ray that tells where the player is looking
            g_Targetindex[client][Grab] = TR_GetEntityIndex(); // Set the seekers targetindex to the person he picked up
            
            // Found a player or object
            if(g_Targetindex[client][Grab] > 0 && IsValidEntity(g_Targetindex[client][Grab]))
            {
                // Init variables
                new Float:targetloc[3];
                GetEntityOrigin(g_Targetindex[client][Grab], targetloc); // Find the target's xyz coordinate
                g_Distance[client][1] = GetVectorDistance(targetloc, clientloc); // Tell plugin the distance between the two to maintain
                if( g_Targetindex[client][Grab] > 0 &&
                    g_Targetindex[client][Grab] <= MaxClients &&
                    IsClientInGame(g_Targetindex[client][Grab]))
                {
                    g_MaxSpeed[client] = GetEntPropFloat(client, Prop_Send, "m_flMaxspeed");
                    g_Grabbed[g_Targetindex[client][Grab]] = true; // If target is a player, tell plugin player is being grabbed
                    SetEntPropFloat(g_Targetindex[client][Grab], Prop_Send, "m_flMaxspeed", 0.01); // Slow grab target
                }
                
                // Call grab forward
                new ret;
                Call_StartForward(FwdClientGrab);
                Call_PushCell(client);
                Call_Finish(ret);
                if(ret)
                {
                    Action_Drop(client);
                    return Plugin_Stop;
                }
                
                // Finish grabbing
                EmitSoundFromOrigin(g_cvarSound[Grab], targetloc); // Emit sound from the entity being grabbed
                CreateTimer(0.05, Grabbing, client, TIMER_REPEAT); // Start a repeating timer that will reposition the target in the grabber's crosshairs
                return Plugin_Stop; // Stop the search timer
            }
        }
        else
        {
            Action_Drop(client);
            return Plugin_Stop; // Stop the timer
        }
    }
    return Plugin_Continue;
}
 

Rilsan

Участник
Сообщения
180
Реакции
24
PHP:
public Action:GrabSearch(Handle:timer, any:client)
{
    if(IsPlayerAlive(client))
    {
        PrintCenterText(client, "%t", "Searching"); // Tell client the plugin is searching for a target
        if( client > 0 &&
            IsClientInGame(client) &&
            g_Status[client][Grab] &&
            !g_Grabbed[client])
        {
            // Init variables
            new Float:clientloc[3], Float:clientang[3];
            GetClientEyePosition(client, clientloc);
            GetClientEyeAngles(client, clientang);
         
            // Grab search traceray
            TR_TraceRayFilter(clientloc, clientang, MASK_ALL, RayType_Infinite, TraceRayGrabEnt); // Create a ray that tells where the player is looking
            g_Targetindex[client][Grab] = TR_GetEntityIndex(); // Set the seekers targetindex to the person he picked up
         
            // Found a player or object
            if(g_Targetindex[client][Grab] > 0 && IsValidEntity(g_Targetindex[client][Grab]))
            {
                // Init variables
                new Float:targetloc[3];
                GetEntityOrigin(g_Targetindex[client][Grab], targetloc); // Find the target's xyz coordinate
                g_Distance[client][1] = GetVectorDistance(targetloc, clientloc); // Tell plugin the distance between the two to maintain
                if( g_Targetindex[client][Grab] > 0 &&
                    g_Targetindex[client][Grab] <= MaxClients &&
                    IsClientInGame(g_Targetindex[client][Grab]))
                {
                    g_MaxSpeed[client] = GetEntPropFloat(client, Prop_Send, "m_flMaxspeed");
                    g_Grabbed[g_Targetindex[client][Grab]] = true; // If target is a player, tell plugin player is being grabbed
                    SetEntPropFloat(g_Targetindex[client][Grab], Prop_Send, "m_flMaxspeed", 0.01); // Slow grab target
                }
             
                // Call grab forward
                new ret;
                Call_StartForward(FwdClientGrab);
                Call_PushCell(client);
                Call_Finish(ret);
                if(ret)
                {
                    Action_Drop(client);
                    return Plugin_Stop;
                }
             
                // Finish grabbing
                EmitSoundFromOrigin(g_cvarSound[Grab], targetloc); // Emit sound from the entity being grabbed
                CreateTimer(0.05, Grabbing, client, TIMER_REPEAT); // Start a repeating timer that will reposition the target in the grabber's crosshairs
                return Plugin_Stop; // Stop the search timer
            }
        }
        else
        {
            Action_Drop(client);
            return Plugin_Stop; // Stop the timer
        }
    }
    return Plugin_Continue;
}
опять появилась
C-подобный:
L 04/25/2017 - 17:11:55: [SM] Exception reported: Client 20 is not in game
L 04/25/2017 - 17:11:55: [SM] Blaming: hookgrabrope.smx
L 04/25/2017 - 17:11:55: [SM] Call stack trace:
L 04/25/2017 - 17:11:55: [SM]   [0] IsPlayerAlive
L 04/25/2017 - 17:11:55: [SM]   [1] Line 1688, hookgrabrope.sp::GrabSearch
L 04/25/2017 - 17:11:55: [SM] Exception reported: Client 20 is not in game
L 04/25/2017 - 17:11:55: [SM] Blaming: hookgrabrope.smx
L 04/25/2017 - 17:11:55: [SM] Call stack trace:
L 04/25/2017 - 17:11:55: [SM]   [0] IsPlayerAlive
L 04/25/2017 - 17:11:55: [SM]   [1] Line 1688, hookgrabrope.sp::GrabSearch
L 04/25/2017 - 17:11:55: [SM] Exception reported: Client 20 is not in game
L 04/25/2017 - 17:11:55: [SM] Blaming: hookgrabrope.smx
L 04/25/2017 - 17:11:55: [SM] Call stack trace:
L 04/25/2017 - 17:11:55: [SM]   [0] IsPlayerAlive
L 04/25/2017 - 17:11:55: [SM]   [1] Line 1688, hookgrabrope.sp::GrabSearch
L 04/25/2017 - 17:11:55: [SM] Exception reported: Client 20 is not in game
L 04/25/2017 - 17:11:55: [SM] Blaming: hookgrabrope.smx
L 04/25/2017 - 17:11:55: [SM] Call stack trace:
L 04/25/2017 - 17:11:55: [SM]   [0] IsPlayerAlive
L 04/25/2017 - 17:11:55: [SM]   [1] Line 1688, hookgrabrope.sp::GrabSearch
L 04/25/2017 - 17:11:55: [SM] Exception reported: Client 20 is not in game
L 04/25/2017 - 17:11:55: [SM] Blaming: hookgrabrope.smx
L 04/25/2017 - 17:11:55: [SM] Call stack trace:
L 04/25/2017 - 17:11:55: [SM]   [0] IsPlayerAlive
L 04/25/2017 - 17:11:55: [SM]   [1] Line 1688, hookgrabrope.sp::GrabSearch
--- Добавлено позже ---
@Someone, теперь такая ошибка
L 04/29/2017 - 12:25:55: [SM] Exception reported: Client 2 is not in game
L 04/29/2017 - 12:25:55: [SM] Blaming: hookgrabrope.smx
L 04/29/2017 - 12:25:55: [SM] Call stack trace:
L 04/29/2017 - 12:25:55: [SM] [0] IsPlayerAlive
L 04/29/2017 - 12:25:55: [SM] [1] Line 1689, hookgrabrope.sp::GrabSearch
L 04/29/2017 - 12:25:55: [SM] Exception reported: Client 2 is not in game
L 04/29/2017 - 12:25:55: [SM] Blaming: hookgrabrope.smx
L 04/29/2017 - 12:25:55: [SM] Call stack trace:
L 04/29/2017 - 12:25:55: [SM] [0] IsPlayerAlive
L 04/29/2017 - 12:25:55: [SM] [1] Line 1689, hookgrabrope.sp::GrabSearch
L 04/29/2017 - 12:25:55: [SM] Exception reported: Client 2 is not in game
L 04/29/2017 - 12:25:55: [SM] Blaming: hookgrabrope.smx
L 04/29/2017 - 12:25:55: [SM] Call stack trace:
L 04/29/2017 - 12:25:55: [SM] [0] IsPlayerAlive
L 04/29/2017 - 12:25:55: [SM] [1] Line 1689, hookgrabrope.sp::GrabSearch
L 04/29/2017 - 12:25:55: [SM] Exception reported: Client 2 is not in game
L 04/29/2017 - 12:25:55: [SM] Blaming: hookgrabrope.smx
L 04/29/2017 - 12:25:55: [SM] Call stack trace:
L 04/29/2017 - 12:25:55: [SM] [0] IsPlayerAlive
L 04/29/2017 - 12:25:55: [SM] [1] Line 1689, hookgrabrope.sp::GrabSearch
L 04/29/2017 - 12:25:55: [SM] Exception reported: Client 2 is not in game
L 04/29/2017 - 12:25:55: [SM] Blaming: hookgrabrope.smx
L 04/29/2017 - 12:25:55: [SM] Call stack trace:
L 04/29/2017 - 12:25:55: [SM] [0] IsPlayerAlive
L 04/29/2017 - 12:25:55: [SM] [1] Line 1689, hookgrabrope.sp::GrabSearch
 
Последнее редактирование:

Ded_maksim_116_rus

Участник
Сообщения
56
Реакции
12
Помогите плиз в логах такая херня

upload_2017-8-25_19-47-37.png



upload_2017-8-25_19-48-25.png
 

Grey83

не пишу плагины с весны 2022
Сообщения
8,560
Реакции
5,063
перед PrintCenterText() добавь if(IsClientInGame(client))
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу