How can I make this loop just once?
#2

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.
Reply


Messages In This Thread
How can I make this loop just once? - by Dokins - 12.08.2013, 00:53
Re: How can I make this loop just once? - by Dr.Einstein - 12.08.2013, 01:16
Re: How can I make this loop just once? - by Dokins - 12.08.2013, 01:21
Re: How can I make this loop just once? - by Dr.Einstein - 12.08.2013, 01:27
Re: How can I make this loop just once? - by Dokins - 12.08.2013, 15:19
Re: How can I make this loop just once? - by Scenario - 12.08.2013, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)