AHMED MOSTAFA Posted October 28, 2016 Share Posted October 28, 2016 السلام عليكم ورحمة الله وبركاته ابي مساعدة بسيطة وهي انا مسوي ترايجر وكلمة في ملف سيرفر ( عدد ) وارسلت هاذي الكلمة بالترايجر لملف الكلينت لكنها ما توصل - التجربة -- Server -- function Miner () MyGold = "10" triggerClientEvent(source, "getMinerHave", source, MyGold ) end addEventHandler("onResourceStart", resourceRoot, Miner) -- Client -- addEvent("getMinerHave", true) addEventHandler ("getMinerHave", root, function ( MyGold ) MyGold = tonumber(MyGold) end ) addEventHandler("onClientRender", root, function() dxDrawText(MyJewels, 270, (screenH - 80), ((screenW - 100) / 2) + 100, ( (screenH - 80)) + 60, tocolor(255, 255, 255, theMinerImage), 1.00, "default-bold", "left", "center", false, false, false, false, false) end ) وبس هذا كل شي ابي اعرف ليش الكلمة ما تروح لملف الكلينت Link to comment
Abdul KariM Posted October 28, 2016 Share Posted October 28, 2016 عندك السورس غير معرفة السورس راح يكون السكربت الي اشتغل onResourceStart لان في حدث فـ تحتاج الى لوب وترسل ترايقر للكلينت Link to comment
AHMED MOSTAFA Posted October 28, 2016 Author Share Posted October 28, 2016 4 minutes ago, Abdul KariM said: عندك السورس غير معرفة السورس راح يكون السكربت الي اشتغل onResourceStart لان في حدث فـ تحتاج الى لوب وترسل ترايقر للكلينت وش اللوب ؟. Link to comment
iPrestege Posted October 28, 2016 Share Posted October 28, 2016 (edited) for _,player in ipairs ( getElementsByType ( 'player' ) ) do -- To do end -- From mobile not sure of mistakes. Edited October 28, 2016 by FaHaD Link to comment
AHMED MOSTAFA Posted October 28, 2016 Author Share Posted October 28, 2016 -- Server -- MySand = "0" MyIron = "0" MyJewels = "0" MyGold = "0" addEvent("giveMiner",true) addEventHandler("giveMiner",root, function () local MinerSand = math.random(0,5) local MinerJewels = math.random(0,5) local MinerIron = math.random(0,5) local MinerGold = math.random(0,5) MyJewels = MyJewels+MinerJewels MySand = MySand+MinerSand MyIron = MyIron+MinerIron MyGold = MyGold+MinerGold if MinerJewels == 0 and MinerSand == 0 and MinerIron == 0 and MinerGold == 0 then exports["guimessages"]:outputServer(client,getPlayerName(client).." This is a Bad time !!!",255,0,0) end for _,player in ipairs ( getElementsByType ( 'player' ) ) do triggerClientEvent(player,"getMinerHave",player,MyGold,MyIron,MyJewels,MySand) end end ) -- Client -- addEvent("getMinerHave", true) addEventHandler ("getMinerHave", root, function (MyGold,MyIron,MyJewels,MySand) MyJewels = tonumber(MyJewels) end) addEventHandler("onClientRender", root, function() local screenW, screenH = guiGetScreenSize() dxDrawText(MyJewels, 270, (screenH - 80), ((screenW - 100) / 2) + 100, ( (screenH - 80)) + 60, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", false, false, false, false, false) end ) هاذي التجربة الحقيقية - لأنو الاولى مجرد استعارة واحس فيها تعقيد شوي Link to comment
Abdul KariM Posted October 28, 2016 Share Posted October 28, 2016 وش الي تبي تسويها بالضبط ؟ تبي تجيب قولد الاعب وتحطها له ؟ 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