Raised This Month: $ Target: $400
 0% 

[HELP] Played Time Extended v0.1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 08-09-2013 , 14:05   [HELP] Played Time Extended v0.1
Reply With Quote #1

Hello every one
I have an error with this played time plugin, not me also my friends got the same error ..
http://forums.alliedmods.net/showthread.php?t=201869
The player played time always restart to zero dont know why :/
---
My server is a steam server by steamCMD

Quote:
] version
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 17:46:18 Apr 25 2013 (6027)
---
Her is Played time extended.sma

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault_util>
#include <ColorChat>

new const VERSION[] = "0.1"

enum
{
    
SQL 1,
    
VAULT
}


#define SAVETYPE 2

#if SAVETYPE == SQL
    #include <sqlx>
    
new Handle:g_hSql
    
new gsz_Query[256]
        
    
enum
    
{
        
HOST,
        
USER,
        
PASS,
        
DB
    
}
#else
    #include <nvault_util>
    
new const SPECIAL_CHAR[2] = "-"
    
new gVault
#endif

/* ************ EDIT STARTS HERE ************ */
#define MAX_TIME_LENGTH        25

#if SAVETYPE == SQL
// IF using sql, edit these..
new const gsz_SQLINFO[][] = {
    { 
"127.0.0.1" },        // HOST
    
"root" },        // USER
    
"" },    // User's password
    
"amxx" }        // Database Name
}
#endif

new gsz_MyTimeStrings[][] = {
    
"/mytime",
    
"mytime",
    
"my_time",
    
"/mytime",
    
"my_total_time",
    
"mytotaltime"
}

#define COLORED_MESSAGES
/* ************ EDIT ENDS HERE ************** */

#if defined COLORED_MESSAGES
    #include <colorchat>
#endif

new g_iPlayedTime[33], g_iDonateTo[33]
new 
g_pDonateg_pConnectMessages

public plugin_init()
{
    
register_plugin("Played Time: Extended"VERSION"Khalid :)")
    
    
register_clcmd("say /donate""Cmd_Donate")
    
register_concmd("Type""DonateAmount")
    
    
g_pDonate register_cvar("pte_allow_donate""1")
    
g_pConnectMessages register_cvar("pte_show_connect_messages""1")
    
    new 
szCommand[40]
    for(new 
isizeof(gsz_MyTimeStrings); i++)
    {
        
formatex(szCommandcharsmax(szCommand), "say %s"gsz_MyTimeStrings[i])
        
register_clcmd(szCommand"ShowUserTime")
        
formatex(szCommandcharsmax(szCommand), "say_team %s"gsz_MyTimeStrings[i])
        
register_clcmd(szCommand"ShowUserTime")
    }

    
register_clcmd("say""HookSaid")
    
register_clcmd("say_team""HookSaid")
    
    
register_concmd("amx_show_player_time""show_players_times"ADMIN_KICK)

    
#if SAVETYPE == SQL
    
CheckSqlConnection()
    
#else
    
gVault nvault_open("played_time")
    
#endif
}

public 
plugin_natives()
{
    
register_library("played_time")
    
    
register_native("get_user_played_time""native_get_user_played_time"1)
    
register_native("set_user_played_time""native_set_user_played_time"1)
    
register_native("pt_get_save_type""native_get_save_type"1)
}

public 
show_players_times(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    
new szName[32], iPlayer
    
if(read_argc() == 1)
    {
        
console_print(id"Showing players times of all connected players")
        new 
iPlayers[32], iNumiPlayerszName[32]
        
get_players(iPlayersiNum"h")
    
        for(new 
iiNumi++)
        {
            
iPlayer iPlayers[i]
            
get_user_name(iPlayerszName31)
        
            
console_print(id"%d. %s %22.22d"1szName, (g_iPlayedTime[iPlayer] + get_user_time(iPlayer)) / 60)
        }
    }
    
    else
    {
        new 
szArg[32]
        
read_argv(1szArgcharsmax(szArg))
        
        if(
szArg[0] == '@')
        {
            new 
iPlayers[32], iNum
            
if( equali(szArg"@TERRORIST") || equali(szArg"@T") || equal(szArg"@TERR") )
            {
                
console_print(id"Showing players times for team Terrorist")
                
get_players(iPlayersiNum"eh""TERRORIST")
            }
                
            else if( 
equali(szArg"@COUNTERTERRORIST") || equali(szArg"@CT") || equali(szArg"@COUNTER") )
            {
                
console_print(id"Showing players times for team Counter-Terrorist")
                
get_players(iPlayersiNum"eh""CT")
            }
                
            else    return 
console_print(id"That's not a correct team")
            
            for(new 
iiNumi++)
            {
                
iPlayer iPlayers[i]
                
get_user_name(iPlayerszName31)
                
console_print(id"%d. %s %22.22d"1szName, (g_iPlayedTime[iPlayer] + get_user_time(iPlayer)) / 60)
            }
        }
        
        else
        {
            
iPlayer cmd_target(idszArgCMDTARGET_OBEY_IMMUNITY)
            if(!
iPlayer)
            {
                
console_print(id"Player could not be targetted.")
                return 
PLUGIN_HANDLED
            
}
            
            
get_user_name(iPlayerszNamecharsmax(szName))
            
console_print(id"%s total played time is %d"szNameg_iPlayedTime[iPlayer])
        }
    }
    
    return 
PLUGIN_HANDLED
}
        
public 
ShowUserTime(id)
{
    new 
iTime get_user_time(id)
    new 
iTotalTime = (g_iPlayedTime[id] + iTime) / 60
    
    iTime 
/= 60
    
    
#if defined COLORED_MESSAGES
    
ColorChat(idGREEN"[$haJah|GaMreZ] You have been playing for ^3%d ^4minute%s"iTimeiTime "" "s")
    
ColorChat(idGREEN"[$haJah|GaMreZ] Your total played time is ^3%d ^4minute%s"iTotalTimeiTime == "" "s")
    
#else
    
client_print(idprint_chat"[$haJah|GaMreZ] You have been playing for %d minute%s"iTimeiTime == "" "s")
    
client_print(idprint_chat"[$haJah|GaMreZ] Your total played time is %d minute%s"iTotalTimeiTime == "" "s")
    
#endif    
    
return PLUGIN_HANDLED
}

public 
client_infochanged(id)
{
    new 
szOldName[34], szNewName[32]
    
get_user_name(idszOldNamecharsmax(szOldName))
    
get_user_info(id"name"szNewNamecharsmax(szNewName))
    
    if(!
equal(szOldNameszNewName))
    {
        
#if SAVETYPE == SQL
        
replace_all(szNewNamecharsmax(szNewName), "'""")
        
replace_all(szNewNamecharsmax(szNewName), "^"", "")
        
        formatex(gsz_Query, charsmax(gsz_Query), "
UPDATE `played_timeSET name '%s' WHERE name '%s'", szNewName, szOldName)
        SQL_ThreadQuery(g_hSql, "
Query_Handler", gsz_Query)
        #else
        new szAuthId[33]; get_user_authid(id, szAuthId, 32)
        formatex(szOldName, charsmax(szOldName), "
%s%s", szAuthId, SPECIAL_CHAR)
        nvault_remove(gVault, szAuthId)
        nvault_set(gVault, szOldName, szNewName)
        #endif
    }
}

public client_putinserver(id)
{
    if( is_user_hltv(id)  || is_user_bot(id) )
        return;

    g_iPlayedTime[id] = get_user_totaltime(id)
    
    if(get_pcvar_num(g_pConnectMessages))
    {
        new szName[32]; get_user_name(id, szName, charsmax(szName))
        new iTime = g_iPlayedTime[id] / 60
        
        #if defined COLORED_MESSAGES
        ColorChat(0, GREEN, "
[$haJah|GaMreZPlayer ^3%^4Connected with a total time of ^3%^4minute%s", szName, iTime, iTime == 1 ? "" : "s")
        #else
        client_print(0, print_chat, "
[$haJah|GaMreZPlayer %s Connected with a total time of %d minute%s", szName, iTime, iTime == 1 ? "" : "s")
        #endif
    }
}

public client_disconnect(id)
{
    // CZ bots steam id is the same (BOT)
    // Prevent them from saving time
    if( is_user_hltv(id)  || is_user_bot(id) )
        return;
    
    Save(id)
}

Save(id)
{
    new szAuthId[35]; get_user_authid(id, szAuthId, charsmax(szAuthId))
    #if SAVETYPE == SQL
        formatex(gsz_Query, charsmax(gsz_Query), "
UPDATE `played_timeSET time = %d WHERE steamid '%s'", g_iPlayedTime[id] + get_user_time(id), szAuthId)
        SQL_ThreadQuery(g_hSql, "
Query_Handler", gsz_Query)
    #else
        new szTime[MAX_TIME_LENGTH]; num_to_str(g_iPlayedTime[id] + get_user_time(id), szTime, charsmax(szTime))
        nvault_remove(gVault, szAuthId)
        nvault_set(gVault, szAuthId, szTime)
    #endif
    
    g_iPlayedTime[id] = 0
}

public Cmd_Donate(id)
{
    if(!get_pcvar_num(g_pDonate))
    {
        #if defined COLORED_MESSAGES
        ColorChat(id, GREEN, "
[PTEDonating is disabled at the moment.")
        #else
        client_print(id, print_chat, "
[PTEDonating is disabled at the moment.")
        #endif
        return PLUGIN_HANDLED
    }
    
    new iPlayers[32], iNum, iPlayer
    get_players(iPlayers, iNum, "
h")
    
    new szTitle[70]
    formatex(szTitle, charsmax(szTitle), "
\rDonate Menu^n\yYour total time is: \w%\yminute%s^n\rBy Khalid :)^n", g_iPlayedTime[id], g_iPlayedTime[id] == 1 ? "" : "s" )
    new iMenu = menu_create(szTitle, "
DonateMenuHandler")
    new szName[32], szInfo[4]
    
    for(new i; i < iNum; i++)
    {
        iPlayer = iPlayers[i]
        
        if(iPlayer != id)
        {
            get_user_name(iPlayer, szName, charsmax(szName))
            num_to_str(iPlayer, szInfo, 3)
            menu_additem(iMenu, szName, szInfo)
        }
    }
    
    menu_display(id, iMenu)
    return PLUGIN_HANDLED
}

public DonateMenuHandler(id, menu, item)
{
    if(!get_pcvar_num(g_pDonate))
    {
        #if defined COLORED_MESSAGES
        ColorChat(id, GREEN, "
[$haJah|GaMreZDonating is disabled at the moment.")
        #else
        client_print(id, print_chat, "
[$haJah|GaMreZDonating is disabled at the moment.")
        #endif
        return;
    }
    
    if(item < 0)
        return;
    
    new id2, callback, iAccess, szInfo[4]
    menu_item_getinfo(menu, item,iAccess, szInfo, 3, .callback = callback)
    
    id2 = str_to_num(szInfo)
    menu_destroy(menu)
    
    if(!is_user_connected(id2))
    {
        #if defined COLORED_MESSAGES
        ColorChat(id, GREEN, "
[$haJah|GaMreZYou can't donate to a disconnected player..")
        #else
        client_print(id, print_chat, "[$haJah|GaMreZ] You can'
t donate to a disconnected player..")
        #endif
        return;
    }
    
    g_iDonateTo[id] = id2
    new szName[32]; get_user_name(id2, szName, 31)
    
    client_cmd(id, "
messagemode ^"Type the amount that you want to donate^"")
    #if defined COLORED_MESSAGES
    ColorChat(id, GREEN, "
*** Type the amount that you want to donate to ^3%s", szName)
    #else
    client_print(id, print_chat, "
*** Type the amount that you want to donate to %s", szName)
    #endif
}

public DonateAmount(id)
{
    if(!get_pcvar_num(g_pDonate))
    {
        #if defined COLORED_MESSAGES
        ColorChat(id, GREEN, "
[$haJah|GaMreZDonating is disabled at the moment.")
        #else
        client_print(id, print_chat, "
[$haJah|GaMreZDonating is disabled at the moment.")
        #endif
        return PLUGIN_HANDLED
    }

    
    new id2 = g_iDonateTo[id]
    if(!id2 || !is_user_connected(id2))
        return PLUGIN_HANDLED
    
    new szAmount[50], iAmount
    read_argv(read_argc() - 1, szAmount, charsmax(szAmount))
    
    //replace(szAmount, charsmax(szAmount), "
the", "")
    new iTime = g_iPlayedTime[id]
    
    if( is_str_num(szAmount) )
    {
        iAmount = (str_to_num(szAmount) * 60)
        if(iAmount < 0)
        {
            client_print(id, print_center, "
You can't donate that")
            return PLUGIN_HANDLED
        }
        
        if(iAmount > iTime)
            iAmount = iTime
    }
    
    else if(szAmount[0] == '
*' && szAmount[1] == EOS)
        iAmount = iTime
        
    else
    {
        client_print(id, print_center, "You can'
t donate that")
        return PLUGIN_HANDLED
    }
    
    if( g_iPlayedTime[id] - iAmount < 0 )
        iAmount -= g_iPlayedTime[id]
    
    g_iPlayedTime[id] -= iAmount
    g_iPlayedTime[id2] += iAmount
    
    new szName[32], szName2[32]
    get_user_name(id, szName, 31); get_user_name(id2, szName2, 31)
    
    #if defined COLORED_MESSAGES
    ColorChat(0, GREEN, "
[$haJah|GaMreZPlayer ^3%^4donated to ^3%^1%^4minutes", szName, szName2, iAmount / 60)
    #else
    client_print(0, print_chat, "
[$haJah|GaMreZPlayed %s donated to %%d minutes", szName, szName2, iAmount / 60)
    #endif
    
    return PLUGIN_HANDLED
}

public HookSaid(id)
{
    new szSaid[25]
    read_argv(1, szSaid, charsmax(szSaid))
    
    if( containi(szSaid, "
/top") != -1 && containi(szSaid, "_time") != -1 )
    {
        replace(szSaid, charsmax(szSaid), "
/top", ""); replace(szSaid, charsmax(szSaid), "_time", "")
        
        if(!is_str_num(szSaid))        // If it has more other words than /top*_time
            return PLUGIN_CONTINUE    // stop plugin and continue to show the words
            
        new iNum = str_to_num(szSaid)
        Top(id, iNum)
    }
    
    return PLUGIN_CONTINUE
}

#if SAVETYPE == SQL
CheckSqlConnection()
{
    g_hSql = SQL_MakeDbTuple(gsz_SQLINFO[HOST], gsz_SQLINFO[USER], gsz_SQLINFO[PASS], gsz_SQLINFO[DB])
    SQL_ThreadQuery(g_hSql, "
Query_Handler", "CREATE TABLE IF NOT EXISTS `played_time` (steamid VARCHAR(33), name VARCHAR(32), time INT)")
}
#endif

Top(id, NUM)
{
    if(NUM < 0)
        NUM *= -1
    
    new iSize
    #if SAVETYPE == SQL
    new iErrorCode, szError[50]
    new Handle:iConnection = SQL_Connect(g_hSql, iErrorCode, szError, charsmax(szError))
    new Handle:iQuery = SQL_PrepareQuery(iConnection, "
SELECT COUNT(*) FROM `played_time`")
    
    if(!SQL_Execute(iQuery))
        log_amx(szError)
    
    if(!SQL_MoreResults(iQuery))
    {
        #if defined COLORED_MESSAGES
        ColorChat(id, GREEN, "
[$haJah|GaMreZNo etnries yet")
        #else
        client_print(id, print_chat, "
[$haJah|GaMreZNo entries yet")
        #endif
        return;
    }
    
    iSize = SQL_ReadResult(iQuery, 0)
    
    SQL_FreeHandle(iConnection); SQL_FreeHandle(iQuery)
    #else
    new Vault2 = nvault_util_open("
played_time")
    iSize = nvault_util_count(Vault2)
    
    if(!iSize)
    {
        #if defined COLORED_MESSAGES
        ColorChat(id, GREEN, "
[$haJah|GaMreZNo etnries yet")
        #else
        client_print(id, print_chat, "
[$haJah|GaMreZNo entries yet")
        #endif
        nvault_util_close(Vault2)
        return;
    }
    
    nvault_util_close(Vault2)
    
    #endif
    
    if( NUM > iSize )
        NUM = iSize
    
    #if SAVETYPE == SQL
    new data[3]
    data[0] = id
    data[1] = NUM
    formatex(gsz_Query, charsmax(gsz_Query), "
SELECT FROM played_time ORDER BY time DESC LIMIT %d", NUM)
    SQL_ThreadQuery(g_hSql, "
FormatTop", gsz_Query, data, 1)
    #else
    FormatTop(id, NUM, iSize)
    #endif
}

#if SAVETYPE == SQL
public FormatTop(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
{
    if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED)
    {
        log_amx("
[SQL ERRORError on query: %s", Error)
        return;
    }
    
    new szMotd[1024], iLen, szName[32], iPlace, iTime
    iLen = formatex(szMotd, charsmax(szMotd), "
<body bgcolor=#000000><font color=#FFB00><pre>")
    
iLen += format(szMotd[iLen], charsmax(szMotd) - iLen,"%s %-22.22s %3s^n""#""Name""Time in minutes")
    
    while(
SQL_MoreResults(Query))
    {
        
SQL_ReadResult(Query1szNamecharsmax(szName))
        
iTime SQL_ReadResult(Query2)

        
replace_all(szNamecharsmax(szName), "<""&lt;")
        
replace_all(szNamecharsmax(szName), ">""&gt;")

        
iLen += formatex(szMotd[iLen], charsmax(szMotd) - iLen"%d %-22.22s %d^n", ++iPlaceszNameiTime 60)
        
SQL_NextRow(Query)
    }
    
    
iLen += formatex(szMotd[iLen], charsmax(szMotd) - iLen"</pre></font></body>")
    
    new 
szTitle[25]
    
formatex(szTitlecharsmax(szTitle), "Time Top%d"Data[1])
    
show_motd(Data[0], szMotdszTitle)
}
#else
public FormatTop(idiNum, const iSize)    // TOP Motd.... TY Exolent!
{    
    
enum _:VaultData
    
{
        
VD_Key[33],
        
VD_Value,
        
VD_szName[33]
    };
    
    new 
Vault2 nvault_util_open("played_time")
    
// create our array to hold entries and keep track of its size
    
new Array:entries ArrayCreate(VaultData);
    new 
sizeEntries
    
    
// count entries in vault and prepare variables
    
new data[VaultData], value[MAX_TIME_LENGTH], data2[VaultData]
    
// iterate through all entries
    
for(new 0postimestampiSizei++)
    {
        
// grab entry data from current position
        
pos nvault_util_read(Vault2posdata[VD_Key], charsmax(data[VD_Key]), valuecharsmax(value), timestamp);
        
        
/*for(new i; i < sizeof(data[VD_Key]); i++)
            if(!data[VD_Key][i])
                data[VD_Key][i] = EOS*/
    
        
if(contain(data[VD_Key], "-") != -1)
            continue;
        
        else
        {
            
formatex(data[VD_szName], charsmax(data[VD_szName]), "%s%s"data[VD_Key], SPECIAL_CHAR)
            
nvault_get(gVaultdata[VD_szName], data[VD_szName], charsmax(data[VD_szName]))
        }

        
// turn value string into integer
        
data[VD_Value] = str_to_num(value);
        
        
// if this is the first entry
        
if(sizeEntries == 0)
        {
            
// go ahead and add it
            
ArrayPushArray(entriesdata);
            
sizeEntries++;
            continue;
        }
        
        else
        {
            
// loop through other entries to see where this one should be placed (sorted from HIGH->LOW)
            
for(timestamp 0timestamp <= sizeEntriestimestamp++)
            {
                
// if we looped through all entries without finding a place
                
if(timestamp == sizeEntries)
                {
                    
// this entry value is too low to fit before any others
                    // if we have room at the end of the array
                    
if(sizeEntries iNum)
                    {
                        
// add it to the end
                        
ArrayPushArray(entriesdata);
                        
sizeEntries++;
                    }
                    
                    
// don't continue with code below
                    
break;
                }

                
                
// grab current entry to compare it with
                
ArrayGetArray(entriestimestampdata2);
                
                
// if this new entry should be placed before the compared entry
                
if(data[VD_Value] >= data2[VD_Value])
                {
                    
// insert before
                    
ArrayInsertArrayBefore(entriestimestampdata);
                    
                    
// if we aren't maxxed out
                    
if(sizeEntries iNum)
                    {
                        
// increase entry size
                        
sizeEntries++;
                    } 
                    else 
                    {
                        
// delete the last entry to keep the size at maximum
                        
ArrayDeleteItem(entriessizeEntries);
                    }
                    
                    break;
                }
            }
        }
    }
    
    new 
szMotd[1024], iLenlen charsmax(szMotd)
    
iLen formatex(szMotdlen"<body bgcolor=#000000><font color=#FFB00><pre>")
    
iLen += formatex(szMotd[iLen], len iLen"%s. %-22.22s %s^n""#""Name""Time in minutes")
    
    new 
i
    
for(0sizeEntriesi++)
    {
        
// grab current entry
        
ArrayGetArray(entriesidata);
        
        
// truncate entry key for output
        
data[VD_Key][32] = 0;
        
data[VD_szName][32] = 0
        
        replace_all
(data[VD_szName], charsmax(data[VD_szName]), "<""&lt;")
        
replace_all(data[VD_szName], charsmax(data[VD_szName]), ">""&gt;")
        
        
// display data
        
iLen += formatex(szMotd[iLen], len iLen"%d. %-22.22s %d^n", (i+1), data[VD_szName], data[VD_Value] / 60)
    }
    
    
// destroy the entry array from cache
    
ArrayDestroy(entries);
    
nvault_util_close(Vault2)
    
    
iLen += formatex(szMotd[iLen], len iLen"</pre></font></body>")
    new 
szTitle[50]; formatex(szTitlecharsmax(szTitle), "Time Top%d"i)
    
show_motd(idszMotdszTitle)
    
}
#endif

get_user_totaltime(id)
{
    new 
iNumszSavedName[32]
    new 
szName[32]; get_user_name(idszName31)
    new 
szAuthId[33]; get_user_authid(idszAuthIdcharsmax(szAuthId))
    
#if SAVETYPE == SQL
    
new iErrorCodeszError[50]
    new 
Handle:hConnection SQL_Connect(g_hSqliErrorCodeszErrorcharsmax(szError))
    new 
Handle:hQuery SQL_PrepareQuery(hConnection"SELECT * FROM `played_time` WHERE steamid='%s'"szAuthId)
    
    
SQL_Execute(hQuery)

    if(!
SQL_MoreResults(hQuery))
    {
        
formatex(gsz_Querycharsmax(gsz_Query), "INSERT INTO `played_time` VALUES ('%s', '%s', %d)"szAuthIdszName0)
        
SQL_ThreadQuery(g_hSql"Query_Handler"gsz_Query)
        
        
SQL_FreeHandle(hConnection); SQL_FreeHandle(hQuery)
        return 
iNum
    
}
    
    
SQL_ReadResult(hQuery2szSavedName31)
    
replace_all(szSavedNamecharsmax(szSavedName), "'""")
    
replace_all(szSavedNamecharsmax(szSavedName), "^"", "")
    
    if(!equal(szName, szSavedName))
        SQL_ThreadQuery(g_hSql, "
Query_Handler", "UPDATE `played_timeSET name '%s' WHERE name '%s'")
    
    iNum = SQL_ReadResult(hQuery, 2)
    SQL_FreeHandle(hConnection); SQL_FreeHandle(hQuery)
    
    #else
    if( !( iNum =  nvault_get(gVault, szAuthId) ) )
    {
        nvault_set(gVault, szAuthId, "
0")
        format(szAuthId, charsmax(szAuthId), "
%s%s", szAuthId, SPECIAL_CHAR)
        nvault_set(gVault, szAuthId, szName)
        return 0
    }
    
    format(szAuthId, charsmax(szAuthId), "
%s%s", szAuthId, SPECIAL_CHAR)
    nvault_get(gVault, szAuthId, szSavedName)
    if(!equal(szName, szSavedName))
    {
        nvault_remove(gVault, szAuthId)
        nvault_set(gVault, szAuthId, szName)
    }
    #endif
    
    return iNum
}

#if SAVETYPE == SQL
public Query_Handler(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
{
    if(FailState < 0)
        return log_amx("
%s", FailState == TQUERY_CONNECT_FAILED ? "Could not connect to SQL database." : "Query failed")
   
    if(Errcode)
        return log_amx("
Error on query: %s",Error)
    
    return -1    // Any number so we can get off the warning ...
}
#endif

// NATIVES
public native_get_user_played_time(const id)
{
    if(!is_user_connected(id) || is_user_hltv(id) || !id)
        return -1

    return g_iPlayedTime[id]
}
    
public native_set_user_played_time(const id, iNewTime)
{
    if(!is_user_connected(id) || is_user_hltv(id) || !id)
        return 1
    
    g_iPlayedTime[id] = iNewTime
    return 1
}

public native_get_save_type()
    return SAVETYPE

public plugin_end()
{
    #if SAVETYPE == SQL
    SQL_FreeHandle(g_hSql)
    #else
    nvault_close(gVault)
    #endif

---
Help Me Please ..
Thanks

Last edited by 5aloOod; 08-09-2013 at 14:08.
5aloOod is offline
sami_spt
Veteran Member
Join Date: Sep 2012
Location: I<3 pussy cats
Old 08-09-2013 , 14:31   Re: [HELP] Played Time Extended v0.1
Reply With Quote #2

report the bug in the plugin's thread.

Also,
Quote:
Originally Posted by pokemonmaster View Post
A new update with bug fixes, save by nickname feature will be released after i finish exams, just stand by
sami_spt is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 08-09-2013 , 16:41   Re: [HELP] Played Time Extended v0.1
Reply With Quote #3

oh ok, hope to his update come fast ..
5aloOod is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-10-2013 , 07:42   Re: [HELP] Played Time Extended v0.1
Reply With Quote #4

Yeah no steam has no support and u and ur frnd have steam id lan cuz i tried and i know ur non steamer however latest version of hld doesnt mean u cant be non steamer a well..
JoooN is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 08-10-2013 , 08:27   Re: [HELP] Played Time Extended v0.1
Reply With Quote #5

.......

Last edited by 5aloOod; 08-10-2013 at 08:28.
5aloOod is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-10-2013 , 09:24   Re: [HELP] Played Time Extended v0.1
Reply With Quote #6

Quote:
Originally Posted by 5aloOod View Post
Steam accounts are free ofcourse -_-
Simply remove dproto that is all you need.
JoooN is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 08-10-2013 , 10:15   Re: [HELP] Played Time Extended v0.1
Reply With Quote #7

Quote:
Originally Posted by JoooN View Post
Yeah no steam has no support and u and ur frnd have steam id lan cuz i tried and i know ur non steamer however latest version of hld doesnt mean u cant be non steamer a well..
Quote:
Originally Posted by JoooN View Post
Steam accounts are free ofcourse -_-
Simply remove dproto that is all you need.
Umm, doing as he told would fix your problem.. do not say you're not running non-steam server because this uncovers everything
http://www.gametracker.com/server_in...ver_variables/

dp_version 0.48p

Last edited by Moody92; 08-10-2013 at 10:19.
Moody92 is offline
sami_spt
Veteran Member
Join Date: Sep 2012
Location: I<3 pussy cats
Old 08-10-2013 , 10:55   Re: [HELP] Played Time Extended v0.1
Reply With Quote #8

@JoooN

why don't you show us your STEAM Profile? to prove you are a steamer
sami_spt is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-10-2013 , 12:52   Re: [HELP] Played Time Extended v0.1
Reply With Quote #9

Quote:
Originally Posted by Moody92 View Post
Umm, doing as he told would fix your problem.. do not say you're not running non-steam server because this uncovers everything
http://www.gametracker.com/server_in...ver_variables/

dp_version 0.48p
Lol yeah and he writes his server build 6027 and he think we are dumb -_- However we are Steamers here, it doesnt mean that we are dumb and we dont know that you can run dproto on the latest engine.
Quote:
Originally Posted by sami_spt View Post
@JoooN

why don't you show us your STEAM Profile? to prove you are a steamer
// Off Topic
1- Do not change the post title
2- Considering me a Non-Steamer, can do nothing unless I ask for support
3- Maybe I wanna communicate with friend only, not anyone else, should I post my life here for you?
EDIT:
4- Even if you are Steamer, it doesnt mean that your servers are also Steam. (This is an example only)

Last edited by JoooN; 08-10-2013 at 13:06.
JoooN is offline
Old 08-10-2013, 12:56
sami_spt
This message has been deleted by sami_spt. Reason: OFF-Topic =- Dont want to punish him and give him a reply which will make him cry
Old 08-10-2013, 13:00
JoooN
This message has been deleted by JoooN. Reason: Lets go to the subject :)
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-10-2013 , 13:16   Re: [HELP] Played Time Extended v0.1
Reply With Quote #10

Quote:
Originally Posted by JoooN View Post
2- Considering me a Non-Steamer, can do nothing unless I ask for support
FYI, if proof is provided that any user either uses, supports, promotes, or advertises No-Steam in any manner, action can be taken against that user.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 00:15.


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