Jump to content

موضوع للجميع انا زهقت قسسم


Recommended Posts

رتبلي الاكواد الكود مرره مو شغال

مدري

ليش

كلينت

GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(208,154,568,231,"Login and Register",false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(11,20,548,202,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("login / register",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(73,31,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(256,11,5,5,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[1] = guiCreateEdit(25,51,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[2] = guiCreateEdit(25,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Button[1] = guiCreateButton(47,129,84,33,"register",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(408,167,57,16,"save",false,false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(73,77,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,255,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[3] = guiCreateEdit(366,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[4] = guiCreateEdit(366,50,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Label[4] = guiCreateLabel(421,29,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[4],255,255,0) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(420,76,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[5],255,255,0) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(392,131,84,33,"Login",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
bindKey ( "F2" , "down" , function() 
 if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then 
 guiSetVisible ( GUIEditor_Window[1] ,false ) 
 showCursor (false ) 
 guiSetInputEnabled(false) 
 elseif ( guiGetVisible ( GUIEditor_Window[1] ) == false ) then 
 guiSetVisible ( GUIEditor_Window[1] ,true ) 
showCursor (true) 
 guiSetInputEnabled(true) 
 end 
 end 
 ) 
  
addEventHandler ("onClientGUIClick", root, 
  
function() 
  
    if ( source ==  GUIEditor_Button[2] ) then 
  
        triggerServerEvent("Login",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
  
    end 
  
end 
  
) 
  
addEvent ( "onSpecialEvent", true ) -- الخطوه الاولى 
addEventHandler("onSpecialEvent",root,-- الخطوه الثانيه 
function () 
 if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then -- الخطوه الثالثه 
 guiSetVisible ( GUIEditor_Window[1] ,false ) -- الخطوه الرابعه 
showCursor ( true ) 
    end 
end 
) 

سيرفر

addEvent("Login",true) 
addEventHandler("Login",root, 
    function(player,userName,Password ) 
        local v = getAccount ( userName, Password ) 
            if ( v ~= true) then 
              if logIn ( player, v, Password ) == true then 
                outputChatBox ( "Login with account : [ " .. userName .. " ]", player, 255, 255, 0 , true ) 
                triggerClientEvent("onSpecialEvent",player) 
          else 
                outputChatBox("Error : In login",player,255,255,255,true) 
                end 
        end 
    end 
) 
  

Link to comment
  • Replies 369
  • Created
  • Last Reply

Top Posters In This Topic

لاتعطيني ياه جاهز

قلي وانا اسوي

function onJoin ( ) 
    x, y, z = getElementPosition ( source ) 
    local theVehicle = createVehicle ( 470, x, y, z ) 
    warpPedIntoVehicle ( source, theVehicle ) 
end 
addEventHandler ( "onPlayerLogin", root, onJoin ) 

كود السياره

Link to comment
استفسار

====

انا الحين عندي كود ! اذا سجلت

login

تجيك سياره

طيب !

انا ابيه

اول مايدخل السيرفر يكون معه سياره !

onPlayerJoin

وافضل تسوي جدول للسيارة تجنباً للاخطاء ذذ ,

createVehicle 
getElementPosition 

+ كيف تبيه تجيه سياره وهو ما سوى سباون ذذ ؟

استخدم افضل - onPlayerSpawn

Link to comment

Edit #

-- Client Side #

GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(208,154,568,231,"Login and Register",false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(11,20,548,202,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("login / register",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(73,31,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(256,11,5,5,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[1] = guiCreateEdit(25,51,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[2] = guiCreateEdit(25,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Button[1] = guiCreateButton(47,129,84,33,"register",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(408,167,57,16,"save",false,false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(73,77,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,255,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[3] = guiCreateEdit(366,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[4] = guiCreateEdit(366,50,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Label[4] = guiCreateLabel(421,29,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[4],255,255,0) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(420,76,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[5],255,255,0) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(392,131,84,33,"Login",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
bindKey ( "F2" , "down" ,  
function() 
    guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) 
    showCursor(guiGetVisible(GUIEditor_Window[1])) 
    guiSetEnabled(guiGetVisible(GUIEditor_Window[1])) 
    end 
) 
  
addEventHandler ("onClientGUIClick", GUIEditor_Button[2], 
function() 
    triggerServerEvent("Login",localPlayer, guiGetText(GUIEditor_Edit[4]), guiGetText(GUIEditor_Edit[3])) 
end,false) 
  
addEvent ( "onSpecialEvent", true ) 
addEventHandler("onSpecialEvent",root, 
function () 
    if ( guiGetVisible ( GUIEditor_Window[1] )) then 
    guiSetVisible ( GUIEditor_Window[1] ,false ) 
    showCursor ( true ) 
        end 
    end 
) 

-- Server Side #

addEvent("Login",true) 
addEventHandler("Login",root, 
    function(player,userName,Password ) 
        local v = getAccount ( userName, Password ) 
            if ( v ~= true) then 
              if logIn ( player, v, Password ) == true then 
                outputChatBox ( "Login with account : [ " .. userName .. " ]", player, 255, 255, 0 , true ) 
                triggerClientEvent("onSpecialEvent",player) 
                fadeCamera(player,true) 
          else 
                outputChatBox("Error : In login",player,255,255,255,true) 
                end 
        end 
    end 
) 
  
function Join() 
fadeCamera(source,false) 
end 
addEventHandler("onPlayerJoin",root,Join) 

ملف سيرفر ضفت له اول ما يدخل الشاشه سودآء واذا سجل الدخول ترجع زي ماهي ذذ

Link to comment
Edit #

-- Client Side #

GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(208,154,568,231,"Login and Register",false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(11,20,548,202,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("login / register",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(73,31,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(256,11,5,5,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[1] = guiCreateEdit(25,51,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[2] = guiCreateEdit(25,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Button[1] = guiCreateButton(47,129,84,33,"register",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(408,167,57,16,"save",false,false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(73,77,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,255,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[3] = guiCreateEdit(366,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[4] = guiCreateEdit(366,50,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Label[4] = guiCreateLabel(421,29,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[4],255,255,0) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(420,76,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[5],255,255,0) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(392,131,84,33,"Login",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
bindKey ( "F2" , "down" ,  
function() 
    guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) 
    showCursor(guiGetVisible(GUIEditor_Window[1])) 
    guiSetEnabled(guiGetVisible(GUIEditor_Window[1])) 
    end 
) 
  
addEventHandler ("onClientGUIClick", GUIEditor_Button[2], 
function() 
    triggerServerEvent("Login",localPlayer, guiGetText(GUIEditor_Edit[4]), guiGetText(GUIEditor_Edit[3])) 
end,false) 
  
addEvent ( "onSpecialEvent", true ) 
addEventHandler("onSpecialEvent",root, 
function () 
    if ( guiGetVisible ( GUIEditor_Window[1] )) then 
    guiSetVisible ( GUIEditor_Window[1] ,false ) 
    showCursor ( true ) 
        end 
    end 
) 

-- Server Side #

addEvent("Login",true) 
addEventHandler("Login",root, 
    function(player,userName,Password ) 
        local v = getAccount ( userName, Password ) 
            if ( v ~= true) then 
              if logIn ( player, v, Password ) == true then 
                outputChatBox ( "Login with account : [ " .. userName .. " ]", player, 255, 255, 0 , true ) 
                triggerClientEvent("onSpecialEvent",player) 
                fadeCamera(player,true) 
          else 
                outputChatBox("Error : In login",player,255,255,255,true) 
                end 
        end 
    end 
) 
  
function Join() 
fadeCamera(source,false) 
end 
addEventHandler("onPlayerJoin",root,Join) 

ملف سيرفر ضفت له اول ما يدخل الشاشه سودآء واذا سجل الدخول ترجع زي ماهي ذذ

الشاشه سوده

وكل شي

بس

مايسجل

دخول

؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟

[20:12:08] WARNING: 4\server.lua:6: Bad argument @ 'logIn' [Expected player at argument 1, got string 'A']

[20:12:08] WARNING: 4\server.lua:11: Bad argument @ 'outputChatBox' [Expected element at argument 2, got string 'A']

Link to comment

جرب كذا ,

addEvent("Login",true) 
addEventHandler("Login",root, 
    function( userName,Password ) 
        local v = getAccount ( userName, Password ) 
            if ( v ~= true) then 
               logIn ( client, v, Password ) 
                outputChatBox ( "Login with account : [ " .. userName .. " ]", client, 255, 255, 0 , true ) 
                triggerClientEvent("onSpecialEvent",client) 
                fadeCamera(source,true) 
          else 
                outputChatBox("Error : In login",client,255,255,255,true) 
        end 
    end 
) 
  
function Join() 
fadeCamera(source,false) 
end 
addEventHandler("onPlayerJoin",root,Join) 
Link to comment

بالنسبه للماوس , انا نبهتك اول انك حاط true ._.

خليه كذا ,

GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(208,154,568,231,"Login and Register",false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(11,20,548,202,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("login / register",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(73,31,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(256,11,5,5,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[1] = guiCreateEdit(25,51,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[2] = guiCreateEdit(25,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Button[1] = guiCreateButton(47,129,84,33,"register",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(408,167,57,16,"save",false,false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(73,77,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,255,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[3] = guiCreateEdit(366,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[4] = guiCreateEdit(366,50,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Label[4] = guiCreateLabel(421,29,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[4],255,255,0) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(420,76,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[5],255,255,0) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(392,131,84,33,"Login",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
bindKey ( "F2" , "down" , 
function() 
    guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) 
    showCursor(guiGetVisible(GUIEditor_Window[1])) 
    guiSetEnabled(guiGetVisible(GUIEditor_Window[1])) 
    end 
) 
  
addEventHandler ("onClientGUIClick", GUIEditor_Button[2], 
function() 
    triggerServerEvent("Login",localPlayer, guiGetText(GUIEditor_Edit[4]), guiGetText(GUIEditor_Edit[3])) 
end,false) 
  
addEvent ( "onSpecialEvent", true ) 
addEventHandler("onSpecialEvent",root, 
function () 
    if ( guiGetVisible ( GUIEditor_Window[1] )) then 
    guiSetVisible ( GUIEditor_Window[1] ,false ) 
    showCursor ( false ) 
        end 
    end 
) 

بالنسبه للسيرفر , اصلا انت قلت تبيه يسجل الدخول ,؟؟

واصلا الكود مافي تسجيل خير شر ذذ

Link to comment
بالنسبه للماوس , انا نبهتك اول انك حاط true ._.

خليه كذا ,

GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(208,154,568,231,"Login and Register",false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(11,20,548,202,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("login / register",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(73,31,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(256,11,5,5,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[1] = guiCreateEdit(25,51,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[2] = guiCreateEdit(25,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Button[1] = guiCreateButton(47,129,84,33,"register",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(408,167,57,16,"save",false,false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(73,77,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,255,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[3] = guiCreateEdit(366,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[4] = guiCreateEdit(366,50,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Label[4] = guiCreateLabel(421,29,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[4],255,255,0) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(420,76,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[5],255,255,0) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(392,131,84,33,"Login",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
bindKey ( "F2" , "down" , 
function() 
    guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) 
    showCursor(guiGetVisible(GUIEditor_Window[1])) 
    guiSetEnabled(guiGetVisible(GUIEditor_Window[1])) 
    end 
) 
  
addEventHandler ("onClientGUIClick", GUIEditor_Button[2], 
function() 
    triggerServerEvent("Login",localPlayer, guiGetText(GUIEditor_Edit[4]), guiGetText(GUIEditor_Edit[3])) 
end,false) 
  
addEvent ( "onSpecialEvent", true ) 
addEventHandler("onSpecialEvent",root, 
function () 
    if ( guiGetVisible ( GUIEditor_Window[1] )) then 
    guiSetVisible ( GUIEditor_Window[1] ,false ) 
    showCursor ( false ) 
        end 
    end 
) 

بالنسبه للسيرفر , اصلا انت قلت تبيه يسجل الدخول ,؟؟

واصلا الكود مافي تسجيل خير شر ذذ

حطيته

ومانفع

Link to comment

^ كيف ما نفع ذذ ؟

false = يعني ما بيظهر ._.

بالنسبه للتسجيل بدل ,

login(client,v,Password)

الى ,

addAccount ( userName, Password )

وجرب ,

ضيفه لقروب الادمن ذذ

مدري ليه تبيه يسجل ,

سوي ترايقر ثاني للتسجيل ,

ولا خلها تسجيل مع تسجيل دخول في كود واحد ذذ

Link to comment

جرب كذا ذذ ,

-- Client Side #

GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(208,154,568,231,"Login and Register",false) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(11,20,548,202,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("login / register",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(73,31,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(256,11,5,5,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[1] = guiCreateEdit(25,51,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[2] = guiCreateEdit(25,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Button[1] = guiCreateButton(47,129,84,33,"register",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Checkbox[1] = guiCreateCheckBox(408,167,57,16,"save",false,false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Checkbox[1],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(73,77,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,255,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Edit[3] = guiCreateEdit(366,93,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Edit[4] = guiCreateEdit(366,50,134,26,"",false,GUIEditor_Tab[1]) 
GUIEditor_Label[4] = guiCreateLabel(421,29,38,17,"user",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[4],255,255,0) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(420,76,38,17,"pass",false,GUIEditor_Tab[1]) 
guiLabelSetColor(GUIEditor_Label[5],255,255,0) 
guiSetFont(GUIEditor_Label[5],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(392,131,84,33,"Login",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
  
bindKey ( "F2" , "down" , 
function() 
    guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) 
    showCursor(guiGetVisible(GUIEditor_Window[1])) 
    guiSetEnabled(guiGetVisible(GUIEditor_Window[1])) 
    end 
) 
  
addEventHandler ("onClientGUIClick",root, 
function() 
    if source == GUIEditor_Button[2] then 
    triggerServerEvent("Login",localPlayer, guiGetText(GUIEditor_Edit[4]), guiGetText(GUIEditor_Edit[3])) 
    elseif source == GUIEditor_Button[1] then 
    triggerServerEvent("Register",localPlayer, guiGetText(GUIEditor_Edit[1]), guiGetText(GUIEditor_Edit[2])) 
        end 
    end 
) 
  
addEvent ( "onSpecialEvent", true ) 
addEventHandler("onSpecialEvent",root, 
function () 
    if ( guiGetVisible ( GUIEditor_Window[1] )) then 
    guiSetVisible ( GUIEditor_Window[1] ,false ) 
    showCursor ( false ) 
        end 
    end 
) 

-- Server Side #

addEvent("Login",true) 
addEventHandler("Login",root, 
    function( userName,Password ) 
        local v = getAccount ( userName, Password ) 
            if ( v ~= true) then 
               logIn(client,v,Password) 
                outputChatBox ( "Login with account : [ " .. userName .. " ]", client, 255, 255, 0 , true ) 
                triggerClientEvent("onSpecialEvent",client) 
                fadeCamera(source,true) 
          else 
                outputChatBox("Error : In login",client,255,255,255,true) 
        end 
    end 
) 
  
function Join() 
fadeCamera(source,false) 
end 
addEventHandler("onPlayerJoin",root,Join) 
  
addEvent("Register",true) 
addEventHandler("Register",root, 
function(userName,Password) 
   Add =  addAccount( user, pass ) 
      if Add ~= false then 
        outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source ) 
  else 
        outputChatBox ( "Error creating account, contact the server admin", source ) 
        end 
    end 
) 

ضيفه لقروب الادمن ذذ ,

resource.ResourceName

ResourceName = اسم المود ذذ,

Link to comment

في خطأ بملف سيرفر ما انتبهت له ذذ ,

addEvent("Login",true) 
addEventHandler("Login",root, 
    function( userName,Password ) 
        local v = getAccount ( userName, Password ) 
            if ( v ~= true) then 
               logIn(client,v,Password) 
                outputChatBox ( "Login with account : [ " .. userName .. " ]", client, 255, 255, 0 , true ) 
                triggerClientEvent("onSpecialEvent",client) 
                fadeCamera(source,true) 
          else 
                outputChatBox("Error : In login",client,255,255,255,true) 
        end 
    end 
) 
  
function Join() 
fadeCamera(source,false) 
end 
addEventHandler("onPlayerJoin",root,Join) 
  
addEvent("Register",true) 
addEventHandler("Register",root, 
function(user,pass) 
   Add =  addAccount( user, pass ) 
      if Add ~= false then 
        outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source ) 
  else 
        outputChatBox ( "Error creating account, contact the server admin", source ) 
        end 
    end 
) 
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...