Code:
public client_disconnect(id)
{
if(solorun == true)
{
if(id == soloid && is_user_alive(soloid)) // Didn't die
{
new name[32]
get_user_name(soloid, name, 31) // Solo Gunner name
replace_all(name,31,"'","")
replace_all(name, 31, "^"", "")
//formatex(selectquery, 255, "USE %s", db)
//SQL_ThreadQuery(sql, "query", selectquery)
formatex(g_query, 511, "UPDATE played_time SET playedtime=playedtime-%d WHERE name=^"%s^"", get_pcvar_num(g_Ddisconnect) , name)
SQL_ThreadQuery(sql,"query", g_query)
remove_task(soloid)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
I'm trying to make a bonus time plugin for played time plugin, the problem is the name, I can't get the name correctly, I tried to comment these 2 lines (the ones that are highlighted) and the name worked perfectly, but as for SQL, I must remove these characters ' & ^, and I don't know how to solve it.
Could someone post an explanation of what's wrong, and how to fix it, if possible?
PS: I took these two lines from the played time plugin.
__________________