Return Boolean through multiple Functions
Hello everybody,
I have a problem which I can not solve. When you type a command in the chat which opens a menu, I want to make a SQL Check for all Items I have in an Array. Now, my problem is, I do not know how to return a value through multiple functions, since I only want to show items the player owns. My current structure looks like this. The Problem is that the SQL is not fast enough so sometimes you can buy a weapon again even when you own it already. Menu : PHP Code:
PHP Code:
Greetz, Kia. |
Re: Return Boolean through multiple Functions
ThreadQuery is way to slow for such things, try out
PHP Code:
|
Re: Return Boolean through multiple Functions
Thanks, I will try that later.
|
Re: Return Boolean through multiple Functions
Why don't you just cache it in memory? Send the query only once when the player connects. The fastest query is no query at all.
I'm almost done with my MySQL data layer, which I'll probably also release as a standalone code snippet/plugin. You might want to check that out when it's done. |
Re: Return Boolean through multiple Functions
Quote:
|
Re: Return Boolean through multiple Functions
1 Attachment(s)
Well it does, you just change it in the memory and then save everything when the player disconnects. My data layer does this.
I'm attaching my current version which you can try out if you want. Just hook up a database to the SQL_MakeDbTuple native, go to the server, write addclass to the console a couple of times to add random data, then getclass which will loop through all of the currently cached data and print it to your console and saveclass to save it into the database. That's the functionality the data layer will have, so I really recommend you to wait it out, it's DESIGNED for stuff like player inventories. It's not made for actual use, but it won't take me more than a few days to completely finish it and release it. |
| All times are GMT -4. The time now is 09:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.