MySQL queries question
#1

Hey SA:MP community! I've got some little questions about MySQL as I'm a beginner.

So - I have a MySQL R7-based account system but I'm wondering - let's say I would have 100 players online at once on my server(dreams lol). How should I save the account information? Should I save ALL the data when the player disconnects? Should I save only one field every time the variable for that field changes? Like everytime a player's money changes I should execute a query which saves the `Money` field in the database?

How and when do you save data using MySQL on your SA:MP server?
Reply
#2

Well... From my learnings you will have to define it all in the script + the mysql data and tell it to copy the players data to a table based on their stats...
Reply
#3

I say, which is what i do, make a function to save data, set a timer. for say, every 10 mins, save the data. Then after every crucial (house buying, money transfers etc) use the function.

If you didn't understand:

SaveData(playerid)

pawn Код:
CMD:something(playerid,params[])
{
    Stuff
    SaveData(playerid);
    return 1;
}
So, (personally) my opinion, create a function, and call it each time you need, as mentioned above.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)