Подскажите как исправить [ANY] Hook Grab Rope (1.1.4) - AlliedModders
Последнее редактирование модератором:
Подскажите как исправить [ANY] Hook Grab Rope (1.1.4) - AlliedModders
Я незнаю, у меня в логах 3метра длиной эта ошибка, как ее исправить?Я так понял, ошибка возникает, когда игрок начал использовать граб, а потом вышел с сервера ?
Я незнаю, у меня в логах 3метра длиной эта ошибка, как ее исправить?
Можешь написать, что нужно исправить? у меня версия hookgrabrope_1.1.5.zipДолжно работать.
Можешь написать, что нужно исправить? у меня версия hookgrabrope_1.1.5.zip
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;
}
опять появилась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; }
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
хм можно по подробе ?перед PrintCenterText() добавь if(IsClientInGame(client))
Вот так первую строчку сделай.хм можно по подробе ?
if(IsClientInGame(client)) PrintCenterText(Client, "%t", "Found");