Jump to content

طلب مساعدة في البرمجة


Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

طيب ممكن سؤال اخوي كيف اسوي ملف سيرفر ووش فادته ؟؟

:):):):):):):):)

client - server

نفس الشيء

بس الاختلاف مابينهم انه

الوظايف في بعض الاحيان

تجي كلنت فقط

وفي بعض الاحيان تجي سيرفر فقط

وفي بعض الاحيان تصلح للكلنت والسيرفر

Link to comment

يعطيكم ربي الف الف الف

عافية

لعناد وذا بيست وكل من ساعدني بالمواضيع السابقة

على تعليمي

والحين الحمدلله صرت فاهم كل شي

بس في بعض الاكواد مو فاهمها

واخر طلب يا حلوين اذا ممكن

لوحة ارسال الفلوس كيف اخلي اسماء لاعبين بالاوان

يعني مثلا موجود انا وعناد وكنق عبادي بلوحة

انا اسمي برتقالي عناد احمر كنق عبادي اصفر وما ابيها الوان غامقة لاهنتم

طبعاً للجريد لست

Link to comment

التلوين يكون بهذه الفنكشن

guiGridListSetItemColor ( gاسم الجريد لست, rاسم السطر, cاسم العامود, rالون الأحمر, gالون الأخضر, bالون الأزرق ) 

الون يكون من 0 الى 255

مثال

local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- تسوي جريد لست 
local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- تضيف عامود 
for id, player in ipairs(getElementsByType("player")) do -- تجيب كل الاعبين 
local row = guiGridListAddRow ( playerList ) -- تضيف سطور جديدة على عدد الاعبين 
guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) -- تضيف اسماء الاعبين في الجريد لست على العامود والسطر الي سويته 
guiGridListSetItemColor ( playerList, row, column, math.random(255), math.random(255), math.random(255) ) -- تلون الجريد لست على العامود والسطر الي سويته بألوان عشوائية 
end -- تقفل لوب الاعبين 

Link to comment

اخوي سويت مو ارسال الفلوس ليش ما اشتغل

client --

wnd = guiCreateWindow(163,53,458,518,"",false) 
grid = guiCreateGridList(11,24,246,485,false,wnd) 
guiGridListSetSelectionMode(grid,2) 
  
guiGridListAddColumn(grid,"Player",0.2) 
  
for i = 1, 1 do 
    guiGridListAddRow(grid) 
end 
GUIEditor_Label[1] = guiCreateLabel(261,218,28,15,"TO :",false,wnd) 
guiLabelSetColor(GUIEditor_Label[1],0,255,15) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(259,252,42,17,"MONEY :",false,wnd) 
guiLabelSetColor(GUIEditor_Label[2],0,255,15) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
Edit2 = guiCreateEdit(292,215,149,23,"",false,wnd) 
Edit1 = guiCreateEdit(308,246,127,24,"",false,wnd) 
Button = guiCreateButton(261,278,180,51,"SEND \ ارسال",false,wnd) 
GUIEditor_Image[1] = guiCreateStaticImage(273,33,162,163,"images/games.png",false,wnd) 
GUIEditor_Label[3] = guiCreateLabel(288,494,164,19,"Send Money By 7ASSAN v1.1",false,wnd) 
guiLabelSetColor(GUIEditor_Label[3],0,255,15) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
  
  
  
  
  
  
function list() 
    guiGridListClear(grid) 
    for id, players in ipairs (getElementsByType("player")) do 
        local column = guiGridListAddColumn( grid, "Player",0.2 ) 
        local row = guiGridListAddRow(grid) 
        guiGridListSetItemText(grid, row, 1, getPlayerName(players), false, false) 
        guiGridListSetItemColor ( grid, row, 1, 0, 250, 154, 255 ) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, list) 
addEventHandler("onClientPlayerJoin", getRootElement(), list) 
addEventHandler("onClientPlayerQuit", getRootElement(), list) 
addEventHandler("onClientPlayerChangeNick", getRootElement(), list) 
  
  
addEventHandler ( "onClientGUIClick", root, 
function () 
if source == Button then -- اسم الزر , اذا مب نفسه استبدله بالموجود 
local name = guiGridListGetItemText(grid, guiGridListGetSelectedItem(grid), 1) 
local amount = guiGetText (Edit1) -- استبدله بالايدت الموجود عندك 
triggerServerEvent( "GiveMoney", getLocalPlayer ( ), name, amount ) 
end 
end) 
bindKey("F6","down",Toggle) 

server --

addEvent("GiveMoney", true) 
addEventHandler("onSendMoney", getRootElement(), 
 function(hassan, player) 
   local money = getPlayerMoney(source) 
    if tonumber(player) >= 200 then 
        if tonumber(player) <= money then 
            tohassan = getPlayerFromName(hassan) 
                if tohassan ~= false then 
                    givePlayerMoney(tohassan, player) 
                    takePlayerMoney(source, player) 
                    name = getPlayerName(source) 
                    exports.killmessages:outputMessage("* You have given money amount of: " .. player .. " : " .. hassan, source, 0, 150, 255, true) 
                    exports.killmessages:outputMessage("* ".. name .. "  given you money amount of: $" .. player .. " ", tohassan, 255, 0, 0, true) 
                else 
                    exports.killmessages:outputMessage("* Player did not exist !", source, 255, 0, 0) 
                end 
        else 
            exports.killmessages:outputMessage("* you dont have enough money !", source, 255, 0, 0) 
        end 
    else 
        exports.killmessages:outputMessage("* the Less amount must be $200 !", source, 255, 0, 0) 
    end 
 end 
) 
  

يوم اشغل المود يطلع بوجهي الشاشة وما فيها ولا زر فيها جريبد لست فاضي

Link to comment

جرب كذا,

-- Client Side #

wnd = guiCreateWindow(163,53,458,518,"",false) 
lbl_TO = guiCreateLabel(261,218,28,15,"TO :",false,wnd) 
guiLabelSetColor(lbl_TO,0,255,15) 
guiSetFont(lbl_TO,"default-bold-small") 
lbl_MONEY = guiCreateLabel(259,252,42,17,"MONEY :",false,wnd) 
guiLabelSetColor(lbl_MONEY,0,255,15) 
guiSetFont(lbl_MONEY,"default-bold-small") 
Edit2 = guiCreateEdit(292,215,149,23,"",false,wnd) 
Edit1 = guiCreateEdit(308,246,127,24,"",false,wnd) 
Button = guiCreateButton(261,278,180,51,"SEND \ ارسال",false,wnd) 
img_GAMES = guiCreateStaticImage(273,33,162,163,"images/games.png",false,wnd) 
lbl_BY = guiCreateLabel(288,494,164,19,"Send Money By 7ASSAN v1.1",false,wnd) 
guiLabelSetColor(lbl_BY,0,255,15) 
guiSetFont(lbl_BY,"default-bold-small") 
  
-- outside 
  
grid = guiCreateGridList(11,24,246,485,false,wnd) 
guiGridListSetSelectionMode(grid,2) 
guiGridListAddColumn(grid,"Player",0.80) 
  
function list() 
    guiGridListClear(grid) 
    for id, players in ipairs (getElementsByType("player")) do 
        local row = guiGridListAddRow(grid) 
        guiGridListSetItemText(grid, row, 1, getPlayerName(players), false, false) 
        guiGridListSetItemColor ( grid, row, 1, 0, 250, 154, 255 ) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, list) 
addEventHandler("onClientPlayerJoin", getRootElement(), list) 
addEventHandler("onClientPlayerQuit", getRootElement(), list) 
addEventHandler("onClientPlayerChangeNick", getRootElement(), list) 
  
  
addEventHandler ( "onClientGUIClick", root, 
function () 
    if source == Button then 
        local hassan = guiGridListGetItemText(grid, guiGridListGetSelectedItem(grid), 1) 
        local amount = guiGetText (Edit1) 
        triggerServerEvent( "GiveMoney",localPlayer, hassan, amount ) 
        elseif source == grid then 
            local name = guiGridListGetItemText(grid, guiGridListGetSelectedItem(grid), 1) 
                guiSetText(Edit2,name) 
        end 
    end 
) 

-- Server Side #

addEvent("GiveMoney", true) 
addEventHandler("GiveMoney",root, 
function(hassan, amount) 
    local money = getPlayerMoney(source) 
    local tohassan = getPlayerFromName(hassan) 
        if tonumber(amount) <= money then 
            givePlayerMoney(tohassan, amount) 
            takePlayerMoney(source, amount) 
            exports.killmessages:outputMessage("* You have given money amount of: " .. amount .. " : " .. hassan, source, 0, 150, 255, true) 
            exports.killmessages:outputMessage("* ".. getPlayerName(source) .. "  given you money amount of: $" .. amount .. " ", tohassan, 255, 0, 0, true) 
    else 
            exports.killmessages:outputMessage("* Error !",source, 255, 0, 0) 
        end 
    end 
) 
Link to comment

-- Client Side #

wnd = guiCreateWindow(163,53,458,518,"",false) 
guiSetVisible(wnd,false) 
lbl_TO = guiCreateLabel(261,218,28,15,"TO :",false,wnd) 
guiLabelSetColor(lbl_TO,0,255,15) 
guiSetFont(lbl_TO,"default-bold-small") 
lbl_MONEY = guiCreateLabel(259,252,42,17,"MONEY :",false,wnd) 
guiLabelSetColor(lbl_MONEY,0,255,15) 
guiSetFont(lbl_MONEY,"default-bold-small") 
Edit2 = guiCreateEdit(292,215,149,23,"",false,wnd) 
Edit1 = guiCreateEdit(308,246,127,24,"",false,wnd) 
Button = guiCreateButton(261,278,180,51,"SEND \ ارسال",false,wnd) 
img_GAMES = guiCreateStaticImage(273,33,162,163,"images/games.png",false,wnd) 
lbl_BY = guiCreateLabel(288,494,164,19,"Send Money By 7ASSAN v1.1",false,wnd) 
guiLabelSetColor(lbl_BY,0,255,15) 
guiSetFont(lbl_BY,"default-bold-small") 
  
-- outside 
  
grid = guiCreateGridList(11,24,246,485,false,wnd) 
guiGridListSetSelectionMode(grid,2) 
guiGridListAddColumn(grid,"Player",0.80) 
  
function list() 
    guiGridListClear(grid) 
    for id, players in ipairs (getElementsByType("player")) do 
        local row = guiGridListAddRow(grid) 
        guiGridListSetItemText(grid, row, 1, getPlayerName(players), false, false) 
        guiGridListSetItemColor ( grid, row, 1, 0, 250, 154, 255 ) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, list) 
addEventHandler("onClientPlayerJoin", getRootElement(), list) 
addEventHandler("onClientPlayerQuit", getRootElement(), list) 
addEventHandler("onClientPlayerChangeNick", getRootElement(), list) 
  
  
addEventHandler ( "onClientGUIClick", root, 
function () 
    if source == Button then 
        local hassan = guiGridListGetItemText(grid, guiGridListGetSelectedItem(grid), 1) 
        local amount = guiGetText (Edit1) 
        triggerServerEvent( "GiveMoney",localPlayer, hassan, amount ) 
        elseif source == grid then 
            local name = guiGridListGetItemText(grid, guiGridListGetSelectedItem(grid), 1) 
                guiSetText(Edit2,name) 
        end 
    end 
) 
  
bindKey('F6','down', 
function() 
    guiSetVisible(wnd,not guiGetVisible(wnd)) 
        showCursor(guiGetVisible(wnd)) 
    end 
) 
Link to comment

يعطيك العافية بس اظن انك

نظمت الاكواد + ربطت ملف الكلينت مع سيرفر

وضفط هذا الكود

bindKey('F6','down', 
function() 
    guiSetVisible(wnd,not guiGetVisible(wnd)) 
        showCursor(guiGetVisible(wnd)) 
    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...