View Single Post
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 11-16-2020 , 09:55   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #5

Quote:
Originally Posted by Marttt View Post
maybe is possible by hooking OnTouch in the rescue vehicle,
I maybe do something wrong,
does not work, I have tried it
PHP Code:
{
    
int entity FindEntityByClassname(-1"trigger_multiple");
    if(
entity == -1)
    {
        return;
    }

    
SDKHook(entitySDKHook_StartTouchOnStartTouch);
    
SDKHook(entitySDKHook_EndTouchOnEndTouch);
}

public 
void OnStartTouch(int entityint other)
{
    
PrintToChatAll("OnStartTouch: %d, other: %d"entityother); //didn't happen
    
    
if (bFinalVehicleReady && other && other <= MaxClients && IsClientInGame(other))
    {
        
g_bClientInVehicle[other] = true;
    }
}

public 
void OnEndTouch(int entityint other)
{
    
PrintToChatAll("OnEndTouch: %d, other: %d"entityother); //didn't happen
    
    
if (bFinalVehicleReady && other && other <= MaxClients && IsClientInGame(other))
    {
        
g_bClientInVehicle[other] = false;
    }

Spoiler
__________________

Last edited by HarryPotter; 11-16-2020 at 21:19.
HarryPotter is offline