Jump to content

حل كود


Recommended Posts

تكفون ابي حل للكود

addEvent("onSendMoney", true) 
addEventHandler("onSendMoney", getRootElement(), 
 function(who, player) 
   local money = getPlayerMoney(source) 
    if tonumber(player) >= 200 then 
        if tonumber(player) <= money then 
            toWho = getPlayerFromName(who) 
                if toWho ~= false then 
                    givePlayerMoney(toWho, player) 
                    takePlayerMoney(source, player) 
                    name = getPlayerName(source) 
                    outputChatBox("* You have given money amount of: #00ff00$" .. player .. " #0099ccto: #ff0000" .. who, source, 0, 150, 255, true) 
                    outputChatBox("* ".. name .. " #ff0000has given you money amount of: #00ff00$" .. player .. " #ff0000!", toWho, 255, 0, 0, true) 
                else 
                    outputChatBox("* Player did not exist !", source, 255, 0, 0) 
                end 
        else 
            outputChatBox("* you dont have enough money !", source, 255, 0, 0) 
        end 
    else 
        outputChatBox("* the Less amount must be #00ff00$200 !", source, 255, 0, 0) 
    end 
 end 
) 
  

Link to comment
  
GUIEditor = { 
    tabpanel = {}, 
    tab = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        shopWindow = guiCreateWindow(224, 129, 442, 389, "shop send", false) 
        guiSetVisible (shopWindow, false) 
        guiWindowSetSizable(shopWindow, false) 
        guiSetAlpha(shopWindow, 1.00) 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 21, 424, 359, false, shopWindow) 
  
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
  
  
setTimer( 
    function() 
        playerList = guiCreateGridList(8, 8, 154, 322, false, GUIEditor.tab[1]) 
        guiGridListSetSelectionMode(playerList, 2) 
        local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) 
             if ( cl and guiGetVisible(shopWindow) == true ) then 
             for _,name in ipairs(getElementsByType("player")) do 
                          local rw = guiGridListAddRow(playerList) 
                     guiGridListSetItemText(playerList, rw, cl, getPlayerName(name), false, false) 
                    end 
        addEventHandler("onClientGUIClick", playerList, onClickPlayerName) 
                end 
    end 
,4000,0) 
guiLabelSetColor(ii,255,0,0) 
function onClickPlayerName () 
  local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) 
  guiSetText(nameEdit, name) 
end 
addEventHandler("onClientGUIClick",getRootElement(), 
function() 
       if ( source == sendBTN ) then 
         playerNick = guiGetText(nameEdit) 
         amount = guiGetText(amountEdit) 
         triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) 
       end 
end)  
  
function onClickPlayerName () 
  local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) 
  guiSetText(nameEdit, name) 
end 
  
addEventHandler("onClientGUIClick",getRootElement(), 
function() 
       if ( source == sendBTN ) then 
         playerNick = guiGetText(nameEdit) 
         amount = guiGetText(amountEdit) 
         triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) 
       end 
end) 
        nameEdit = guiCreateEdit(211, 115, 165, 35, "", false, GUIEditor.tab[1]) 
        amountEdit = guiCreateEdit(211, 169, 165, 35, "", false, GUIEditor.tab[1]) 
        sendBTN = guiCreateButton(213, 226, 102, 39, "send", false, GUIEditor.tab[1])     
    end 
) 
  
------------------------- 
guiSetVisible(shopWindow,false) 
bindKey ( "F2" , "down" , function() 
  
if ( guiGetVisible ( shopWindow ) == true ) then 
 guiSetVisible ( shopWindow ,false ) 
 showCursor (false ) 
 guiSetInputEnabled(false) 
  
 elseif ( guiGetVisible ( shopWindow ) == false ) then 
 guiSetVisible ( shopWindow ,true ) 
 showCursor (false ) 
 guiSetInputEnabled(true) 
 end 
 end 
 ) 

طيب

Link to comment

GUIEditor = { 
    tabpanel = {}, 
    tab = {} 
} 
  
        shopWindow = guiCreateWindow(224, 129, 442, 389, "shop send", false) 
        guiSetVisible (shopWindow, false) 
        guiWindowSetSizable(shopWindow, false) 
        guiSetAlpha(shopWindow, 1.00) 
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 21, 424, 359, false, shopWindow) 
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
        nameEdit = guiCreateEdit(211, 115, 165, 35, "", false, GUIEditor.tab[1]) 
        amountEdit = guiCreateEdit(211, 169, 165, 35, "", false, GUIEditor.tab[1]) 
        sendBTN = guiCreateButton(213, 226, 102, 39, "send", false, GUIEditor.tab[1])  
  
setTimer( 
    function() 
        playerList = guiCreateGridList(8, 8, 154, 322, false, GUIEditor.tab[1]) 
        guiGridListSetSelectionMode(playerList, 2) 
        local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) 
             if ( cl and guiGetVisible(shopWindow) == true ) then 
             for _,name in ipairs(getElementsByType("player")) do 
                          local rw = guiGridListAddRow(playerList) 
                     guiGridListSetItemText(playerList, rw, cl, getPlayerName(name), false, false) 
                    end 
        addEventHandler("onClientGUIClick", playerList, onClickPlayerName) 
                end 
    end 
,4000,0) 
  
function onClickPlayerName () 
  local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) 
  guiSetText(nameEdit, name) 
end 
  
function onClickPlayerName () 
  local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) 
  guiSetText(nameEdit, name) 
end 
  
addEventHandler("onClientGUIClick",sendBTN, 
function() 
         triggerServerEvent("onSendMoney", getLocalPlayer(), guiGetText(nameEdit), guiGetText(amountEdit)) 
    end,false 
) 
  
  
bindKey ( "F2" , "down" , function() 
    guiSetVisible(shopWindow,not guiGetVisible(shopWindow)) 
    showCursor(not isCursorShowing()) 
    end 
) 
Link to comment

معليش بس فيه كود عندي بعد فيه نفس الخطاء

  
GUIEditor = { 
    tab = {}, 
    tabpanel = {}, 
    edit = {}, 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(202, 153, 413, 387, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible (GUIEditor.window[1], false) 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 395, 356, false, GUIEditor.window[1]) 
  
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
  
        GUIEditor.button[1] = guiCreateButton(59, 237, 114, 41, "تسجيل الدخول", false, GUIEditor.tab[1]) 
        GUIEditor.button[2] = guiCreateButton(222, 237, 114, 41, "تسجيل ", false, GUIEditor.tab[1]) 
        GUIEditor.edit[1] = guiCreateEdit(94, 129, 189, 36, "", false, GUIEditor.tab[1]) 
        GUIEditor.edit[2] = guiCreateEdit(94, 185, 141, 36, "", false, GUIEditor.tab[1])     
    end 
) 
  
  
bindKey ( "F2" , "down" , function() 
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
    showCursor(not isCursorShowing()) 
    end 
) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  GUIEditor.button[1] ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    elseif ( source ==  GUIEditor.button[2] ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    end 
end 
) 
  
  

^هذا الكلينت^

  
  
addEvent("onlogin",true) 
addEventHandler("onlogin",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            logIn(source,account,pass) 
        else 
            outputChatBox("* Worng Username Or Password",source,255,0,0) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            outputChatBox("* This Account is Already Used",source,255,0,0) 
        else 
            addAccount(user,pass) 
            outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        end 
    end 
) 

^هذا سيرفر^

بس ابي اعرف وش المشكله

Link to comment
معليش بس فيه كود عندي بعد فيه نفس الخطاء
  
GUIEditor = { 
    tab = {}, 
    tabpanel = {}, 
    edit = {}, 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(202, 153, 413, 387, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible (GUIEditor.window[1], false) 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 395, 356, false, GUIEditor.window[1]) 
  
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
  
        GUIEditor.button[1] = guiCreateButton(59, 237, 114, 41, "تسجيل الدخول", false, GUIEditor.tab[1]) 
        GUIEditor.button[2] = guiCreateButton(222, 237, 114, 41, "تسجيل ", false, GUIEditor.tab[1]) 
        GUIEditor.edit[1] = guiCreateEdit(94, 129, 189, 36, "", false, GUIEditor.tab[1]) 
        GUIEditor.edit[2] = guiCreateEdit(94, 185, 141, 36, "", false, GUIEditor.tab[1])     
    end 
) 
  
  
bindKey ( "F2" , "down" , function() 
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
    showCursor(not isCursorShowing()) 
    end 
) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  GUIEditor.button[1] ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    elseif ( source ==  GUIEditor.button[2] ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    end 
end 
) 
  
  

^هذا الكلينت^

  
  
addEvent("onlogin",true) 
addEventHandler("onlogin",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            logIn(source,account,pass) 
        else 
            outputChatBox("* Worng Username Or Password",source,255,0,0) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            outputChatBox("* This Account is Already Used",source,255,0,0) 
        else 
            addAccount(user,pass) 
            outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        end 
    end 
) 

^هذا سيرفر^

بس ابي اعرف وش المشكله

جرب

  
GUIEditor = { 
    tab = {}, 
    tabpanel = {}, 
    edit = {}, 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(202, 153, 413, 387, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible (GUIEditor.window[1], false) 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 395, 356, false, GUIEditor.window[1]) 
  
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
  
        GUIEditor.button[1] = guiCreateButton(59, 237, 114, 41, "تسجيل الدخول", false, GUIEditor.tab[1]) 
        GUIEditor.button[2] = guiCreateButton(222, 237, 114, 41, "تسجيل ", false, GUIEditor.tab[1]) 
        GUIEditor.edit[1] = guiCreateEdit(94, 129, 189, 36, "", false, GUIEditor.tab[1]) 
        GUIEditor.edit[2] = guiCreateEdit(94, 185, 141, 36, "", false, GUIEditor.tab[1])     
    end 
) 
  
  
bindKey ( "F2" , "down" , function() 
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
    showCursor(not isCursorShowing()) 
    end 
) 
 guiSetText(GUIEditor.edit[1],"user") 
 guiSetText(GUIEditor.edit[2],"pass") 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  GUIEditor.button[1] ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    elseif ( source ==  GUIEditor.button[2] ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    end 
end 
) 
  
  

Link to comment

-- Client Side # 
GUIEditor = { 
    tab = {}, 
    tabpanel = {}, 
    edit = {}, 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(202, 153, 413, 387, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible (GUIEditor.window[1], false) 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 395, 356, false, GUIEditor.window[1]) 
  
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
  
        GUIEditor.button[1] = guiCreateButton(59, 237, 114, 41, "تسجيل الدخول", false, GUIEditor.tab[1]) 
        GUIEditor.button[2] = guiCreateButton(222, 237, 114, 41, "تسجيل ", false, GUIEditor.tab[1]) 
        GUIEditor.edit[1] = guiCreateEdit(94, 129, 189, 36, "", false, GUIEditor.tab[1]) 
        GUIEditor.edit[2] = guiCreateEdit(94, 185, 141, 36, "", false, GUIEditor.tab[1])     
    end 
) 
  
  
addEventHandler ("onClientGUIClick", root, 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  GUIEditor.button[1] ) then 
        triggerServerEvent("onlogin",localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    elseif ( source ==  GUIEditor.button[2] ) then 
        triggerServerEvent("onregister",localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
        end 
    end 
) 
  
bindKey ( "F2" , "down" , function() 
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
    showCursor(not isCursorShowing()) 
    end 
) 
  
addEvent('CloseAll',true) 
addEventHandler('CloseAll',root,function() 
    if guiGetVisible(GUIEditor.window[1]) then 
        guiSetVisible(GUIEditor.window[1],false) showCursor(false) 
        end 
    end 
) 

-- Server Side # 
addEvent("onlogin",true) 
addEventHandler("onlogin",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            logIn(source,account,pass) 
                triggerClientEvent(source,'CloseAll',source) 
        else 
            outputChatBox("* Worng Username Or Password",source,255,0,0) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            outputChatBox("* This Account is Already Used",source,255,0,0) 
        else 
            addAccount(user,pass) 
            outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        end 
    end 
) 
Link to comment
GUIEditor = { 
    tab = {}, 
    tabpanel = {}, 
    edit = {}, 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(202, 153, 413, 387, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible (GUIEditor.window[1], false) 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 395, 356, false, GUIEditor.window[1]) 
  
        GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) 
  
        GUIEditor.button[1] = guiCreateButton(59, 237, 114, 41, "تسجيل الدخول", false, GUIEditor.tab[1]) 
        GUIEditor.button[2] = guiCreateButton(222, 237, 114, 41, "تسجيل ", false, GUIEditor.tab[1]) 
        GUIEditor.edit[1] = guiCreateEdit(94, 129, 189, 36, "", false, GUIEditor.tab[1]) 
        GUIEditor.edit[2] = guiCreateEdit(94, 185, 141, 36, "", false, GUIEditor.tab[1])     
    end 
) 
  
  
addEventHandler ("onClientGUIClick", root, 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  GUIEditor.button[1] ) then 
        triggerServerEvent("onlogin",localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
    elseif ( source ==  GUIEditor.button[2] ) then 
        triggerServerEvent("onregister",localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) 
        end 
    end 
) 
  
bindKey ( "F2" , "down" , function() 
    guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) 
    showCursor(not isCursorShowing()) 
    end 
) 
  
addEvent('CloseAll',true) 
addEventHandler('CloseAll',root,function() 
    if guiGetVisible(GUIEditor.window[1]) then 
        guiSetVisible(GUIEditor.window[1],false) showCursor(false) 
        end 
    end 
) 

^كلينت^

addEvent("onlogin",true) 
addEventHandler("onlogin",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            logIn(source,account,pass) 
                triggerClientEvent(source,'CloseAll',source) 
        else 
            outputChatBox("* Worng Username Or Password",source,255,0,0) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            outputChatBox("* This Account is Already Used",source,255,0,0) 
        else 
            addAccount(user,pass) 
            outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        end 
    end 
) 

^سيرفر^

Link to comment
    addEvent("onlogin",true) 
    addEventHandler("onlogin",getRootElement(), 
        function (user,pass) 
            local account = getAccount(user,pass) 
            if ( account ) then 
                logIn(source,account) 
                    triggerClientEvent(source,'CloseAll',source) 
            else 
                outputChatBox("* Worng Username Or Password",source,255,0,0) 
            end 
        end 
    ) 
      
    addEvent("onregister",true) 
    addEventHandler("onregister",getRootElement(), 
        function (user,pass) 
            local account = getAccount(user,pass) 
            if ( account ) then 
                outputChatBox("* This Account is Already Used",source,255,0,0) 
            else 
                addAccount(user,pass) 
                outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
            end 
        end 
    ) 

جرب

^ سيرفر

Link to comment

-- Server Side # 
addEvent("onlogin",true) 
addEventHandler("onlogin",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            logIn(source,account,pass) 
                triggerClientEvent(source,'CloseAll',source) 
        else 
            outputChatBox("* Worng Username Or Password",source,255,0,0) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if not ( account ) then 
            addAccount(user,pass) 
                outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        else 
                outputChatBox("* This Account is Already Used",source,255,0,0) 
        end 
    end 
) 
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...