Query Mysql
#8

Actually, that is VERY bad. The only variables that need updating on player disconnect are the ones being constantly modified (like money, online time, coordinates, health whatever). Most of things like licenses, jail times, bank amounts can be updated in the database ONLY WHEN NECESSARY.

Let me show some pseudocode to perhaps make it more clear...
pawn Код:
// Your current solution
function, where licenses are modified(playerid)
{
    licensevariable[playerid] = ...;
}

public OnPlayerDisconnect(playerid)
{
    query to update all variables (including license variables for example)
}
pawn Код:
// desired and better solution
function, where licenses are modified(playerid)
{
    licensevariable[playerid] = ...;
    query to update the player's license in the database
}

public OnPlayerDisconnect(playerid)
{
    query to update only necessary variables (definitely excluding license variables which have already been set)
}
Not the best way to put it, but I hope you understand!
Reply


Messages In This Thread
Query Mysql - by fabriziobondi - 21.11.2011, 11:51
Re: Query Mysql - by FarSe. - 21.11.2011, 12:07
Re: Query Mysql - by fabriziobondi - 21.11.2011, 12:10
Re: Query Mysql - by iJumbo - 21.11.2011, 12:24
Re: Query Mysql - by fabriziobondi - 21.11.2011, 12:46
Re: Query Mysql - by FarSe. - 21.11.2011, 12:47
Re: Query Mysql - by fabriziobondi - 21.11.2011, 12:55
Re: Query Mysql - by AndreT - 21.11.2011, 13:02
Re: Query Mysql - by fabriziobondi - 21.11.2011, 13:13
Re: Query Mysql - by fabriziobondi - 21.11.2011, 13:44

Forum Jump:


Users browsing this thread: 2 Guest(s)