![]() |
@ cyan3 thanks for the link, but I should have made myself more clear, I'm trying to practice/learn database npc more at the moment, I will be learning or starting SQL whenever I am more advanced
@cbk1994 I'll remember that for when I start thanks I'm really stuck on database/database npc's though. Are there many guides/information on them? Also, how would you go about making for example a simple spar stat database to keep information on player spar wins? Also, could someone possibly explain why/when you would use them more often, as it would probably make more seance to just use clientr to record spar stats for example? |
I can't help much with this, but I can give you an example in relation to the shop stuff you were working on previously.
full script: http://forums.graalonline.com/forums...highlight=shop In a Database NPC, such as: DB_Prices, put the following: PHP Code:
PHP Code:
That is just one example. I do hope someone else can chime in because I would like to learn a bit more when a Database NPC might be more plausible than just a regular level NPC, etc... |
Thanks for the reply, but I'm still having trouble with them. I tried to make a simple npc where when the player touchs it, it will chat the databases flag. In the database I have
PHP Code:
PHP Code:
|
Quote:
Right. What is the name of your database? Your script says its DB_test Also, you need to indicate the item id in the npc you're touching somewhere: ex: this.item = 100; Then reference it like this: this.chat = DB_test.("item_" @ this.item); |
Maybe this is what you're looking for.
DB_test: PHP Code:
PHP Code:
|
Quote:
|
Quote:
I understand you might be trying to go off of my previous examples, but could you give us some code examples ? |
This may be really off, but I tried to make it so when a player touches the npc it adds 1 to the item_playersname in the databse. Can someone explain what is wrong here and how to fix please?
In NPC: PHP Code:
PHP Code:
|
Yeah, seems like you didn't format things properly..
wrong: this.ida = stats_(this.playername); right: this.ida = (@ "stats_" @ this.playername); wrong: DB_test.addstats(this.ida) += 1; right: DB_test.addstats(this.ida); Although the way you set this up was odd, here's how I would of done it. NPC: PHP Code:
PHP Code:
|
Thanks tim and torankusu for the help. I finally get how to set it up :)
|
I started to take a look at sql and I am pretty stuck on some basic things :(. I wanted to try to make a simple login database for practice, but I couldn't get it to work at all. I used the SQL explorer and put in :
PHP Code:
The script in the npc is - http://pastebin.com/2s1HeB2L (The forums were giving me an error so I just pasted the scripts on pastebin instead) |
I think you should stick to the other scripting stuff before jumping over to sql
|
callimuc is correct, it is not a good idea to delve into sql while not being completely familiar with the language syntax
there are at least 4 problems with what you are attempting to do -
if you ever encounter sql within a live environment you should never tamper with it unless you are completely sure about how it works and how to use it |
Thanks for the replies, I guess I'll just stick with learning some other things for now than
|
I am working on making a custom chat system, and I wanted to have a gui to display previous chat from the player and other players. I managed to get most of it to work, but I am stuck on getting it to send to other players gui and have it display others text. Can someone explain what is wrong and possibly if there is a better way to find the players than by if they are in the same level?
trigger: PHP Code:
PHP Code:
http://pastebin.com/ts8SGipV (forum kept giving me a denial message, so I posted it there) entire script if it helps to get an idea of what i'm doing: http://pastebin.com/Fm0CMqGb |
| All times are GMT +2. The time now is 01:38 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.