Jump to content

طلب كود


Recommended Posts

اخوي عناد والله مافهمت شي من الروابط الي حطيتها تكفا اذا ماعليك امر اشرحلي انت

انا الحمد لله سويت الشوب كامل مابقي الا التسجيل وتسجيل الدخول وارسال الفلوس انا مابي الا التسجيل وخلاص ماتقصر :mrgreen:

Link to comment

-- Client Side

addEventHandler("onClientGUIClick",getRootElement(), 
    function() 
        if ( source == login/registerBTN) then 
                 triggerServerEvent("onLoginAndRegister",getRootElement(),getLocalPlayer(),guiGetText(user), guiGetText(pass)) 
          
     end) 
--[[ 
login/registerBTN =  زر التسجيل + الدخول في وظظيفة وحدة يعني يكفي زر واححد 
user = خآنة اليوزر نيم 
pass = خانة الباس ورد 
]] 

-- Server Side

function LoginAndRegister ( player, user, pass ) 
    local account = getAccount ( user, pass ) 
    if ( account ~= false ) then 
        if (logIn ( player, account, pass ) == true) then 
        else 
             outputChatBox ( "* Login Error !", player, 255, 0, 0 ) 
        end 
    else 
        account = addAccount ( user, pass ) 
        if (logIn ( player, account, pass ) == true) then 
        outputChatBox ( "Register Details : [ Username ] : #00FF00" .. user .. " #FFFF1A[ Password ] : #00FF00" .. pass .. "", player, 255, 255, 0 , true )  
        else 
            outputChatBox ( "Register Error!", player, 255, 255, 0 ) 
  
        end 
    end 
end 
addEvent( "onLoginAndRegister", true ) 
addEventHandler( "onLoginAndRegister", getRootElement(), LoginAndRegister ) 

إذا فيه أخخططآء تفضضل و قول بأي سسطر

Edited by Guest
Link to comment

--server side--

function on4XLogin ( player, user, pass ) 
    local account = getAccount ( user, pass ) 
    if ( account ~= false ) then 
        if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... 
            logOut ( player ) -- Log them out. 
        end 
         
        if (logIn ( player, account, pass ) == true) then 
            triggerClientEvent ( player, "hideLoginWindow", getRootElement()) 
        else 
            outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. 
        end 
    else 
        outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. 
    end 
end 
addEvent( "on4XLogin", true ) 
addEventHandler( "on4XLogin", getRootElement(), on4XLogin ) 
  
function on4XRegister ( player, user, pass, name ) 
    local account = getAccount ( user, pass ) 
    if ( account ~= false ) then 
        if (logIn ( player, account, pass ) == true) then 
            triggerClientEvent ( player, "hideLoginWindow", getRootElement()) 
        else 
            outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. 
        end 
    else 
        account = addAccount ( user, pass ) 
        setAccountData ( account, "name", name) 
        if (logIn ( player, account, pass ) == true) then 
            triggerClientEvent ( player, "hideLoginWindow", getRootElement()) 
        else 
            outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. 
        end 
    end 
end 
addEvent( "on4XRegister", true ) 
addEventHandler( "on4XRegister", getRootElement(), on4XRegister ) 
  
function needVars() 
    local allow_register = get("allow_register") 
    local name_on_register = get("name_on_register") 
    triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, name_on_register) 
end 
addEvent("onNeedVars", true) 
addEventHandler("onNeedVars", getRootElement(), needVars) 

لما تحط ألأكواد راح تلاقي 3 اسطر الاول الاسم الثاني الباس الثالث الاسم مره ثانيه بنسبه لزر يقبل التسجيل وتسجيل الدخول

---client side---

  
  
LblRegisterUsername = guiCreateLabel(10,4,150,16,"Username:",false,tab5)--غير التاب لكل الأسطر 
EditRegisterUsername = guiCreateEdit(46,22,171,21,"",false,tab5) 
LblRegisterPassword = guiCreateLabel(10,44,150,16,"Password:",false,tab5) 
EditRegisterPassword = guiCreateEdit(46,61,171,21,"",false,tab5) 
guiEditSetMasked(EditRegisterPassword,true) 
LblRegisterName = guiCreateLabel(10,83,150,16,"agin Name:",false,tab5) 
EditRegisterName = guiCreateEdit(46,100,171,21,"",false,tab5) 
  
BtnAction = guiCreateButton(0,180,260,25,"Login/Register",false,tab5) 
  
--ربط الأزرار-- 
  
  
local localPlayer = getLocalPlayer() 
  
function receiveVars( allow, name) 
  
    local playername = getPlayerName(localPlayer) 
     
    guiSetText(LoginUsername, "") 
    guiSetText(EditRegisterUsername, "") 
     
    if (name == "false") then 
        guiSetVisible(LblRegisterName, false) 
        guiSetVisible(EditRegisterName, false) 
    end 
     
    if (allow == "false") then 
        guiDeleteTab(TabRegister, TabPanel) 
    end 
     
    guiSetSelectedTab(TabPanel, TabLogin) 
    guiSetText(LoginUsername, playername) 
    guiSetText(EditRegisterUsername, playername) 
  
    guiSetVisible(LoginWin, true) 
    guiBringToFront(LoginWin) 
     
    guiSetInputEnabled(true) 
    showCursor(true) 
end 
addEvent( "onSendVars", true ) 
addEventHandler( "onSendVars", getRootElement(), receiveVars ) 
  
function windowHandler() 
    triggerServerEvent("onNeedVars", getLocalPlayer()) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) 
  
function onClickBtn(button, state) 
    if(button == "left" and state == "up") then 
        if(source == BtnAction) then 
            if(guiGetSelectedTab(TabPanel) == TabLogin) then 
                triggerServerEvent("on4XLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword)) 
            else 
                triggerServerEvent("on4XRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword), guiGetText(EditRegisterName)) 
            end 
        end 
    end 
end 
  
function hideLoginWindow() 
    guiSetInputEnabled(false) 
    guiSetVisible(LoginWin, false) 
end 
  
addEvent("hideLoginWindow", true) 
addEventHandler("onClientGUIClick", BtnAction, onClickBtn, false) 
addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) 
  

Link to comment

والله شوف انا ماسويت موضوع من قبل ومسوي الشوب كامل الحمد لله بس باقيلي كود التسجيل وتسجيل الدخول

كود ارسال الفلوس الحمد لله خلصته باقيلي ذا الكود تكفون مساعدتكم:):D

Link to comment

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

ممكن تعدل عليه لاهنت؟

Link to comment

يب الي قبل فيه عطل جرب ذا تابين

--client side--

  
----------------------------------------------- 
tab5 = guiCreateTab("Login",tabPanel) 
------------------------------------------------ 
LoginUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab5) 
guiSetAlpha(LoginUsername,1) 
LoginPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab5) 
guiSetAlpha(LoginPassword,1) 
guiEditSetMasked ( LoginPassword, true ) 
GUIEditor_Label[2] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab5) 
guiSetAlpha(GUIEditor_Label[2],1) 
guiLabelSetColor(GUIEditor_Label[2],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab5) 
guiSetAlpha(GUIEditor_Label[3],1) 
guiLabelSetColor(GUIEditor_Label[3],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
guiSetAlpha(GUIEditor_Label[4],1) 
guiLabelSetColor(GUIEditor_Label[4],255,150,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) 
guiSetFont(GUIEditor_Label[4],"clear-normal") 
GUIEditor_Label[5] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welcome in server Please Login",true,tab5) 
guiSetAlpha(GUIEditor_Label[5],1) 
guiLabelSetColor(GUIEditor_Label[5],255,150,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false) 
guiSetFont(GUIEditor_Label[5],"clear-normal") 
GUIEditor_Button[1] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Login!",true,tab5) 
guiSetAlpha(GUIEditor_Button[1],1) 
--------------------- 
tab6 = guiCreateTab("Register",tabPanel) 
--------------------- 
EditRegisterUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab6) 
guiSetAlpha(EditRegisterUsername,1) 
EditRegisterPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab6) 
guiEditSetMasked ( EditRegisterPassword, true ) 
guiSetAlpha(EditRegisterPassword,1) 
GUIEditor_Label[6] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab6) 
guiSetAlpha(GUIEditor_Label[6],1) 
guiLabelSetColor(GUIEditor_Label[6],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Label[7] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab6) 
guiSetAlpha(GUIEditor_Label[7],1) 
guiLabelSetColor(GUIEditor_Label[7],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[7],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false) 
guiSetFont(GUIEditor_Label[7],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Register!",true,tab6) 
guiSetAlpha(GUIEditor_Button[2],1) 
GUIEditor_Label[4] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welome in Server Please Register",true,tab6) 
  
-----------------------------ربط الازراربلأوامر---------------- 
  
  
local localPlayer = getLocalPlayer ( ) 
  
function windowHandler( ) 
    local playername = getPlayerName(localPlayer) 
     
    guiSetText(LoginUsername, "") 
    guiSetText(EditRegisterUsername, "") 
  
    guiSetText(LoginUsername, playername) 
    guiSetText(EditRegisterUsername, playername) 
  
  
    guiSetInputEnabled(true) 
    showCursor ( false) 
end 
  
function onClickBtn ( button, state ) 
    if (source == GUIEditor_Button[1]) then 
        triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) ) 
    end 
end 
  
function onClickBtn2 ( button, state ) 
    if (source == GUIEditor_Button[2]) then 
        triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword)) 
    end 
end 
  
  
function hideLoginWindow() 
    guiSetInputEnabled(false) 
    showCursor ( false ) 
end 
addEvent( "hideLoginWindow", true ) 
addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) 
  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) 
  
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false ) 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], onClickBtn2, false ) 
  

--server side--

  
  
function onLogin ( player, user, pass ) 
    local account = getAccount ( user, pass ) 
    if ( account ~= false ) then 
        if (logIn ( player, account, pass ) == true) then 
            triggerClientEvent ( "hideLoginWindow", getRootElement()) 
        else 
            outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. 
        end 
    else 
        outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. 
    end 
end 
  
addEvent( "onLogin", true ) 
addEventHandler( "onLogin", getRootElement(), onLogin ) 
  
function onRegister ( player, user, pass ) 
    local account = getAccount ( user, pass ) 
    if ( account ~= false ) then 
        if (logIn ( player, account, pass ) == true) then 
            triggerClientEvent ( "hideLoginWindow", getRootElement()) 
        else 
            outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. 
        end 
    else 
        account = addAccount ( user, pass ) 
        if (logIn ( player, account, pass ) == true) then 
            triggerClientEvent ( "hideLoginWindow", getRootElement()) 
        else 
            outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. 
        end 
    end 
end 
  
addEvent( "onRegister", true ) 
addEventHandler( "onRegister", getRootElement(), onRegister ) 

اي خطأ يصادفك طرحه وبصلحه

Link to comment
tab5 = guiCreateTab("Login",tabPanel) 

tabPanel = اسم التاب الرئيسي حقك

انا كتبتها كذا

  
----------------------------------------------- 
tab5 = guiCreateTab("Login",tabPanel) 
------------------------------------------------ 
LoginUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab5) 
guiSetAlpha(LoginUsername,1) 
LoginPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab5) 
guiSetAlpha(LoginPassword,1) 
guiEditSetMasked ( LoginPassword, true ) 
GUIEditor_Label[2] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab5) 
guiSetAlpha(GUIEditor_Label[2],1) 
guiLabelSetColor(GUIEditor_Label[2],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab5) 
guiSetAlpha(GUIEditor_Label[3],1) 
guiLabelSetColor(GUIEditor_Label[3],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
guiSetAlpha(GUIEditor_Label[4],1) 
guiLabelSetColor(GUIEditor_Label[4],255,150,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) 
guiSetFont(GUIEditor_Label[4],"clear-normal") 
GUIEditor_Label[5] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welcome in server Please Login",true,tab5) 
guiSetAlpha(GUIEditor_Label[5],1) 
guiLabelSetColor(GUIEditor_Label[5],255,150,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false) 
guiSetFont(GUIEditor_Label[5],"clear-normal") 
GUIEditor_Button[1] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Login!",true,tab5) 
guiSetAlpha(GUIEditor_Button[1],1) 
--------------------- 
tab6 = guiCreateTab("Register",tabPanel) 
--------------------- 
EditRegisterUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab6) 
guiSetAlpha(EditRegisterUsername,1) 
EditRegisterPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab6) 
guiEditSetMasked ( EditRegisterPassword, true ) 
guiSetAlpha(EditRegisterPassword,1) 
GUIEditor_Label[6] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab6) 
guiSetAlpha(GUIEditor_Label[6],1) 
guiLabelSetColor(GUIEditor_Label[6],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false) 
guiSetFont(GUIEditor_Label[6],"default-bold-small") 
GUIEditor_Label[7] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab6) 
guiSetAlpha(GUIEditor_Label[7],1) 
guiLabelSetColor(GUIEditor_Label[7],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[7],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false) 
guiSetFont(GUIEditor_Label[7],"default-bold-small") 
GUIEditor_Button[2] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Register!",true,tab6) 
guiSetAlpha(GUIEditor_Button[2],1) 
GUIEditor_Label[4] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welome in Server Please Register",true,tab6) 
  

Link to comment

ططيب التاب الرئيسي وينه ؟

tab5 = guiCreateTab("Login",tabPanel) 

tabPanel الأرقومنت الأخخير

هذآ يعني أن الشيء اللي بـ تصنعه رآحح يكون داخله

tabPanel لككن انت مآ صنعت الـ

عششآن تجي الأكواد داخله

Link to comment
ططيب التاب الرئيسي وينه ؟
tab5 = guiCreateTab("Login",tabPanel) 

tabPanel الأرقومنت الأخخير

هذآ يعني أن الشيء اللي بـ تصنعه رآحح يكون داخله

tabPanel لككن انت مآ صنعت الـ

عششآن تجي الأكواد داخله

فهمني كيف اصنه الـــtabPanel؟

Link to comment

إخختصآر لـ نآفذة أو ششيء tabPanel هذآ

وانت نآسخه والمفروض تاخذه كآمل لأن كذآ بيجيكـ أخطاء

Gui Editor و لكن من الأفضضل انكـ تعمل لوحآت عن طريق سكربت

و تبدأ تطبق عليه الأكواد فتح اللوحة إظهار الماوس عند الضغط .. و إلخخ

Link to comment
إخختصآر لـ نآفذة أو ششيء tabPanel هذآ

وانت نآسخه والمفروض تاخذه كآمل لأن كذآ بيجيكـ أخطاء

Gui Editor و لكن من الأفضضل انكـ تعمل لوحآت عن طريق سكربت

و تبدأ تطبق عليه الأكواد فتح اللوحة إظهار الماوس عند الضغط .. و إلخخ

اها توني فهمت عليك

انا مسوي تاب من قبل login و register

وافتح الشوب عادي تجي النوافذ

لاكن الاكواد الي نكتب فيها رقم التاب الي حطها حسون

اذا حطيتها مايفتح الشوب

واذا مسحتها يفتح الشوب

Link to comment
اها توني فهمت عليك

انا مسوي تاب من قبل login و register

وافتح الشوب عادي تجي النوافذ

لاكن الاكواد الي نكتب فيها رقم التاب الي حطها حسون

اذا حطيتها مايفتح الشوب

واذا مسحتها يفتح الشوب

سو لوححات عن ططريق ذا

https://community.multitheftauto.com/ind ... ils&id=141

Link to comment
اها توني فهمت عليك

انا مسوي تاب من قبل login و register

وافتح الشوب عادي تجي النوافذ

لاكن الاكواد الي نكتب فيها رقم التاب الي حطها حسون

اذا حطيتها مايفتح الشوب

واذا مسحتها يفتح الشوب

سو لوححات عن ططريق ذا

https://community.multitheftauto.com/ind ... ils&id=141

شكراااااااا على المود والله حلو + سهل :mrgreen:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...