06-01-2011, 07:21 AM
Pages: 1 2
06-01-2011, 08:53 AM
Read this page (just created it) http://mc-server.org/wiki/doku.php?id=ap...in:onlogin
And check out the Core plugin for an example.
And check out the Core plugin for an example.
06-02-2011, 04:38 AM
Could you install the md5 Library for crypt the password?
http://www.keplerproject.org/md5/index.html
http://www.keplerproject.org/md5/index.html
06-02-2011, 06:51 AM
I already have a MD5 encryption script in MCServer, but it's not open to Lua yet... I'll try to include it in next release.
In the meanwhile I think you can test your plugin without encryption
In the meanwhile I think you can test your plugin without encryption
06-02-2011, 06:59 AM
Yes, for moment I have my crypt function 
Found my first bug but I dont now how to solve it
Product this with /help 3
Auth
/changepass - [Old Password] [New Password] - Change pass
Auth
/test
/register - [Password] - Login with the password
An idea to fhix that?

PHP Code:
function AuthPluginCrypt(Password)
return Password
end
Found my first bug but I dont now how to solve it
PHP Code:
self:AddCommand("/changepass", " - [Old Password] [New Password] - Change pass", "auth.changepass") -- Commande pour changer de mot de pass (commun)
self:AddCommand("/test", "", "auth.test") -- Commande pour tester
self:AddCommand("/register", " - [Password] - Login with the password", "auth.register") -- Commande pour s'enregistrer (commun)
self:BindCommand( "/changepass", "auth.changepass", HandleChangePassCommand ) -- Associe la commande /changepass a la fonction HandleChangePassCommand
self:BindCommand( "/test", "auth.test", HandleTestCommand ) -- Associe la commande /test a la fonction HandleTestCommand
self:BindCommand( "/register", "auth.register", HandleRegisterCommand ) -- Associe la commande /register a la fonction HandleRegisterCommand
Product this with /help 3
Auth
/changepass - [Old Password] [New Password] - Change pass
Auth
/test
/register - [Password] - Login with the password
An idea to fhix that?
06-02-2011, 08:55 AM
Hmm.. so you get 'Auth' twice in /help ? Sounds like a bug in the /help command of Core. Nothing you have to worry about.
06-02-2011, 09:01 AM
Could you make the doc for OnDisconnect please?
And I have send the screenshot for /help
Another problem...
Transfrome my Ini file:
Into
And I have send the screenshot for /help
Another problem...
PHP Code:
local PlayerName = Player:GetName()
if ( UsersIni:ReadFile() == true ) then
UsersIni:DeleteValue(PlayerName, "X")
UsersIni:SetValue(PlayerName, "X", Player:GetPosZ())
UsersIni:WriteFile()
return true
end
Transfrome my Ini file:
Code:
[Zehir_]
Groups=Admins
Password=testtest
Code:
[Zehir_]
Groups=Admins
Password=testtest
Groups=Admins
Password=testtest
X=-2730.3552566584
[Zehir_]
06-02-2011, 09:54 AM
Thanks for the screenshot.
About your ini problem, make sure you only ReadFile() ONCE:
BAD!
Good
Here's the page for OnDisconnect: http://www.mc-server.org/wiki/doku.php?i...disconnect
About your ini problem, make sure you only ReadFile() ONCE:
Code:
UsersIni = cIniFile("myIni.ini")
UsersIni:ReadFile()
UsersIni:ReadFile()
UsersIni:ReadFile()
UsersIni:WriteFile()
Code:
UsersIni = cIniFile("myIni.ini")
UsersIni:ReadFile()
UsersIni:WriteFile()

Here's the page for OnDisconnect: http://www.mc-server.org/wiki/doku.php?i...disconnect
06-02-2011, 09:42 PM
What is this fuction for ini files?
Erase();
Clear();
Reset();
Edit: Solve problem with change local values
function AuthPlugin:OnPlayerMove( Player )
Can you change your function to detect the displacement of a block and not 0.00000001 bloc? Because this spam my channel of
Because I want block movement if player not login
A idea for not spam this message?
Erase();
Clear();
Reset();
Edit: Solve problem with change local values
function AuthPlugin:OnPlayerMove( Player )
Can you change your function to detect the displacement of a block and not 0.00000001 bloc? Because this spam my channel of
PHP Code:
Player:SendMessage( cChatColor.Red .. "You must login" )
Because I want block movement if player not login
PHP Code:
function AuthPlugin:OnPlayerMove( Player )
if IsAuth == 0 then
--Player:TeleportTo( SpawnPosx, SpawnPosy, SpawnPosz )
else
return true
end
Player:SendMessage( cChatColor.Red .. "You must login" )
return false
end
06-04-2011, 02:11 AM
Oh to use this fuction? AddKeyName
I have try this but not work:
I just want add the key if not exist
I have try this but not work:
PHP Code:
local UsersIni = cIniFile("users.ini")
if ( UsersIni:ReadFile() == true ) then
UsersIni:AddKeyName(Player:GetName())
UsersIni:WriteFile()
return true
end
I just want add the key if not exist
Code:
[Playername]
Pages: 1 2