Jump to content

YourMind

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by YourMind

  1. آسف علي التأخير تخيل الكهرباء كل دة كانت قاطعة عندي -- المهم لو دة جيم مود و اول لما الاعب يخش السيرفرر تفضل addEventHandler ("onClientGUIClick",log, -- زرار تسجيل الدخول function () -- عدل علي الباقي بالشكل اللي انت عايزه local username = guiGetText (Name) local password = guiGetText (Pass) triggerServerEvent ("LOGINTRIGGER",localPlayer,username,password) if guiCheckBoxGetSelected (save) then -- لو الاعب حاط علامة صح triggerServerEvent ("saveLogPass",localPlayer,username,password) -- الداتا تتحفظ else -- لو مفيش علامة صح triggerServerEvent ("deleteLogPass",localPlayer) -- نشيل الداتا لمنع التكرار end end ,false) addEvent ("SHOWwINTRIGGER",true) addEventHandler ("SHOWwINTRIGGER",root, function (SQLData) -- اكوادك -- مثال guiSetVisible (yourwindow,true) showCursor (true) guiSetInputEnabled (true) -- if type(SQLData) == "table" and #SQLData ~= 0 then for i,k in ipairs (SQLData) do guiSetText (Name,k.ID) guiSetText (Pass,k.PW) end -- guiCheckBoxSetSelected (save,true) -- else -- لو مفيش داتا متسجلة او الاعب ماحطش علامة صح علي البتاعة او مش عارف اسمها ايه -- النافذة تظهرله عادي و علامة الصح تتشال guiCheckBoxSetSelected (save,false) -- guiSetVisible (yourwindow,true) showCursor (true) guiSetInputEnabled (true) end end ) --server addEventHandler ("onResourceStart",resourceRoot, function () executeSQLQuery ("CREATE TABLE IF NOT EXISTS `accountsave` (serial,ID,PW)") end ) addEvent ("saveLogPass",true) addEventHandler ("saveLogPass",root, function (username,password) local yyy = executeSQLQuery ('SELECT * FROM `accountsave` WHERE serial =?',getPlayerSerial(source)) if ( type (yyy) == "table" and #yyy == 0 or not yyy ) then executeSQLQuery ('INSERT INTO `accountsave` (serial,ID,PW) VALUES (?,?,?)',getPlayerSerial(source),username,password) else executeSQLQuery ("UPDATE `accountsave` SET ID=?, PW=? WHERE serial=?",username,password,getPlayerSerial(source)) end end ) addEvent ("deleteLogPass",true) addEventHandler ("deleteLogPass",root, function (username,password) executeSQLQuery ("DELETE FROM `accountsave` WHERE serial",getPlayerSerial(source)) end ) addEventHandler ("onPlayerJoin",root, -- اظهار لوحة التسجيل في حدث لما الاعب يدخل السيرفر function () local SQLData = executeSQLQuery ('SELECT * FROM `accountsave` WHERE serial =?',getPlayerSerial(source)) -- ايجاد الداتا -- تقدر تحط اكواد هنا triggerClientEvent (source,"SHOWwINTRIGGER",source,SQLData) -- تريجر اظهار النافذة end )
  2. triggerServerEvent("OnSave", localPlayer, guiGetText(Name), guiGetText(Pass)) guiGetText(Name), guiGetText(Pass)
  3. كودك فيه اخطاء معدودة و اطرح PlayerKill givePlayerPoint
  4. جرب تحط تايمر عشان لما الاعب يموت ينتقل للمستشفي اول شئ بعد كدة يكمل الوقت بتاع التايمر و ينتقل للمقر
  5. خلينا نشوف الاكواد
  6. انا مش مبتدئ في البرمجة فعلاً طلعت المشكة من مود الحفظ شكراً ليكم جميعاً
  7. راح تعرف خطأك اذ قريت الموضوع ذا https://forum.multitheftauto.com/viewtopic.php?f=164&t=95928 فين الخطأ
  8. كودي شغال لسا مجربه الداتا الاتنين كانوا صفر استخدمت الكود setElementData (source,"oil",getElementData (source,"oil") + 53) في لوحة الادمن و نفس الكلام الداتا التانية و مفيش مشاكل بتزيد عن عددها عادي جرب انسخه من فوق تاني عشان الرد جه متأخر و انا عدلته قبل ماترد
  9. طيب لو الداتا بتاعتك مش متعرفة جرب حط دة في كلينت function RefreshData() triggerServerEvent ("ref", getLocalPlayer()) end addEventHandler("onClientRender",getRootElement(),RefreshData) و دة باقي الكود بتاعك Marker = { {566.56647,1315.54443,11.26877}, --1 {491.00558,1309.01355,10.06564}, {424.12436,1406.04602,8.56564}, {441.42508,1427.25085,9.21222}, {408.71820,1475.86646,7.92261}, {431.18521,1554.82129,12.78439}, {488.37692,1528.40222,1.45327}, {524.05084,1474.45740,3.93139}, {514.05585,1380.75891,5.32974}, {417.82724,1378.07129,8.89550}, {401.20309,1415.23743,8.02845}, } addEvent( "ref", true) function refresh() if not getElementData (source, "oil") and not getElementData (source,"medic2") then tonumber ( setElementData (source, "oil", 0) ) tonumber ( setElementData (source, "medic2", 0) ) elseif not tonumber ( getElementData (source, "oil") ) then tonumber ( setElementData (source, "oil", 0) ) elseif not tonumber ( getElementData (source, "medic2") ) then tonumber ( setElementData (source, "medic2", 0) ) end if getElementData (source,"oil") < 0 then tonumber ( setElementData (acc, "oil", 0) ) end if getElementData (source,"medic2") < 0 then tonumber ( setElementData (source, "medic2", 0) ) end end addEventHandler( "ref", getRootElement(),refresh) function onStart() local number = math.random(#Marker) local x, y, z = Marker [number][1], Marker [number][2], Marker [number][3] marker = createMarker(x, y, z-1, "cylinder", 2.0, 255, 0, 0, 0) arrow = createMarker(x, y, z+2, "arrow", 1.0, 255, 0, 0, 255) addEventHandler("onMarkerHit", marker, onHit) obj = createObject(2062, x, y, z) if oil then outputChatBox ( "#ffff00 created new oil", getRootElement(), 255, 255, 255, true ) end end addEventHandler("onResourceStart",resourceRoot, onStart) function onHit(player) destroyElement(marker) destroyElement(arrow) destroyElement(obj) local give2 = math.random( 2 , 10 ) setElementData(player,"oil",give2) function mainFunction() setTimer ( function() onStart () end, 50000, 1 ) end mainFunction() if oil then outputChatBox("#0000ff"..getPlayerName(player).." taked: "..give2.." Oil", getRootElement(), 255, 255, 255, true ) end end local hillArea = createColRectangle ( 339.55478, 1282.31128, 250, 300 ) local hillRadar = createRadarArea ( 339.55478, 1282.31128, 250, 300, 0, 0, 0, 150 ) function hill_Enter ( thePlayer, matchingDimension ) if (getElementType(thePlayer) == "player") then oil = true end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) function hill_Exit ( thePlayer, matchingDimension ) if (getElementType(thePlayer) == "player") then oil = nil end end addEventHandler ( "onColShapeLeave", hillArea, hill_Exit ) addCommandHandler("CreateMedic", function ( player ) if getElementData(player,"oil") >= 25 then setElementData(player,"medic2",getElementData (player,"medic2") + 1) outputChatBox("You Was Create medic2",player,200,0,150) setElementData (player,"oil",getElementData (player,"oil") - 25) elseif ( getElementData(player,"oil") < 25 ) then outputChatBox("You Dont Have oil",player,255,0,0) end end) addCommandHandler("Use Medice2", function ( player ) if getElementData(player,"medic2") >= 1 then setElementHealth(player,200) setElementData (player,"medic2",getElementData (player,"medic2") - 1) end end) addCommandHandler("howhave", function(plr) local oil = getElementData(plr,"oil") local medic2 = getElementData(plr,"medic2") outputChatBox("You Have"..tonumber(oil).." Oil And"..tonumber(medic2).." medic2",plr,255,255,0) end ) * ملحوظة ElementData دي مش بتنحفظ لما تيجي تخرج من السيرفر بتتشال الكود عدلته * AccountData لو عايزها تنحفظ استخدم
  10. Marker = { {566.56647,1315.54443,11.26877}, --1 {491.00558,1309.01355,10.06564}, {424.12436,1406.04602,8.56564}, {441.42508,1427.25085,9.21222}, {408.71820,1475.86646,7.92261}, {431.18521,1554.82129,12.78439}, {488.37692,1528.40222,1.45327}, {524.05084,1474.45740,3.93139}, {514.05585,1380.75891,5.32974}, {417.82724,1378.07129,8.89550}, {401.20309,1415.23743,8.02845}, } function onStart() local number = math.random(#Marker) local x, y, z = Marker [number][1], Marker [number][2], Marker [number][3] marker = createMarker(x, y, z-1, "cylinder", 2.0, 255, 0, 0, 0) arrow = createMarker(x, y, z+2, "arrow", 1.0, 255, 0, 0, 255) addEventHandler("onMarkerHit", marker, onHit) obj = createObject(2062, x, y, z) if oil then outputChatBox ( "#ffff00 created new oil", getRootElement(), 255, 255, 255, true ) end end addEventHandler("onResourceStart",resourceRoot, onStart) function onHit(player) destroyElement(marker) destroyElement(arrow) destroyElement(obj) local give2 = math.random( 2 , 10 ) setElementData(player,"oil",give2) function mainFunction() setTimer ( function() onStart () end, 50000, 1 ) end mainFunction() if oil then outputChatBox("#0000ff"..getPlayerName(player).." taked: "..give2.." Oil", getRootElement(), 255, 255, 255, true ) end end local hillArea = createColRectangle ( 339.55478, 1282.31128, 250, 300 ) local hillRadar = createRadarArea ( 339.55478, 1282.31128, 250, 300, 0, 0, 0, 150 ) function hill_Enter ( thePlayer, matchingDimension ) if (getElementType(thePlayer) == "player") then oil = true end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) function hill_Exit ( thePlayer, matchingDimension ) if (getElementType(thePlayer) == "player") then oil = nil end end addEventHandler ( "onColShapeLeave", hillArea, hill_Exit ) addCommandHandler("CreateMedic", function ( player ) if getElementData(player,"oil") >= 25 then setElementData(player,"medic2",getElementData (player,"medic2") + 1) outputChatBox("You Was Create medic2",player,200,0,150) -- removeElementData(player,"medic2") -------- setElementData (player,"oil",getElementData (player,"oil") - 25) لو عايز تنقص الداتا بدل ماتمسحها elseif ( getElementData(player,"oil") < 25 ) then outputChatBox("You Dont Have oil",player,255,0,0) end end) addCommandHandler("Use Medice2", function ( player ) if getElementData(player,"medic2") >= 1 then setElementHealth(player,200) -- removeElementData(player,"medic2") -- setElementData (player,"medic2",getElementData (player,"medic2") - 1) لو عايز تنقص الداتا بدل ماتمسحها end end) addCommandHandler("howhave", function(plr) local oil = getElementData(plr,"oil") local medic2 = getElementData(plr,"medic2") outputChatBox("You Have"..tonumber(oil).." Oil And"..tonumber(medic2).." medic2") end ) oil , medic2 و اتأكد ان الداتا موجودين و متعرفين في مود تاني
  11. جرب اقفل مود بلاي(play) وركب بداية برسبون او مود رسبون للمكان يلي تبيه ينزل فيه يا أخ انا بقول المشكلة مش من مود freeroam ولا play هما اصلاً عندي مش شغالين
  12. ماعتقدش انا احياناً بدخل سيرفرات مافيهاش مودات شغالة بيبقي فيها نفس المشكلة دي المشكلة مش من مود freeroam play
  13. السلام عليكم انا في سيرفري لما حد يموت ير سبن في مستشفي المدينة الاولي مع اني مش حاط اكواد للأمر دة في موداتي تهائي برضو المشكلة ماتحلتش spawnmanager طفيت مود ممكن اي حد يدلني ايه المود او اسمه ايه الللي بيعمل كدة ؟ عشان تعبت الصراحة و مش لاقيه و شكراً
  14. https://community.multitheftauto.com/index.php?p=resources&s=details&id=7668
  15. جرب --client addEventHandler ("onClientGUIClick",yourbutton, function () triggerServerEvent ("Rotba",localPlayer) end ) -- server timer = { } addEvent ("Rotba",true) addEventHandler ("Rotba",root, function () local account = getPlayerAccount(source) if account and not isGuestAccount (account) then local acc = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..acc, aclGetGroup ( "yourobject" ) ) then outputChatBox ("Already done.",source,255,5,5) return end aclGroupAddObject (aclGetGroup("yourobject"), "user."..acc) outputChatBox ("Done",source,255,255,255) timer[source] = setTimer(function() aclGroupRemoveObject (aclGetGroup("yourobject"), "user."..acc) outputChatBox ("Your admin rights has been removed.",source,255,5,5) end,3600000,1) addEventHandler ("onPlayerQuit",source, function () if isTimer(timer[source]) then killTimer (timer[source]) if isObjectInACLGroup ("user."..acc, aclGetGroup ( "yourobject" ) ) then aclGroupRemoveObject (aclGetGroup("yourobject"), "user."..acc) end end end ) end end ) يديلك الرتبة و بعد ساعة يسحبها و لو خرجت من السيرفر يسحبها خالص و يشيل التايمر
  16. function consoleGiveCash ( thePlayer, command, amount ) givePlayerMoney ( thePlayer, amount ) - end addCommandHandler ( "givecash", consoleGiveCash ) بالترتيب من الشمال فوق thePlayer, command, amount و علي parameters بص علي ال اكيد هاتلاحظ ان playerSource = thePlayer | و هو الاعب اللي استخدم الكوماند commandName = command | دة اسم الكوماند اللي الاعب استخدمه مثلاً يعني function consoleGiveCash ( thePlayer, command,arg) if command == "givecash" then -- givecash يتحقق ان الامر اللي الاعب دخله في اف 8 اسمه givePlayerMoney (thePlayer,2222) -- يديه فلوس givecash لو الكوماند اللي الاعب دخله فعلاً اسمه end -- if اغلاق end -- function اغلاق addCommandHandler ( "givecash", consoleGiveCash ) -- اضافة امر في اف 8 arg1,arg2..arg3 = amount, .... | الكلمة اللي بعد الكوماند مثلاً function consoleGiveCash ( thePlayer, command, amount, arg ) if command == "givecash" then -- givecash يتحقق ان الكوماند اللي الاعب دخله في اف 8 اسمه givePlayerMoney ( thePlayer, amount ) -- يديه فلوس givecash لو الكوماند اللي الاعب دخله فعلاً اسمه end -- if اغلاق if (arg) then -- "amount" يتأكد بان الاعب حاطط كلمة تانية جنب الأولانية outputChatBox (""..arg.."",root,255,255,5) -- يطلع الكلمة دي في الشات end -- if اغلاق end -- function اغلاق addCommandHandler ( "givecash", consoleGiveCash ) -- امر في اف 8 -- بعدين الرقم بتاع الفلوس givecash دلوقت الكود دة لما تيجي تكتب في اف 8 -- فليكن مثلاً 80000 و لما تيجي تكتبه كامل بتكتبه كدة -- (F8) : givecash 80000 -- "amount" كدة يبينلك ان 80000 هي الكلمة او الرقم اللي معرفة فوق بأسم -- و يبينلك بأنها جنب الكوماند اللي مكتوب -------------------------------------------- -- و طبعاً تقدر تعمل كلمة جنب الاولانية اللي هي بعد الكوماند و كلمة تالتة بعد التانية -- "arg" في الكود فوق نفس الحكاية و الكلمة معرفة بأسم -- مثلاً كتبت في اف 8 -- givecash 34883 kkkkk -- هاتلاحظ انه ادالك فلوس 34883 و طلع الكلمة اللي انت كتبتها بعد الرقم في الشات
  17. ببساطة روح صفحته في الويكي هاتلاقي دول
  18. اعذرني لو كنت اعرف كنت رديت عليك
  19. addEventHandler("onPlayerWasted", root, function(_, killer) if getPlayerTable(source, CrTable) or getPlayerTable(source, PoTable) then if killer and getElementType(killer) == "player" then TopKill[killer] = (TopKill[killer] or 0) + 1 TopKill[source] = TopKill[source] or 0 output(root, "#C38EC7[Gta-Ax Champions] #FA8072"..getPlayerName(killer).." #808080(#FFFF00"..TopKill[killer].." Kills#808080) Killed #9ACD32"..getPlayerName(source).." #808080(#FFFF00"..TopKill[source].." Kills#808080) ", 0, 10, 255) end end end if getPlayerTeam(source) == getTeamFromName("Mafia") then RemovePlayer(source, CrTable) elseif getPlayerTeam(source) == getTeamFromName("Rifa") then RemovePlayer(source, PoTable) end ) addCommandHandler ("cjoin", function (plr) if getElementData( plr, "Group" ) == "[A7rAr]" and getPlayerTeam( plr ) and getTeamName( getPlayerTeam( plr ) ) == "Mafia" then if not getElementData(plr, "Stats") >= 2 then if getElementDimension(plr) == 0 then if not getElementData(plr, "Cjoin") then setElementDimension(plr, 1723) setElementPosition(plr, 2.3752818107605,2501.5754394531,16.484375) resetHealthArmy (plr,200) setElementData (plr,"Cjoin",true) setHealthAndArmor (plr,200) AddPlayer(plr, CrTable) else outputChatBox ("You used this command before",plr,255,0,0) end end end end end )
  20. Parameters الحاجات دي اسمها لو عايز تعرفهم روح الويكي و ادخل علي صفحة الحدث و شوفهم مثال مثال تاني
  21. نزل الاكواد عشان نقدر نفيدك
  22. مود التاج عندك هو السبب تقريباً
  23. export function المفروض تحط دة كـ في المود اللي انت عايز تمنع فيه الاف 1 function unBinF() unbindKey ('f1', 'down', toggleFRWindow) end لما تيجي تحب تمنع الاف 1 في مود تاني : exports["freeroam"]:unBinF()
  24. و تبدل الرسالة الشبيهة بالأصلية ؟ ولا عايز رسالة فاضية و خلاص string.match تقصد انك عايز تستخدم
×
×
  • Create New...