سلآم الله عليكم اخواني
ممكن طلب بسيط جداً
ساطرح لكم ملف كلينت وملف سيرفر لمود auto login
ولكن هذا المود عمله مختلف عن الذي اريدة ،
حيث انه يعمل عند كتابة
autologin user pass
وانا لا اريدة هكذه
اريده لو يسجل دخوله الاعب مره واحدة يسوي auto login تلقائي
يعني من اول مره ي اخوان
ملف كلينت :
addEventHandler("onClientResourceStart",getRootElement(),
function()
if not fileExists("settings.xml") then
local settings = xmlCreateFile("settings.xml","AutoLogin")
local Username = xmlCreateChild(settings,"Username")
local Password = xmlCreateChild(settings,"Password")
local Serial = xmlCreateChild(settings,"Serial")
xmlSaveFile(settings)
end
local node = xmlLoadFile ("settings.xml")
local Username = xmlFindChild(node,"Username",0)
local Password = xmlFindChild(node,"Password",0)
local Serial = xmlFindChild(node,"Serial",0)
local pass = xmlNodeGetValue(Password)
local user = xmlNodeGetValue(Username)
local serial = xmlNodeGetValue(Serial)
if getPlayerSerial(localPlayer) == serial then
triggerServerEvent("triggerThis",getLocalPlayer(),user,pass)
end
end
)
addCommandHandler("autologin",
function(command,username,password)
local node = xmlLoadFile ("settings.xml")
local Username = xmlFindChild(node,"Username",0)
local Password = xmlFindChild(node,"Password",0)
local Serial = xmlFindChild(node,"Serial",0)
local user = xmlNodeGetValue(Username)
local pass = xmlNodeGetValue(Password)
local serial = xmlNodeGetValue(Serial)
if user == "none" or user == "" then
xmlNodeSetValue(Username,username)
xmlNodeSetValue(Password,password)
xmlNodeSetValue(Serial,getPlayerSerial(getLocalPlayer()))
xmlSaveFile(node)
else
xmlNodeSetValue(Username,"none")
xmlNodeSetValue(Password,"none")
xmlNodeSetValue(Serial,"none")
xmlSaveFile(node)
end
end )
=============== الي فوق هو كلينت
addEvent("triggerThis",true)
addEventHandler("triggerThis",getRootElement(),
function(user,pass)
logIn(source,getAccount(user),pass)
outputChatBox("You have been automatically logged in to #FFFFFF"..user.."'s#00FF00 account!",source,0,255,0,true)
outputChatBox("To disable AutoLogin, use /autologin!",source,0,255,0,true)
end )
هذا هو ملف سيرفر ،
اخواني الي مافهمني يقول لي عشان اشرح له اكثر
انا بحاجة لهذا الشيء جداً