View Single Post
Author Message
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 05-10-2015 , 08:12   Mysql Problems, Reseting.
Reply With Quote #1

Hey, i got a problem, i am using mysql on my server for saving levels, but it keeps reseting for some players and some not. When an admin changed the map, they were 4 players, 2 lost their levels, 1 kept them. 1 wasnt even playing and joined later and lost them. it isnt always like this, it is random.

Yes, yes, i have searched both google and the forum, cant find anything.

Mysql have been a pain in the ass for me, ive tried client_authorized, client_putinserver, spawn, etc. nothing seems to work safely. If you have something that is safe, feel free to share your method cause im out of ideas cause ive tried most things and dont know much about mysql, and ive heard that the mysql tutorial is faulty and wrong in many cases which seems true.

PHP Code:
public client_authorized(Id

    
get_user_authid(Idg_Steam[Id], charsmax(g_Steam[])) 
    
set_task(5.0,"LoadShit",Id TASK_SQL


public 
LoadShit(Id)
{    
    
Id-= TASK_SQL
    
    Load_PlayerLevel
(Id)

public 
client_disconnect(id)
{
    
Save_PlayerLevel(id)
}

public 
fw_Killed(id) {
    if(
is_user_connected(id))
        
Save_PlayerLevel(id)

Thanks for helping.
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 05-10-2015 at 11:24.
SkumTomteN is offline