Stats wont save when player dicconnect
#1

player stats won't save when disconnect

this is the code

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new
    
Query200 ], // We need to create such a query so we can format it.
    
nameMAX_PLAYER_NAME ]    ;
    
GetPlayerName(playeridnamesizeof(name)); // Gather the name of the player.
    
if(Bit1_Get(g_PlayerLoggedplayerid) == 1)
    {
    
format(Query,sizeof(Query),"UPDATE `USERS` SET SCORE = '%d', CASH = '%d', ADMINLEVEL = '%d' WHERE `NAME` = '%s'",
    
GetPlayerScore(playerid), // Gather the player's score
    
GetPlayerMoney(playerid), // Gather the player's money
    
Bit16_Get(g_AdminLevelplayerid), // Gather the Admin Level
    
DB_Escape(name)); // Gather the name of the player then escape it.
    
db_query(DatabaseQuery);
    
Bit1_Set(g_PlayerLoggedplayeridfalse);
    
SendClientMessage(playerid,COLOR_LIGHTGREEN,"[STATS]:{FFFFFF}Your stats has been save.");
    }
    return 
1;

Reply
#2

Wrong section, Post it in Scripting Help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)