Quote:
Originally Posted by Bugsy
Running 2 instances of the same plugin?
|
nop..
this is disconnected function
PHP Code:
#if AMXX_VERSION_NUM < 183
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
if(g_PlayerData[id][ISBOT] == 1 )
return PLUGIN_HANDLED;
save_data(id);
return PLUGIN_CONTINUE;
}
public save_data(id)
{
new szQuery[512];
formatex(szQuery, charsmax(szQuery), "UPDATE `%s` SET `last_visit` = '%i' , `points` = '%i' WHERE `steamid` = '%s'",
g_szTable, get_systime(), g_PlayerData[id][CASH], g_PlayerData[id][STEAMID]);
SQL_ThreadQuery(g_SqlTuple, "FreeHandle", szQuery);
}
actually, sometimes g_PlayerData[id][CASH] = 0 even if player made some points.
PHP Code:
public client_authorized(id)
{
if(is_user_bot(id) || is_user_hltv(id))
{
g_PlayerData[id][ISBOT] = 1;
return PLUGIN_HANDLED;
}
get_user_authid(id, g_PlayerData[id][STEAMID], charsmax(g_PlayerData[][STEAMID]));
get_user_name(id, g_PlayerData[id][NAME], charsmax(g_PlayerData[][NAME]));
get_user_ip(id, g_PlayerData[id][IP], charsmax(g_PlayerData[][IP]), 1);
mysql_escape_string(g_PlayerData[id][NAME], charsmax(g_PlayerData[][NAME]));
g_PlayerData[id][DONATE] = 0;
g_PlayerData[id][ID] = id;
g_PlayerData[id][CASH] = 0;
g_PlayerData[id][CHAT] = 1;
g_PlayerData[id][LASTVISIT] = 0;
g_PlayerData[id][DAILYBONUS] = 0;
g_PlayerData[id][VIPSTEAM] = 0;
g_PlayerData[id][VIP] = 0;
g_PlayerData[id][VIPRESET] = 0;
g_PlayerData[id][TOKENS] = 0;
get_data(id);
set_task(float(HELLO_TIME), "hello_user", id + HelloTask);
return PLUGIN_CONTINUE;
}
at client_authorized, sometimes function hello_user is called 2 times and i call only one time in this plugin.
i think is a engine problem.