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

[CS:S] Timer 1.0.7


Post New Thread Reply   
 
Thread Tools Display Modes
Lepraaah
Member
Join Date: May 2013
Location: Netherlands
Old 09-10-2013 , 12:20   Re: [CS:S] Timer 1.0.7
Reply With Quote #551

Quote:
Originally Posted by thetwistedpanda View Post
It does work actually; world record may not function properly (it varies, for some it does for some it doesnt), but everything else functions peachy.

yep, im using sql with 0.0 problems, nothing with my world record either.
__________________
Lepraaah is offline
Send a message via Skype™ to Lepraaah
vodka00
Veteran Member
Join Date: Jun 2012
Location: Los Angeles
Old 09-11-2013 , 01:34   Re: [CS:S] Timer 1.0.7
Reply With Quote #552

Quote:
Originally Posted by thetwistedpanda View Post
(it varies, for some it does for some it doesnt)
What would the cause for such variation?
__________________
cw main:

cw speedruns:
vodka00 is offline
moode
Member
Join Date: Nov 2012
Old 09-21-2013 , 13:46   Re: [CS:S] Timer 1.0.7
Reply With Quote #553

i want Timer for mg server !!
moode is offline
cREANy0
SourceMod Donor
Join Date: Jul 2012
Location: Germany
Old 09-21-2013 , 16:54   Re: [CS:S] Timer 1.0.7
Reply With Quote #554

Quote:
Originally Posted by moode View Post
i want Timer for mg server !!
just use this one?
__________________

Last edited by cREANy0; 09-21-2013 at 16:55.
cREANy0 is offline
moode
Member
Join Date: Nov 2012
Old 09-22-2013 , 04:37   Re: [CS:S] Timer 1.0.7
Reply With Quote #555

Quote:
Originally Posted by cREANy0 View Post
just use this one?
I have tried Edited but i cant hide timer Message When you have finished the map
Any idea ?
moode is offline
venomz
Junior Member
Join Date: May 2013
Old 09-22-2013 , 16:02   Re: [CS:S] Timer 1.0.7
Reply With Quote #556

There is a problemen with the timer i think. i run this plugin on a minigames server and i've ahd to remove two maps because off lagg/laggspikes appearing while playing on those maps. And those maps both had over 100 records. now the same problem has appeared on two other maps and they have 100-150 wr's to. Is this something you could look into alongub?
venomz is offline
venomz
Junior Member
Join Date: May 2013
Old 09-24-2013 , 13:58   Re: [CS:S] Timer 1.0.7
Reply With Quote #557

bump?
venomz is offline
Masog
Junior Member
Join Date: Sep 2013
Old 09-25-2013 , 08:07   Re: [CS:S] Timer 1.0.7
Reply With Quote #558

What about add a ranks in chat which is based on player's points? (And of course add points for finishing maps)
I mean like "[New]Nick" etc..
It would be nice.
Masog is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-25-2013 , 09:40   Re: [CS:S] Timer 1.0.7
Reply With Quote #559

I've found a lag fix for finishing maps/connecting to the server.

timer-core.sp
Modify FinishRound to use threaded SQL queries.
Code:
FinishRound(client, const String:map[], Float:time, jumps, flashbangs, physicsDifficulty, fpsmax)
{
    if(!IsClientInGame(client))
    {
        return;
    }
    
    if(!IsPlayerAlive(client))
    {
        return;
    }
    
    new Float:fLastTime;
    new iLastJumps, iLastFlashbangs;
    decl String:sTimeDiff[32], String:sBuffer[32];
    new bool:bOverwrite = false;
    
    Timer_GetBestRound(client, map, fLastTime, iLastJumps, iLastFlashbangs);
    
    if(fLastTime == 0.0)
    {
        g_bestTimeCache[client][Time] = time;
        bOverwrite = true;
    }
    
    fLastTime -= time;
    
    if(fLastTime < 0.0)
    {
        fLastTime *= -1.0;
        Timer_SecondsToTime(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "+%s", sBuffer);
    }
    
    else if(fLastTime > 0.0)
    {
        g_bestTimeCache[client][Time] = time;
        bOverwrite = true;
        Timer_SecondsToTime(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "-%s", sBuffer);
    }
    
    else if(fLastTime == 0.0)
    {
        Timer_SecondsToTime(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "%s", sBuffer);
    }
    
    decl String:sAuthID[MAX_AUTHID_LENGTH];
    GetClientAuthString(client, sAuthID, sizeof(sAuthID));

    decl String:sName[MAX_NAME_LENGTH];
    GetClientName(client, sName, sizeof(sName));
    
    decl String:sSafeName[2 * strlen(sName) + 1];
    SQL_LockDatabse(g_hSQL);
    SQL_EscapeString(g_hSQL, sName, sSafeName, 2 * strlen(sName) + 1);
    SQL_UnlockDatabse(g_hSQL);

    decl String:sQuery[256];
    FormatEx(sQuery, sizeof(sQuery), "INSERT INTO round (map, auth, time, jumps, physicsdifficulty, name, fpsmax, flashbangs) VALUES ('%s', '%s', %f, %d, %d, '%s', %d, %d);", map, sAuthID, time, jumps, physicsDifficulty, sSafeName, fpsmax, flashbangs);
    
    SQL_TQuery(g_hSQL, EmptyCallback, sQuery);
    
    g_bestTimeCache[client][IsCached] = false;
    
    GetTotalRank(g_sCurrentMap);
    GetCurrentRank(client, g_sCurrentMap);
    
    decl String:sTimeString[32];
    Timer_SecondsToTime(time, sTimeString, sizeof(sTimeString), true);

    Call_StartForward(g_hFinishRoundForward);
    Call_PushCell(client);
    Call_PushString(map);
    Call_PushCell(jumps);
    Call_PushCell(flashbangs);
    Call_PushCell(physicsDifficulty);
    Call_PushCell(fpsmax);
    Call_PushString(sTimeString);
    Call_PushString(sTimeDiff);
    Call_PushCell(Timer_GetCurrentRank(client, false));
    Call_PushCell(Timer_GetTotalRank(false));
    Call_PushCell(bOverwrite);
    Call_Finish();
}

public EmptyCallback(Handle:owner, Handle:hndl, const String:error[], any:client)
{
    if(hndl == INVALID_HANDLE)
    {
        LogError("SQL Error on FinishRound: %s", error);
        
        return;
    }
    
    CloseHandle(hndl);
}
timer-worldrecord.sp
Using an high database priority because the round table can be huge.
Code:
public OnClientAuthorized(client, const String:auth[])
{
    if(IsFakeClient(client) || IsClientSourceTV(client))
    {
        return;
    }
    
    decl String:sName[MAX_NAME_LENGTH];
    GetClientName(client, sName, MAX_NAME_LENGTH);

    decl String:sSafeName[2 * strlen(sName) + 1];
    
    SQL_LockDatabase(g_hSQL);
    SQL_EscapeString(g_hSQL, sName, sSafeName, 2 * strlen(sName) + 1);
    SQL_UnlockDatabase(g_hSQL);

    decl String:sQuery[256];
    FormatEx(sQuery, sizeof(sQuery), "UPDATE round SET name = '%s' WHERE auth = '%s';", sSafeName, auth);
    SQL_TQuery(g_hSQL, ChangeNameCallback, sQuery, 0, DBPrio_High);
}
Quote:
Originally Posted by Masog View Post
What about add a ranks in chat which is based on player's points? (And of course add points for finishing maps)
I mean like "[New]Nick" etc..
It would be nice.
This is already done by me and probably by some other coders, but all of them are private plugins.
You need to create your own or contact a coder that will do it for you, if you're creating your own and having problems contact me and I will help you.
__________________
retired
shavit is offline
cREANy0
SourceMod Donor
Join Date: Jul 2012
Location: Germany
Old 09-25-2013 , 09:48   Re: [CS:S] Timer 1.0.7
Reply With Quote #560

Quote:
Originally Posted by shavit View Post
I've found a lag fix for finishing maps/connecting to the server.

timer-core.sp
Modify FinishRound to use threaded SQL queries.
Code:
FinishRound(client, const String:map[], Float:time, jumps, flashbangs, physicsDifficulty, fpsmax)
{
    if(!IsClientInGame(client))
    {
        return;
    }
    
    if(!IsPlayerAlive(client))
    {
        return;
    }
    
    new Float:fLastTime;
    new iLastJumps, iLastFlashbangs;
    decl String:sTimeDiff[32], String:sBuffer[32];
    new bool:bOverwrite = false;
    
    Timer_GetBestRound(client, map, fLastTime, iLastJumps, iLastFlashbangs);
    
    if(fLastTime == 0.0)
    {
        g_bestTimeCache[client][Time] = time;
        bOverwrite = true;
    }
    
    fLastTime -= time;
    
    if(fLastTime < 0.0)
    {
        fLastTime *= -1.0;
        Timer_SecondsToTime(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "+%s", sBuffer);
    }
    
    else if(fLastTime > 0.0)
    {
        g_bestTimeCache[client][Time] = time;
        bOverwrite = true;
        Timer_SecondsToTime(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "-%s", sBuffer);
    }
    
    else if(fLastTime == 0.0)
    {
        Timer_SecondsToTime(fLastTime, sBuffer, sizeof(sBuffer), true);
        FormatEx(sTimeDiff, sizeof(sTimeDiff), "%s", sBuffer);
    }
    
    decl String:sAuthID[MAX_AUTHID_LENGTH];
    GetClientAuthString(client, sAuthID, sizeof(sAuthID));

    decl String:sName[MAX_NAME_LENGTH];
    GetClientName(client, sName, sizeof(sName));
    
    decl String:sSafeName[2 * strlen(sName) + 1];
    SQL_LockDatabse(g_hSQL);
    SQL_EscapeString(g_hSQL, sName, sSafeName, 2 * strlen(sName) + 1);
    SQL_UnlockDatabse(g_hSQL);

    decl String:sQuery[256];
    FormatEx(sQuery, sizeof(sQuery), "INSERT INTO round (map, auth, time, jumps, physicsdifficulty, name, fpsmax, flashbangs) VALUES ('%s', '%s', %f, %d, %d, '%s', %d, %d);", map, sAuthID, time, jumps, physicsDifficulty, sSafeName, fpsmax, flashbangs);
    
    SQL_TQuery(g_hSQL, EmptyCallback, sQuery);
    
    g_bestTimeCache[client][IsCached] = false;
    
    GetTotalRank(g_sCurrentMap);
    GetCurrentRank(client, g_sCurrentMap);
    
    decl String:sTimeString[32];
    Timer_SecondsToTime(time, sTimeString, sizeof(sTimeString), true);

    Call_StartForward(g_hFinishRoundForward);
    Call_PushCell(client);
    Call_PushString(map);
    Call_PushCell(jumps);
    Call_PushCell(flashbangs);
    Call_PushCell(physicsDifficulty);
    Call_PushCell(fpsmax);
    Call_PushString(sTimeString);
    Call_PushString(sTimeDiff);
    Call_PushCell(Timer_GetCurrentRank(client, false));
    Call_PushCell(Timer_GetTotalRank(false));
    Call_PushCell(bOverwrite);
    Call_Finish();
}

public EmptyCallback(Handle:owner, Handle:hndl, const String:error[], any:client)
{
    if(hndl == INVALID_HANDLE)
    {
        LogError("SQL Error on FinishRound: %s", error);
        
        return;
    }
    
    CloseHandle(hndl);
}
timer-worldrecord.sp
Using an high database priority because the round table can be huge.
Code:
public OnClientAuthorized(client, const String:auth[])
{
    if(IsFakeClient(client) || IsClientSourceTV(client))
    {
        return;
    }
    
    decl String:sName[MAX_NAME_LENGTH];
    GetClientName(client, sName, MAX_NAME_LENGTH);

    decl String:sSafeName[2 * strlen(sName) + 1];
    
    SQL_LockDatabase(g_hSQL);
    SQL_EscapeString(g_hSQL, sName, sSafeName, 2 * strlen(sName) + 1);
    SQL_UnlockDatabase(g_hSQL);

    decl String:sQuery[256];
    FormatEx(sQuery, sizeof(sQuery), "UPDATE round SET name = '%s' WHERE auth = '%s';", sSafeName, auth);
    SQL_TQuery(g_hSQL, ChangeNameCallback, sQuery, 0, DBPrio_High);
}
This is already done by me and probably by some other coders, but all of them are private plugins.
You need to create your own or contact a coder that will do it for you, if you're creating your own and having problems contact me and I will help you.
This works really?
I will test it.


greetz cREANy0
__________________
cREANy0 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 18:00.


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