Raised This Month: $51 Target: $400
 12% 

[TF2] Ghost Mode Redux (v2.2 - 1/6/14)


Post New Thread Reply   
 
Thread Tools Display Modes
Nanochip
Senior Member
Join Date: Jan 2014
Old 01-31-2015 , 01:33   Re: [TF2] Ghost Mode Redux (v2.2 - 1/6/14)
Reply With Quote #101

Could you give me an example? I'm a completely new to client prefs..
Nanochip is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-31-2015 , 01:44   Re: [TF2] Ghost Mode Redux (v2.2 - 1/6/14)
Reply With Quote #102

It's okay, I'm a completely nue too.

Oh, another reason that code doesn't work sometimes might be because it passes client to a timer, instead of a userID.

PHP Code:
public OnClientCookiesCached(iClient// This can occur before or after the OnClient ... Join/PutIn/PostAdmin() forwards.
{
    
LoadClientCookies(iClient);
}

public 
OnClientPostAdminCheck(iClient)
{
    
g_bIsGhost[iClient] = false;
    
g_bBecomingGhost[iClient] = false;
    
g_bGhost[iClient] = true;
    
g_bThirdPerson[iClient] = true;

    if (!
IsFakeClient(iClient) && AreClientCookiesCached(iClient)) // If PostAdminCheck fired /after/ cookies were cached, reload them.
    
{
        
OnClientCookiesCached(iClient); // You could use loadcookies here, but normally I would put whatever is in 'LoadCookies()' directly here and call it like this.
    
}

    
//if (!IsClientInGame(iClient)) // Is that possible?
    //    return;
            
    
SDKHook(iClientSDKHook_SetTransmitSetTransmit);
    
SDKHook(iClientSDKHook_PreThinkPreThink);
}

// public OnClientPutInServer(iClient)
// {
// 
// }

// public Action:Timer_LoadCookies(Handle:hTimer, any:iClient)
// {
//     if(!IsValidClient(iClient) || !AreClientCookiesCached(iClient))
//         return Plugin_Continue;
// 
//     LoadClientCookies(iClient);
//     return Plugin_Stop;
// } 
If you wanna try only fixing the timer,


PHP Code:
    CreateTimer(10.0LoadCookiesGetClientUserId(iClient));
        
//Ignore if it wasn't a valid client (rare).
        
if(!IsClientInGame(iClient))
                return;
            

    
SDKHook(iClientSDKHook_SetTransmitSetTransmit);
    
SDKHook(iClientSDKHook_PreThinkPreThink);
}

public 
Action:Timer_LoadCookies(Handle:hTimerany:UserId)
{
    new 
iClient GetClientOfUserId(UserId);
    if(!
iClient || !IsClientInGame(iClient) || !AreClientCookiesCached(iClient))
        return 
Plugin_Continue;

    
LoadClientCookies(iClient);
    return 
Plugin_Continue;

But if cookies happen to get cached a whole 10 seconds later (if your cookie database is external maybe that could happen?) then they won't be loaded, which is why OnClientCookiesCached is probably better.
__________________

Last edited by Chdata; 01-31-2015 at 01:49.
Chdata is offline
MaloModo
Veteran Member
Join Date: Aug 2008
Old 02-15-2015 , 13:14   Re: [TF2] Ghost Mode Redux (v2.2 - 1/6/14)
Reply With Quote #103

Thanks for the plugin. Just one request. It doesn't seem to save a clients preferences between maps? If I am mistaken I apologize in advance.
MaloModo is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 12-31-2015 , 15:23   Re: [TF2] Ghost Mode Redux (v2.2 - 1/6/14)
Reply With Quote #104

Maybe this version will work with cookies.
Attached Files
File Type: sp Get Plugin or Get Source (ghostmode.sp - 556 views - 21.2 KB)
File Type: smx ghostmode.smx (16.6 KB, 260 views)
Naydef is offline
BustedRider
Senior Member
Join Date: Dec 2008
Location: Canada/QC
Old 01-08-2016 , 20:59   Re: [TF2] Ghost Mode Redux (v2.2 - 1/6/14)
Reply With Quote #105

i want this for cs go
__________________
BustedRider is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode