Jump to content

Hamza Elsayed

Members
  • Posts

    119
  • Joined

  • Last visited

Everything posted by Hamza Elsayed

  1. شكراااً جداً الكود يعمل تمام
  2. عملت هيك سيرفر function SpawnNoTe (SkinID, team) setPlayerTeam(source, getTeamFromName(team)) local Acc = getPlayerAccount(source) rem = getAccountData (Acc,"msjoul") if (team == "NoTeam") then setPlayerNametagColor(source, 255, 0, 0) if (rem) then local xno, yno, zno = unpack(jaja[math.random( #jaja )]) spawnPlayer(source, xno, yno, zno, 0, SkinID, 0, 0) triggerClientEvent(source, "unJail", source, rem) else local xn, yn, zn = unpack(rnd[math.random(1, 6)]) spawnPlayer(source, xn, yn, zn, 0, SkinID, 0, 0) setPlayerWantedLevel (source, 2) end exports["guimessages"]:outputServer(source, "أنت الأن مع NoTeam", 255, 0, 0) triggerClientEvent ( "ReNot", getRootElement()) fadeCamera(source, true) setCameraTarget(source) end end addEventHandler('onPlayerDamage',root,function(attacker,weapon) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if ( weapon == 3 ) then if Times[getPlayerWantedLevel(source)] then nosu = getPlayerName (source) noct = getPlayerName (attacker) exports["guimessages"]:outputServer(root, " #FFFF00 قام الشرطي #0000FF " ..noct.. " #FFFF00 بسجن اللاعب #FF0000 " ..nosu, 0, 0, 255) givePlayerMoney ( attacker, 5000 ) setElementPosition (source, unpack(jaja[math.random( #jaja )])) setElementInterior ( source, 0 ) timer2 = setTimer ( setElementPosition, Times[getPlayerWantedLevel(source)], 1,source , 1572.9000244141, -1635.4000244141, 13.60000038147) triggerClientEvent(source, "unJail", source, Times[getPlayerWantedLevel(source)]) setPlayerWantedLevel(source, 0) if isTimer (timer1) then local Acc = getPlayerAccount(source) remaining, executesRemaining, totalExecutes = getTimerDetails(timer1) setAccountData (Acc, "msjoul", remaining) end end end end end end ) وهيك كلينت function displayTimer( ) local es = getTickCount( ) - start es = remaining - es local m,s = math.floor(es/60000), math.fmod(math.floor(es/1000), 60) if not ms then ms = m end if not ss then ss = s end if m < 10 then ms = "0"..m end if s < 10 then ss = "0"..s end dxDrawText("Time : "..m.." : "..s, 574, 543, 790, 590, tocolor(0, 255, 0, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) if math.floor(es) <= 0 then removeEventHandler("onClientRender", root, displayTimer) end end addEvent("unJail", true) addEventHandler("unJail", root, function(rem) remaining = rem start = getTickCount( ) addEventHandler("onClientRender", root, displayTimer) end) وكل شئ تمام لكن عندما يدخل اللاعب المسجون يبدأ الوقت من 2:45 وليس من الوقت المتبقي لديه يعني أنا لو خرجت وفاضلي دقيقة عندما أدخل يبدأ من 2:45 ما المشكلة ؟؟
  3. شباب لم أستطيع عمل الكود وأرجو المساعدة
  4. طيب و getTickCount ماراح أحتاجها ؟؟
  5. السلام عليكم شباب عندي كود عندما يضرب الشرطي اللاعب المطارد بالعصا يدخل السجن وشغال تمام .. سيرفر local jaja = { {5033.3999, -2103.2, 391.60001}, {5029.7002, -2102.8999, 391.60001}, {5025.6001, -2102.8999, 391.60001}, {5021.7998, -2103.1001, 391.60001}, {5017.7998, -2103.2, 391.60001}, {5013.6001, -2103.1001, 391.60001}, {5013, -2080.2, 391.60001}, {5017.1001, -2080.5, 391.60001}, {5021.2002, -2080.5, 391.60001}, {5024.8999, -2080.3999, 391.60001}, {5029, -2080.5, 391.60001}, {5032.7998, -2080.3999, 391.60001}, {5031.8999, -2080.3, 384.70001}, {5028.2002, -2080.5, 384.70001}, {5024.2998, -2080.3999, 384.70001}, {5020.2002, -2080.6001, 384.70001}, {5016.2002, -2081.2, 384.70001}, {5011.6001, -2080.8999, 384.70001}, {5032.1001, -2104.3, 384.70001}, {5028.2998, -2104.3999, 384.70001}, {5023.8999, -2103.3, 384.70001}, {5020.2998, -2103.1001, 384.70001}, {5016.5, -2103.5, 384.70001}, {5012.2002, -2103.8999, 384.70001}, } Times = { [6] = 360000, [5] = 300000, [4] = 240000, [3] = 180000, [2] = 180000, [1] = 180000, } addEventHandler('onPlayerDamage',root,function(attacker,weapon) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if ( weapon == 3 ) then if Times[getPlayerWantedLevel(source)] then setElementPosition (source, unpack(jaja[math.random( #jaja )])) timer1 = setTimer ( setElementPosition, Times[getPlayerWantedLevel(source)], 1,source , 1572.9000244141, -1635.4000244141, 13.60000038147) triggerClientEvent(source, "unJail", source, Times[getPlayerWantedLevel(source)], timer1) setPlayerWantedLevel(source, 0) end end end end end ) كلينت function displayTimer( ) local es = getTickCount( ) - start es = remaining - es local m,s = math.floor(es/60000), math.fmod(math.floor(es/1000), 60) if not ms then ms = m end if not ss then ss = s end if m < 10 then ms = "0"..m end if s < 10 then ss = "0"..s end dxDrawText("Time : "..m.." : "..s, 574, 543, 790, 590, tocolor(0, 255, 0, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) if math.floor(es) <= 0 then removeEventHandler("onClientRender", root, displayTimer) end end addEvent("unJail", true) addEventHandler("unJail", root, function(rem) remaining = rem start = getTickCount( ) addEventHandler("onClientRender", root, displayTimer) end) ولكني أريد حفظ الوقت المتبقي علي خروج اللاعب من السجن عندما يطلع من السيرفر كي أضعه في السجن مرة أخري عندما يدخل السيرفر ويقضي الوقت المتبقي علي خروجه أرجو أنت تكونو قهمتوني وأتمني الأفادة
  6. ههههه والله العظيم من كثر الأكواد أنا وياك تلخبطنا خلاص هذا آخر كود function displayTimer( ) local now = getTickCount( ) local es = now - start local m,s = math.floor((es/1000)/60), math.floor(es/1000) local ms, ss = m, s if m < 10 then ms = "0"..m end if s < 10 then ss = "0"..s end dxDrawText("Time : "..m.." : "..s, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) if now >= start+remaining then removeEventHandler("onClientRender", root, displayTimer) end end أخي الوقت يبدأ من الصفر وعندما يصل إلي 9 يتوقف
  7. هههههههههه نسيت تحط متغير هنا if m < 10 then "0"..m end if s < 10 then "0"..s end عدلتها وجاري التجربة
  8. يا ديني ده الكود الي فوق خالص
  9. وبعدين غلطت نفسه غلطة الكود الي قبلهم وما سويت متغيرين هنا .. if m < 10 then "0"..m end if s < 10 then "0"..s end
  10. جاري التجربة بس أيضاً لا أعتقد أن الوقت حيقل لأنك كل الي ضفته الشرط ده if m == 0 and s == 0 then
  11. هذي اذا كان الرقم اقل من عشرة يعني 9 مثلا يخليه 09 فهمت + جرب هذا الكود function displayTimer( ) local now = getTickCount( ) local m,s = math.floor(now/60000), math.floor(now/1000) local sm, ss = m, s if m < 10 then sm = "0"..m end if s < 10 then ss = "0"..s end dxDrawText("Time : "..sm.." : "..ss, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) if now >= start+remaining then removeEventHandler("onClientRender", root, displayTimer) end end علي ما أظن هوا هوا نفس الكود الي قبله
  12. وياريت تفسرلي الشرطين دول if m < 10 then sm = "0"..m end if s < 10 then ss = "0"..s end وشكراً
  13. شكل الجوع مأثر فيني function displayTimer( ) local now = getTickCount( ) local m,s = math.floor(now/60000), math.floor(now/1000) local sm, ss = m, s if m < 10 then sm = "0"..m end if s < 10 then ss = "0"..s end dxDrawText("Time : "..sm.." : "..ss, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) if now >= start+remaining then removeEventHandler("onClientRender", root, displayTimer) end end هههههههههههههههه كل سنة وأنت طيب وجاري التجربة
  14. أخي جربت شلت الشرطين دول ... if m < 10 then "0"..m end if s < 10 then "0"..s end الوقت صار يزيد لا يقل
  15. متأكد أن الوقت حيقل مبتدئ ومتعجب من الكود الحقيقة نسيت اقلك انا الوقت مايتحدث Server Times = { [6] = 360000, [5] = 300000, [4] = 240000, [3] = 180000, [2] = 180000, [1] = 180000, } addEventHandler('onPlayerDamage',root, function(attacker,weapon) if attacker and attacker ~= source and getElementType(attacker) == 'player' and getPlayerTeam(attacker) and getTeamName(getPlayerTeam(attacker)) == 'Police' then if getPlayerWantedLevel(source) > 0 and getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) ~= 'Police' then if ( weapon == 3 ) then if Times[getPlayerWantedLevel(source)] then setElementPosition (source, unpack(jaja[math.random( #jaja )])) timer = setTimer ( setElementPosition, Times[getPlayerWantedLevel(source)], 1,source , 1572.9000244141, -1635.4000244141, 13.60000038147) triggerClientEvent(source, "unJail", source, Times[getPlayerWantedLevel(source)]) end end end end end) Client function displayTimer( ) local now = getTickCount( ) local m,s = math.floor(now/60000), math.floor(now/1000) if m < 10 then "0"..m end if s < 10 then "0"..s end dxDrawText("Time : "..m.." : "..s, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) if now >= start+remaining then removeEventHandler("onClientRender", root, displayTimer) end end addEvent("unJail", true) addEventHandler("unJail", root, function(rem) remaining = rem start = getTickCount( ) addEventHandler("onClientRender", root, displayTimer) end) ما يشتغل الجيم مود كله الدي بق يقولي ... unexpected Symbol Near ""0"" في سطر if m < 10 then "0"..m end
  16. متأكد أن الوقت حيقل مبتدئ ومتعجب من الكود الحقيقة
  17. أنا فضلت أحاول لحد ما أشتغل بس أريد طريقة تخلي الوقت ينقص ثانية ثانية
  18. اصلا انت مسوي بلاوي بس والله شغال
  19. تم حل المشكلة سويت كده وأشتغل function bobuaou3(remaining3) rem3 = remaining3 addEventHandler('onClientRender',root,function ( ) if rem3 > 0 then dxDrawText("Time : "..rem3/60000, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) else removeEventHandler("onClientRender", root, bobuao3) end end) end addEvent("moka3", true) addEventHandler("moka3", getRootElement(), bobuaou3) function bobuaou(remaining) rem = remaining addEventHandler('onClientRender',root,function ( ) if rem > 0 then dxDrawText("Time : "..rem/60000, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) else removeEventHandler("onClientRender", root, bobuao) end end) end addEvent("moka", true) addEventHandler("moka", getRootElement(), bobuaou) function bobuaou1(remaining1) rem1 = remaining1 addEventHandler('onClientRender',root,function ( ) if rem1 > 0 then dxDrawText("Time : "..rem1/60000, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) else removeEventHandler("onClientRender", root, bobuao1) end end) end addEvent("moka1", true) addEventHandler("moka1", getRootElement(), bobuaou1) function bobuaou2(remaining2) rem2 = remaining2 addEventHandler('onClientRender',root,function ( ) if rem2 > 0 then dxDrawText("Time : "..rem2/60000, 574, 543, 790, 590, tocolor(255, 187, 23, 255), 1.50, "beckett", "left", "top", false, false, false, false, false) else removeEventHandler("onClientRender", root, bobuao2) end end) end addEvent("moka2", true) addEventHandler("moka2", getRootElement(), bobuaou2) لكن مثل ما قلتلك بالاول الوقت لا يقل
  20. أنا مبتدئ :3 هيا مين دي الي أسميها :3
  21. وأيضاً الكود لا يعمل يقولي Got nil علي Rem :3
×
×
  • Create New...