 |
|
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
|

05-06-2011
, 06:52
Re: [SOLVED]client_disconnect & mysql
|
#6
|
Hmm, I think client_connect() triggers when player is accepted to server while in loading, but if the player cancells in loading the client_disconnect() doesn't trigger unless the player has entered the game.
So, if that's surely true , you should use client_putinserver() for adding to db.
You should test it tough, add server prints to console upon connect and disconnect, connect to the server and then cancel while loading.
And just a small note: about your team comment, are those numbers from their actual team (like [cs_]get_user_team) ? Because in-game, the spectators are team 3.
And about your updating stuff... where do you actually update the stats ? All I see is INSERT and DELETE... because if you're having trouble deleting that when player left, you can do it just fine in the update sequence, just check is_user_connected() (or better: a global variable) and check it before updating then delete player and skip to next one.
And if you don't have a updating sequence already, set_task() on 5-30 seconds will do just fine.
__________________
Last edited by Hunter-Digital; 05-06-2011 at 06:59.
|
|
|
|