The solution to the first problem is simple. The second parameter of hooks.add should be a UNIQUE name for each hook. Otherwise it will overwrite the other hook.As to the Setspawn Cmd problem I'll have a better look at it when I get home.
[editline]11th August 2011[/editline]
Actually. Just looked at it again. First our getting the prop file "lua/yadayada" when the server automatically puts the lua/ part of the filepath on. That would result in the propfile variable you made being nil and the calls to it's functions fail.
[editline]11th August 2011[/editline]
Due to the file not being found.
Well.. Thx, now i know that i need unique names :D
I'll test the filepath thing of Exactspawn...
Does anybody even run a server with this yet?
[QUOTE=MeltingData;31665621]Does anybody even run a server with this yet?[/QUOTE]
Im actually going to be throwing one up on my server to kind of showcase it a bit.
It will start of with pretty much nothing in the scripts but ill gradually build it up with different things as I go.
[QUOTE=Genesis999;31665869]Im actually going to be throwing one up on my server to kind of showcase it a bit.
It will start of with pretty much nothing in the scripts but ill gradually build it up with different things as I go.[/QUOTE]
Nice, make a thread when it's up.
I have an unofficial server with this, to test my scripts... once i have collected enough i will make it official :D
IP: Zombe.net:2
EDIT:
KickAssStyle just told me you were on my server (While i was making a forum for LuaServer)
....
Well here it is: [url]http://mc-luaserver.com/[/url]
I've made it to have a platform where you can create News, update your mod and we can share our support problems + plugins with each other.
Register and i make you an admin ;)
I have recently got this error when i try to place or break a block:
[code][WARNING] LUA: Error at OnPlayerBreakBlock
[WARNING] Failed to handle packet: java.lang.ArrayIndexOutOfBoundsException: -1
java.lang.ArrayIndexOutOfBoundsException: -1
at org.luaserver.blocks.LuaBlock.<init>(LuaBlock.java:20)
at pu.a(ItemInWorldManager.java:163)
at ha.a(NetServerHandler.java:390)
at eo.a(SourceFile:57)
at jl.b(SourceFile:279)
at ha.a(NetServerHandler.java:55)
at cu.a(NetworkListenThread.java:80)
at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:394)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:296)
at bq.run(ThreadServerApplication.java:21)
[/code]
I've got a good idea: How about using A Minecraft Moon as official LuaServer Logo, since Lua is portuguese and means Moon :D
Edit:
[url]http://mc-luaserver.com/[/url] Is a good way to share our plugins :D
Edi²: How about adding a player.rightclick hook and a MySQL and propfile tutorial? that would help me alot :D
[QUOTE=iZeD_IV;31670372]I've got a good idea: How about using A Minecraft Moon as official LuaServer Logo, since Lua is portuguese and means Moon :D
Edit:
[url]http://mc-luaserver.com/[/url] Is a good way to share our plugins :D
Edi²: How about adding a player.rightclick hook and a MySQL and propfile tutorial? that would help me alot :D[/QUOTE]
Cool forum... even if i dont particularly like the brownness. :P
And a player.rightclick hook is in the works ive just got to get it working right.
Also there is now a property files tutorial ( of sorts im not the best at writing guides ) on the wiki.
Well thanks for the tutorial, will check it out...
Im working on a plugin that compines all standard commands ... from spawn over item to clearinventory and tp....
Fun :D
When ive finished it i will post it on the forums.
Also:
Is there anyway that someone with many skills (you?) can make a canary like groups and permissions system (maybe built in)
[url]www.canarymod.net[/url] keep a look on it's awesome groups+permissions system
EDIT: Good Property File tutorial, but can you make an example script where it first creates a file, then if the file already exists it loads a file and then it writes a number to the file and everytime someone writes /add ingame the number gets added to 1
....
this would be a good script to learn how to use propfiles.
Also can you make LuaServer compatible with MySQL, since i have a homepage and mysql is easier to read per php....
I'm not a fan of SQLite, ive tried already to use LuaSQL mysql driver but thats not really working... thanks
Sincerly iZeD
I'm already using Bukkit for my server, but anyone know if LuaServer works with Bukkit/SimpleServer/Etc?
And I'm trying to do a WorldEdit-like plugin
1. Its not compatible with bukkit/canary since those are the same things....mostly...
2. When you are done port it on [url]www.mc-luaserver.com[/url] ;D ohh and nice idea with the WorldEdit like plugin
[QUOTE=Val67;31692880]I'm already using Bukkit for my server, but anyone know if LuaServer works with Bukkit/SimpleServer/Etc?
And I'm trying to do a WorldEdit-like plugin[/QUOTE]
As far as I know, Genesis' doesn't work with Bukkit. I'm making one that does, but the urge to code it comes and goes. Right now it's gone... :(
Why does end have to do all the work?
Function just sits there doing nothing all day.
Let's form a internet petition about it.
I fast need the syntaxes of Sql.InsertIntoTable,UpdateTable and SelectTable
Its for the spawn plugin...
[QUOTE=iZeD_IV;31700799]I fast need the syntaxes of Sql.InsertIntoTable,UpdateTable and SelectTable
Its for the spawn plugin...[/QUOTE]
[url]http://olympusgaming.org/wiki/index.php/SqlManagerClass[/url]
Each one of them is clickable. And gives you information on them.
'Thx for this fast answer....
EDIT:
Problem:
[QUOTE][WARNING] Trouble executing SQL query.
[WARNING] [-98] DB[1] is not confined[/QUOTE]
Script:
[QUOTE]Sql.UpdateTable("Spawn", "Y='Player.GetPositionY()'", "Id='1'")[/QUOTE]
I'm having a similar issue as iZed_IV. I'm receiving the following,
[code]
[INFO] Creating SQL table.
[WARNING] Aug 12, 2011 11:59:29 PM org.sqlite.Internal log
INFO: [sqlite] DB[1]: instantiated [database.ndb]
[WARNING] Aug 12, 2011 11:59:29 PM org.sqlite.Internal log
INFO: [sqlite] Internal: loaded sqlite4java-win32-x64 from D:\***\Documents\minecraft serv\sqlite4java-win32-x64.dll
[WARNING] Aug 12, 2011 11:59:29 PM org.sqlite.Internal log
INFO: [sqlite] Internal: loaded sqlite4java-win32-x64
[WARNING] Trouble initialising SQL database
[WARNING] [-93] cannot load library: java.lang.UnsatisfiedLinkError: org.sqlite._SQLiteSwiggedJNI.sqlite3_libversion()Ljava/lang/String;
[WARNING] Trouble executing SQL query.
[WARNING] [-98] DB[1] is not confined
[WARNING] Failure to create 'test' SQL table. Error is probably above.
[WARNING] Trouble executing SQL query.
[WARNING] [-98] DB[1] is not confined
[/code]
With the following code,
[lua]
local success = Sql.CreateTable( "test", "username TEXT, money TEXT" );
if not success then Server.Warning( "Failure to create 'test' SQL table. Error is probably above." ) end;
Sql.InsertIntoTable( "test", "username, money", "'prefanatic', '10'" );
[/lua]
I realize there isn't any return in the if not statement, but that is just because I waned to see if the insert function would actually work; if the error was reported regardless of it working or not.
SQL seems to not be working ATM. Sorry. I'm working on it as we speak.
On a different note I now have a website just for luaserver. The wiki is currently being moved over and a forum has been setup. Check it out at: [url]www.luaserver.org[/url] :D
The luaserver.org forums actiation doesnt work, it didnt send me an email....
[QUOTE=iZeD_IV;31707330]The luaserver.org forums actiation doesnt work, it didnt send me an email....[/QUOTE]
I activated your account manually. And fixed the mailing problem.
I can't get Player.X to work. It returns nothing. And I keep getting "attempt to index ? (a nil value)"
Edit: Player:GetPositionX(), Y U NO WORK?
I honestly want to see this progress further. I'm a GLua coder, and this is really close to GLua, which is why I love it. Keep up the good work!
By the way, I don't understand how AddItem works, I've tried doing ply:AddItem(260, 1) and it keeps telling me that it's "attempting to call nil" for some reason, even though the player entity is passed.
Leetnoob the additem function is part of the inventory object that you get through player:GetInventory():AddItem
[QUOTE=Genesis999;31719118]Leetnoob the additem function is part of the inventory object that you get through player:GetInventory():AddItem[/QUOTE]
Ah, thanks.
[editline]14th August 2011[/editline]
By the way, is there a function like BreakBlock() or something like that? I've been looking through the wiki, but can't seem to find it. Also, a request, if you can. Add in a function that would return a table of all players on the server. I'm sorry if it already exists, I just can't find it on the wiki.
How can I get the player's position? Player.X won't work
Also, OnPlayerBreakBlock doesn't seem to work. :/
And player.breakblock doesn't have the block ID that has been broken.
Still, I'd love to see this progress further.
[QUOTE=LEETNOOB;31722504]Ah, thanks.
[editline]14th August 2011[/editline]
By the way, is there a function like BreakBlock() or something like that? I've been looking through the wiki, but can't seem to find it. Also, a request, if you can. Add in a function that would return a table of all players on the server. I'm sorry if it already exists, I just can't find it on the wiki.[/QUOTE]
Use the SetBlock function with an Id of 0.
And Server.GetPlayers("#all") will return a table of all players.
The wiki's a bit weird. This page uses GetBlockId()
[url]http://olympusgaming.org/wiki/index.php/OnPlayerBreakBlock[/url]
While this one says that I need to input XYZ.
[url]http://olympusgaming.org/wiki/index.php/WorldClass[/url]
And even if I do, it tells me that I'm attempting to call nil.
Code:
[lua]function DIAMONDS(ply, block, face)
local bt = block:GetBlockId()
print(bt)
if bt == 2 or bt == 3 or bt == 12 then
ply:GetInventory():AddItem(264, 1)
end
end
Hooks.Add("player.breakblock", "DIAMONDS", DIAMONDS)[/lua]
Build 20 released
-----------
Added a player.startsneak hook
Added a player.stopsneak hook
Added a player.useitem hook
Fixed the SQL system.
Added World:RemoveBlock(x,y,z)
Removed World:GetBlockId() and World:GetBlockMetadata()
Added World:GetBlock() returns a Block class.
Made some changes to the Block class.
Edit:
Also Leetnoob you've linked to the OnPlayerBreakBlock page which is out of date and hasnt been used for quite awhile.
Also olympusgaming.org/wiki is now defunct.
I have launched a site just for LuaServer with forums, a wiki that is now up to date with build 20.
You can check that out at [url]www.luaserver.org[/url] :)
Sorry, you need to Log In to post a reply to this thread.