Search found 148 matches

by Guy71173cp
02 Jun 2012, 16:05
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Check Database For Number of Coins?
Replies: 43
Views: 43846

Re: How To Check Database For Number of Coins?

Ok, I was looking at the user.properties object in the docs. Im not sure how I would achieve this. I tried using the way in the docs: if (cmd == "getWeapons") { var response = {}; response._cmd = "getWeapons"; response.weapons = []; var score = 1500; var bestScore = 12000; var we...
by Guy71173cp
28 May 2012, 22:54
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Check Database For Number of Coins?
Replies: 43
Views: 43846

Re: How To Check Database For Number of Coins?

So my question is, how would I check on the server-side to see how many coins the user has? Like: if(item.COINS == 1000){ // TELLS USER THEY CAN BY COINS And then on the client I'd do what I said on the above post. If I'm wrong, please guide me to the right path. I am not sure how to check the datab...
by Guy71173cp
28 May 2012, 01:04
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Check Database For Number of Coins?
Replies: 43
Views: 43846

Re: How To Check Database For Number of Coins?

So on the client it'd be like: hat.onRelease = function() { smartfox.sendXtMessage(extensionName, "coins", {}, "xml"); } And the extension would be: if (cmd == "coins") { response._cmd = "coins"; response.db = []; var sql = "SELECT COUNT (NAME) FROM USERS...
by Guy71173cp
26 May 2012, 17:39
Forum: SmartFoxServer 1.x Discussions and Help
Topic: Problem With Database Connection
Replies: 1
Views: 5946

Problem With Database Connection

I am creating a customize feature that says to the database. Here is part of the extension: var sql = "UPDATE USERS SET"; sql += " HAIR='"+_server.escapeQuotes(params.HAIR)+"',"; sql += " GLASSES='"+_server.escapeQuotes(params.GLASSES)+"',"; sql += &...
by Guy71173cp
26 May 2012, 14:10
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Check Database For Number of Coins?
Replies: 43
Views: 43846

How To Check Database For Number of Coins?

In my extension, I am using the update sql command so that the user that logs in can customize their avatar, and then it saves. It works, but I am trying to make a command that checks the user's coins in the database and if it is equal to 1,000 then it will fire the update command. Here is my curren...
by Guy71173cp
21 May 2012, 23:29
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Send Array to Database?
Replies: 5
Views: 7353

Re: How To Send Array to Database?

Would this be correct? [code] var dbase function init() { trace("Initing dbExtension") // get a reference to the database manager object // This will let you interact the database configure for this zone dbase = _server.getDatabaseManager() } function destroy() { // Release the reference t...
by Guy71173cp
19 May 2012, 01:09
Forum: The Gallery
Topic: Parrot Land
Replies: 4
Views: 15801

Re: Parrot Land

Nice job, but I have some suggestions: - Create a database login. Then you can save details on an account and you can reserve a username - Get a real domain. .tk is cheap and most people find it easier to go to a .com website. - Don't use Wix - Take your time with designs and programming. Great job ...
by Guy71173cp
19 May 2012, 00:51
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Send Array to Database?
Replies: 5
Views: 7353

Re: How To Send Array to Database?

Alright. How would I send that to the extension then the database, though?
by Guy71173cp
18 May 2012, 22:01
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Send Array to Database?
Replies: 5
Views: 7353

How To Send Array to Database?

I know this is probably a stupid question, but how would I send an array to the extension, which sends it to the database? I have been trying to do this, and my extension is now: var dbase function init() { trace("Initing dbExtension") // get a reference to the database manager object // T...
by Guy71173cp
16 May 2012, 02:37
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Get UserName?
Replies: 12
Views: 13899

Re: How To Get UserName?

I fixed it! I found out the problem was on the client, and the data wasn't displaying in the game. I figured that out because it displayed in the output the coins and the name. Thanks a TON!
by Guy71173cp
16 May 2012, 02:21
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Get UserName?
Replies: 12
Views: 13899

Re: How To Get UserName?

I changed the item variables to this: item.NAME = tempRow.getItem("NAME"); item.COINS = tempRow.getItem("COINS"); The only difference is that I capitalized them. I also changed the sql statement a little: var sql = "SELECT COUNT (NAME) FROM USERS WHERE NAME='"+user.getN...
by Guy71173cp
15 May 2012, 22:57
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Get UserName?
Replies: 12
Views: 13899

Re: How To Get UserName?

In the handleRequest, I traced out

Code: Select all

trace(item.name);


It returns as null. Got any idea? Here's the server:

Code: Select all

[coinextension.as]: null



Thanks.
by Guy71173cp
14 May 2012, 23:29
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Get UserName?
Replies: 12
Views: 13899

Re: How To Get UserName?

var dbase function init() { trace("Initing dbExtension") // get a reference to the database manager object // This will let you interact the database configure for this zone dbase = _server.getDatabaseManager() } function destroy() { // Release the reference to the dbase manager delete db...
by Guy71173cp
13 May 2012, 21:09
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Get UserName?
Replies: 12
Views: 13899

Re: How To Get UserName?

Thanks, I changed my extension to: var dbase function init() { trace("Initing dbExtension") // get a reference to the database manager object // This will let you interact the database configure for this zone dbase = _server.getDatabaseManager() } function destroy() { // Release the refere...
by Guy71173cp
12 May 2012, 15:40
Forum: SmartFoxServer 1.x Discussions and Help
Topic: How To Get UserName?
Replies: 12
Views: 13899

Re: How To Get UserName?

Hey, My SQL statement has changed to var sql = "SELECT * FROM USERS WHERE NAME='"+sender.getName+"'"; like you said, but I get an error in the server console: [ WARNING ] > Error in extension [ coinextension.as ]: ReferenceError: "sender" is not defined. (coinextension....

Go to advanced search