Joker_Mta Posted July 19, 2012 Share Posted July 19, 2012 السلام عليكم ورحمة الله وبركاته شباب عندي مشكله في ارسال المال انا اريد اركبه في الشوب لما اركبه ماقدر اختار لاعبين يعني السهم على فوق فقط ماقدر اشوف الاعبين مافي سهم على تحت gui["comboBox"] = guiCreateComboBox(70, 85, 191, 54,"اختر لاعب للأرسل", false, gui["_root"]) for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(gui["comboBox"], getPlayerName(player)) end هاذا ربط الزر addEventHandler("onClientGUIClick", getRootElement(), function(a,b,c,d) if source == gui["pushButton"] and guiComboBoxGetItemText(gui["comboBox"],guiComboBoxGetSelected(gui["comboBox"])) ~= "Select a player" then local getComboPlayer = guiComboBoxGetItemText(gui["comboBox"],guiComboBoxGetSelected(gui["comboBox"])) local getMoneyToSend = guiGetText(gui["lineEdit"]) if getComboPlayer and getMoneyToSend then triggerServerEvent("onPlayerReceiveMoney",localPlayer,getComboPlayer,getMoneyToSend) end end end ) ولو في افضل منه اعطوني بركب في الشوب لو يكون لسته افضل وان شاء الله اكون ماتعبتكم Link to comment
3NAD Posted July 19, 2012 Share Posted July 19, 2012 أفضضل GridList أسستخدم الـ https://wiki.multitheftauto.com/wiki/GuiCreateGridList Link to comment
3NAD Posted July 19, 2012 Share Posted July 19, 2012 --- Client Side setTimer( function() playerList = guiCreateGridList(6, 6, 207, 380, false, theWindow) -- theWindow اسسم اللوحة guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(theWindow) == 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) -- nameEdit هو خانة الإسسم في اللوحة end addEventHandler("onClientGuiClick",getRootElement(), function() if ( source == sendBTN ) then -- sendBTN هو زر الإرسسآل باللوحة playerNick = guiGetText(nameEdit) -- nameEdit هو خآنة الإسسم في اللوحة amount = guiGetText(amountEdit) -- amoutEdit هو خآنة المبلغ في اللوحة triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) end end) --- Server Side 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 ) ^ واذا فيه خططأ debugscript 3 اكتب في الكونسسل و قول وشش الخطأ اللي صآدفك Link to comment
Joker_Mta Posted July 19, 2012 Author Share Posted July 19, 2012 شغال وكل شي لاكن مايرسل خذ ألأكواد + الخطأ --window=tab2 setTimer( function() playerList = guiCreateGridList(6, 6, 140, 380, false, tab2) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(tab2) == 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) nameEdit = guiCreateEdit(160,150,200,30,"",false,tab2) amountEdit = guiCreateEdit(160,200,100,30,"",false,tab2) sendBTN = guiCreateButton(150,280,130,36, "send", false,tab2) --link button function onClickPlayerName () local name = guiGridListGetItemText(playerList, guiGridListGetSelectedItem(playerList), 1) guiSetText(nemeEdit, neme)-----جاني الخطأ هنا guiSetText end addEventHandler("onClientGuiClick",getRootElement(), function() if ( source == sendBTN ) then playerNick = guiGetText(nameEdit) amount = guiGetText(amountEdit) triggerServerEvent("onSendMoney", getLocalPlayer(), playerNick, amount) end end) Link to comment
3NAD Posted July 19, 2012 Share Posted July 19, 2012 خططأ وآضضضح ششوف عندكـ بـ سطر 31 nemeEdit والخآنة اللي مسويها انت أسمها nameEdit و برضو الأرقومنت الثاني في نفس السطر neme واللوكال حقه مكتوب name ^ فرق ححرف واحد خرب المود === وعندكـ سطر 9 مآ ينفع تححط أسسم التاب ! لآزم أسم النافذه Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 والله للحين الخطأ تأكد انت وتأكد من ملف سيرفر ممكن منه مع اني ماحركت شي ابد في ملف سيرفر خذ وجرب سلينت setTimer( function() playerList = guiCreateGridList(6, 6, 140, 380, false, tab2) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(gui["_root"]) == 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) nameEdit = guiCreateEdit(160,150,200,30,"",false,tab2) amountEdit = guiCreateEdit(160,200,100,30,"",false,tab2) sendBTN = guiCreateButton(150,280,130,36, "send", false,tab2) 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) السيرفر 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
3NAD Posted July 20, 2012 Share Posted July 20, 2012 ججرب ذآ -- Client Side setTimer( function() playerList = guiCreateGridList(6, 6, 140, 380, false, tab2) guiGridListSetSelectionMode(playerList, 2) local cl = guiGridListAddColumn(playerList, "Players List ...", 0.85) if ( cl and guiGetVisible(gui["_root"]) == 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) nameEdit = guiCreateEdit(160,150,200,30,"",false,tab2) amountEdit = guiCreateEdit(160,200,100,30,"",false,tab2) sendBTN = guiCreateButton(150,280,130,36, "send", false,tab2) 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) Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 تسلم اياديك خوي عناد ماقصرت تعبتك معي Link to comment
3NAD Posted July 20, 2012 Share Posted July 20, 2012 ححيآكـ الله =] ولككن اللي مصعب عليك البرمجة .. Gui Editor انكـ مآ تستخدم سكربت في صنع النوآفذ Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 (edited) هههههههه اوك والله فكرت مامنه فايده ابد معلومه مفيده شوف اريدك تضيف وقت لهاذا الكود يعني الكلام يكون 5 ثواني فوق الاعب ويختفيتسلم مشكور ماقصرت بتوفيق ---------تم الحل-------- تسلم اياديك عساه في ميزان حسناتك Edited July 20, 2012 by Guest Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 (edited) تفضل = ---------تم الحل-------- تسلم اياديك عساه في ميزان حسناتك Edited July 20, 2012 by Guest Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 لما تحط الوقت بحذف ألأكواد ماريده ينتشر Link to comment
3NAD Posted July 20, 2012 Share Posted July 20, 2012 (edited) --- Client Side --- Deleted --- --- Server Side --- Deleted --- ^ إذا فيه أخططآء قول في أي سسطر Edited July 20, 2012 by Guest Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 مافيه اخطأ بعد ماحطيت الكلمه ماصادفتني اخطأ لاكن لما اكتب مايجي فوقي الكلام مع انه اأخطاأ مافيه Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 (edited) تسلم مشكور ماقصرت بتوفيق تسلم اياديك عساه في ميزان حسناتك Edited July 20, 2012 by Guest Link to comment
3NAD Posted July 20, 2012 Share Posted July 20, 2012 انا خخليت اللي يكتب مآيششوف رسائل نفسه , على ششأن مآ تغطي الشاشة Link to comment
Joker_Mta Posted July 20, 2012 Author Share Posted July 20, 2012 اها حلو الحين بركبه بسيرفر بشوف النتيجه وبردلك خبر لو قلتلك شغال ياريت تشيل ألأكواد Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now