12.08.2013, 01:16
Are you saving this when a player disconnects (well it doesn't seem that way).. or is it some kind of a timer(it's a stock so it isn't a timer)?
Now, about this: PlayerSQLID[i] = MySQL_GetValue(PlayerSQLID[i], "id", "accounts");
The player SQLID is changed on save... so that's where I would look. I never really worked with SQL in SAMP but, I wouldn't change the ID at the saving point. I would not use the ID for the accounts. Use the player's name. Moreover, here is another mistake.
format(query, sizeof(query), "UPDATE `accounts` SET `PlayerIP` = '%s' WHERE `id` = '%d' LIMIT 1", playerip,i);
I would change the i at the end with the PlayerSQLID[i]. And again, I suggest using the player's nickname as the focus here.
"UPDATE `accounts` SET `PlayerIP` = '%s' WHERE `nickname` = '%s" ...
You may know the rest. That is how I also would load up the user's stats. You are mixing up account ids and in-game ids.
Now, about this: PlayerSQLID[i] = MySQL_GetValue(PlayerSQLID[i], "id", "accounts");
The player SQLID is changed on save... so that's where I would look. I never really worked with SQL in SAMP but, I wouldn't change the ID at the saving point. I would not use the ID for the accounts. Use the player's name. Moreover, here is another mistake.
format(query, sizeof(query), "UPDATE `accounts` SET `PlayerIP` = '%s' WHERE `id` = '%d' LIMIT 1", playerip,i);
I would change the i at the end with the PlayerSQLID[i]. And again, I suggest using the player's nickname as the focus here.
"UPDATE `accounts` SET `PlayerIP` = '%s' WHERE `nickname` = '%s" ...
You may know the rest. That is how I also would load up the user's stats. You are mixing up account ids and in-game ids.