Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/08/18 in all areas

  1. Syntax bool setElementModel ( element theElement, int model ) لتغير سكين الاعب او موديل السيارة او موديل اوبجكت يعني ليس للاعب فقط مثال Required Arguments اول ارقيمونت : هو الاعب اللي تبي تغير السكين حقتوا او السيارة اللي تبي تغير الموديل حقتها او موديل اوبجيكت ثاني ارقيومنت : هو رقم الاوبجيكت سكين مودل الخ addCommandHandler("Skin",-- امر في اف 8 function(player) -- انشاء فنكشن Random = math.random(0,15) -- نجيب رقم من ال 0 ل 15 setElementModel(player,tonumber(Random)) -- نضع شخصية الاعب علي حسب الارقام الاختيار اللي فوق end -- اغلاق الفنكشن ) -- اغلاق الكوماند : مثال اخر addEventHandler("onPlayerJoin",root,-- ايفنت عند دخول الاعب السيرفر function() -- بداية الفنكشن setElementModel(source,0) -- جعل شخصيه الاعب لرقم 0 اي شخصيه سي جي end -- اغلاق الفنكشن ) -- اغلاق الحدث onMarkerHit attachElements
    3 points
  2. ههههههههههههههههههههههههه, يعني عشان فلسطين دم ليل ونهار اترك حياتي واقعد ابكي ولا كيف بالظبط
    3 points
  3. انا اصلى تونسي لكن عشقي فلسطين دمكم هو دمي انتم اخواتي فلسطين فالقلب
    2 points
  4. الصراحة كلامك أقنعني كلامك اعجبني .. لكن أكثر كلمة اعجبتني هي كمل رقص مو لهدرجه كـ شعب محد يقدر يسوي شيء . الدبكة هذي زي رقصة شعبية فلسطينية أصيلة , ماتقدر تحطها بمقام : كيكي ! مثل انتو عندكم شيلات حنا عندنا دبكة . ملاحظة : كل بلد ولها زبالتها مافي بلد نظيف خالي من العلة ملاحظة ثانية : تونسي من تونس ماهو فلسطيني ولا له علاقة بفلسطين .. لكن عنده نخوة * هذي بعض الناس تعتبرها مشكلة , البعض مو الكل
    2 points
  5. https://up.top4top.net/downloadf-579t3oe11-zip.html
    2 points
  6. انت تقول كلام غلط لان القدس اسرائيل محتلاها من 1948 يعني من زمان مره كيف يعني 2014 مارح تكوون محتلة ؟؟ يمكن تكون انت ملخبط في التاريخ او شي المهم موفق
    2 points
  7. ترى عيوب الأخرين ولا ترى عيوبك, لا تتكلم عن غيرك وانتم بأنفسكم يالفلسطينيين ترقصون وتدبكون طول اليوم عموماً مابخش بالسياسة لأنها ممنوعة بالمنتدى, بس عندي مقطع واحد
    2 points
  8. قولك انه نصف امة محمد يموت والنصف الاخر يرقص كيكي فعلًا انا ضد كيكي اشوفه شي تافه . ولكن .. بما انك تلعب لعبه تقدر تقول انها تافهه على نفس موضوعك . بدال ماتلعب اللعبه ليه ماتجاهد ؟ بدال ماتبرمج ؟ بدال ماتتابع كوره ؟ بدال ماتسب شخص ؟ بدال ماتحش بشخص ؟ نفس الشي يعني ألمقارنه خاطئه جدًا ولكن النقطه صحيحه
    2 points
  9. كدة يا رام النوووووووووووووب طيب مشكور شباب الان فهمت انا افتكرت انى اكنسل المود الكود الى حطيتوة فى الاول وان دة هعمل رسبونات فهمت خلاص مشكور ض
    2 points
  10. سلام عليكم و رحمة الله تعالى وبركاته انا مختفي شوي عن اللعبة ومحتاج كذا شوية فلوس عندي كم مودات ودي أبيعها Multigamemodes عندي 2 حصريين ( فيه حق 30$ وفيه حق 50$ ) Gamemodes ( 15 - 30 $ )فيه حق شوتر و فيه حق ريس Userpanels (10$ )أظن عندي وحدة حصرية Clanwar script ( 25 - 40$ لأنه فنااان مرة تعبت فيه ) عندي واحد فنان بس لو تبي اغير لك غيرت screenshots = ? ما أقدر اعطيك صور لأنهم حصريين و ما أبي ينقزون أصحاب الحسنات يقعد يقلده الدفع 50% قبل و 50 بعد استعمل بايبال فقط - skype : Conolel44 تبي ديسكورد حقي نط خاص
    1 point
  11. السلام عليكم ورحمة الله اليوم اقدم لكم فيدو بعيد عن لعبه شخص فلسطيني عمره اقل من 11 سنه ويشوفو وش يقول وسلام
    1 point
  12. تحتاج لشغلات طويلة مثل الشآدر وبالنسبة للصور تقدر تستخدمها بالمتغيرات count = count + 1 وتسوي جدول وتحط فيه الصور
    1 point
  13. اخوي معليك انا مسيطر على موضوعي وانا اقرر الموضوع ينقفل او لا @!#NssoR_) مافي داعي لقفل الموضوع وانا مقلت لخوي الغالي شيء غلط وانا كمان احترم كل شخص يحترمني
    1 point
  14. حتى انا ما ابحث عنهم بس اي شخص يبحث عن تاريخ امته و انتصاراتها و قوتها رح يلاقي الماسوينه القديمه بطريقه , و الي يكسر ظهر العرب او السملمين هو الخيانه يعني روح شوف اي امه و شوف كيف انتهت الا ما تلاقي فيها واحد صهيوني خاين او فارسي و الفرس هم ايران حالياً + ممنوع نتكلم بالسياسه اتوقع سوري ×.× و احى تحيه لتونس
    1 point
  15. صراحه ما ابي اقول كلام اصغر من عمرك ف بدي اعرف عمرك ع شن اعرف كيف اتحدث معك - المصونية ي اخي الكريم تعرف وش رح يصير بـ كل شيء - مين يرفع دولار وينزل دولار مين يتحكم ف فلوس العالم ؟ - المصونية يومنون بالقرأن ليه ع شن يعرفو انو المسلمين رح يهزومون دول الكفار طيب آسهل شيء انت مش تشوف زنا واشياء الفساد كلها صارت مب عار وصار عادي كل شيْ؟ وما تعرف انو يحطون ف راسك الكوكب مكور وهو ليس مكور لـ انو فلأقران مكتوب وسطحنا لأرض وهم يكذوب كل ذا ويبون نسمعو كلمهم ع شن م ابي اكبر الموضوع اكثر من كذا وشكرا لك ف لاداعي طول سالفة لى انو بفهم اكثر منك وحياك الله حبيبي قلبي م ابي ابحث عن المساونية او اخش واعرف معلومات عنهم + مثلك والله ف كم شخص بدي اسبه بس زي مقلت خلي نصور يقفل الموضوع او يحذفه فلسطن فالقلب
    1 point
  16. موضوع للجدال و للتفرقه و انا ك انسان فلسطيني متواضع قربت اسب على اكم واحد هنا ف انصح ب ازالة الموضوع علشان ما تصير خلافات و شكرا @!#NssoR_) الماسونيه اصلها يهودي و الي اساسه هم اليهود و بالدليل انه كانو زمان اسمها فرسان المعبد بس بعد الخلافه العثمانيه ما طردتهم من دول الشام و العرب راحوا اوروبا باسم الحملات الصليبه بعدين صاروا الماسوينه تقدر تشوف قوقل
    1 point
  17. بالنسبه رقصت كيكي مافيه شي لكن انت تقولي وين العرب انا بقولك وين العرب ليبيا في حرب ضد داعش و شخص يحاول يعمل انقلاب واليمن في حرب والسعوديه حرب مع ايران و قطر والعراق مع داعش و سوريا نفس شي ومصر فيه مشاكل اقتصادية وتونس فيه مشاكل سياسيه ولبنان فيه مشاكل ------------------------------------------------------------------------
    1 point
  18. أنت مافهمت قصده لان الاخ N3xT قال ل تونسي مثل انتم الفلسطينيين عندكم نفس الكيكي . فهو رام رد عليه وقاله تونسي من تونس مو من فلسطين ماقصده يفرق ولكن كلامك جميل ي جميل
    1 point
  19. ( غلط x كلامك ذا = 99999999^( غلط المفروض نكون مثل ما دينا الأسلام يقول ( أمه واحده ) لا يفرق تونسي عن مصري عن سعودي عن اماراتي عن فلسطيني و ذا شي المفروض الكل يحط تحته مليون خط احمر
    1 point
  20. تقدر تسويها عن طريق attachElements ولو تستعمل معها setPedAnimation رح تكون إحترافية أكثر .. , المقصد جمالية للحدث
    1 point
  21. @coNolel الراجل دخل اول بوست له علي موضوعك و يمدح فيك يعني انت هيك فوق خالص منور المنتدي يا رشيدي
    1 point
  22. الوضع مزح يخوي لا تقلبها جد :3
    1 point
  23. معروف بالبرمجة انت ماشاء الله عليك انسان كامل بالبرمجه من ناحية الافكار - التصميم ،والسرعة ايضا بالتوفيق لك ..
    1 point
  24. Forgive me, I wasnt at home, I will work on an example and I will send it to you, i will use 1920x1080 and make calculations there, theoretically if I do it relative it should work on any res, i will update my comment when its ready.
    1 point
  25. لو قصدك الزر جاي ايديتور يبقي كذا window = guiCreateWindow(187, 186, 709, 428, "", false) -- انشاء نافذة button = guiCreateButton(209, 380, 212, 38, "تغير السكين", false, window)--انشاء زر guiSetVisible(window,true) -- جعل النافذة مرئية showCursor(true) -- اظهار سهم التحكم addEventHandler("onClientGUIClick",root, -- ايفنت الضغط علي زر function() -- فنكشن if(source == button)then -- للتاكد من ان الزر اللي ضغط عليه الاعب هو زر تغير السكين اللي احنا مسوينوا فوق setElementModel(localPlayer,0) -- جعل مودل الشخصيه 0 اي سي جي تقدر تغيرها end -- اغلاق التحقق end -- اغلاق النكشن ) -- اغلاق الايفنت لو تبيه زر عادي مو جاي ايديتور يبقي كدا سيرفر addCommandHandler("Create", function(player) x,y,z = getElementPosition(player) Marker = createMarker(x,y,z,'cylinder',1.5,255,255,255,255) end) addEventHandler("onMarkerHit",root, function(Hitter) bindKey(Hitter,"F2","down",Change) end) addEventHandler("onMarkerLeave",root, function(Hitter) unbindKey(Hitter,"F2","down",Change) end) function Change(Hitter) setElementModel(Hitter,0) end كلنت addCommandHandler("Create", function() x,y,z = getElementPosition(localPlayer) Marker = createMarker(x,y,z,'cylinder',1.5,255,255,255) end) addEventHandler("onClientMarkerHit",root, function(Hitter) bindKey("F2","down",Change) end) addEventHandler("onClientMarkerLeave",root, function(Hitter) unbindKey("F2","down",Change) end) function Change() setElementModel(localPlayer,0) end
    1 point
  26. El staff que contestó dijo que normalmente se trataba de un virus.
    1 point
  27. الوظيفة عبارة عن ربط شيئين ببعض مثل لاعب وابجيكت سيارة وابجيكت لاعب وسيارة الخ Syntax bool attachElements ( element theElement, element theAttachToElement, [ float xPosOffset = 0, float yPosOffset = 0, float zPosOffset = 0, float xRotOffset = 0, float yRotOffset = 0, float zRotOffset = 0 ] ) الارجيومنت الاول : هو الالمنت اللي انتا هتربطوا او تشبكوا مع المنت اخر الارجيومنت التاني : هو الالمنت اللي هيتربط او يتشبك مع الالمنت اللي في الارقيومنت الاول مثلا نبي نربط سيارة بلاعب يبقي السيارة الارقيومنت الاول والاعب الرقيومنت التاني مثال function tankHat ( source, commandName ) -- بداية الفنكشن local x, y, z = getElementPosition ( source ) -- نجيب احداقيات الاعب local tank = createVehicle ( 432, x, y, z + 5 ) -- ننشا سيارة attachElements ( tank, source, 0, 0, 5 ) -- نربط السيارة بالاعب end -- نهاية الوظيفة addCommandHandler ( "hat", tankHat ) -- نهاية الكوماند
    1 point
  28. استعمال المتغيرات بجانب السيرفر راح يغيرها للجميع
    1 point
  29. I like how all this sounds, and the fact your hosting doesn't require unique scripts in order to have a server proves a less possibility of leaking customer's data. This seems to be a start up with a great future to come.
    1 point
  30. مدام خليت الموضوع ضحك فلا داعي تقول كلام ثاني لا م تبكي افرح لـ آسرئيل ولا معي حل ثاني ارفع يديك وقول حسبنا الله ونعم الوكيل مثل م قال هذا الطفل يمكن عمره اصغر من عمرك وشوف وش يقول وشوف انت وش تقول
    1 point
  31. هو مقهور كيف ناس ترقص بشوراع ومبسوطين وفلسطين دم ليل ونهار موت ليل ونهار ع شن كذا لما شاف المسلمين كيف صار يقلدون اجانب الولد نطق ولو عجبتك رقصت كيكي مافي احد وقفك اخي فالكريم كمل رقص
    1 point
  32. Thank you for taking an interest within our services. Everything you see on the site is built up from scratch, it's still in a development phase at the moment so clients can experience the basics before we continue implementing and improving. The current system includes the bare minimum for managing a server, and there is still more yet to come. In terms of hosting an entire server with unique scripts, that is up to the user; no one but the client has access to the game server and the content within it, you own your service. That is because no one but the user itself has access to the FTP Client, with encrypted credentials. We see that there aren't many legit hosting companies that give out decent servers that are free, so we decided to try out something new. Most of the time, the free service either shuts down weeks later, or the servers slowdown due to overload, or the possibility of resources being stolen/corruption within the team. None of that happens here, since there is no 'real' team due to the fact that everything is self-managed and mostly automated. The idea of having no team protects the client mostly since we don't want to leak any information and it allows us to prevent wrong people from getting unauthorised access. Budget Ping operates under 1 person, and the System itself. Once again this is a fun project, and everything you see is coming out of our own pockets, we want our clients to be happy with what we provide and enjoy the work we produce. There is more yet to come such as more game servers being introduced, databases, even faster servers etc. Lastly, in terms of server security, from our side the server is protected, we've made sure the correct encryption and settings are used for each account that is registered to our database. Also, everything is separated and restricted accordingly for the System, so we don't grant too much access, and just set the fundamentals to protect the user and his/her data. If you have anymore questions or concerns, I'll be more than happy to answer them for you, hope to see you using our services soon! A good example is that, if you intend to run a Roleplay Gamemode, you must consider the fact that the current server(s), do not accept MySQL Databases, and have a limit of 5 GB. Currently these add-on's are disabled. However, on a personal quote through 'Contact Us' or near the upcoming updates, we intend to implement these features for a fixated price to allow users to upgrade their free services to much more powerful ones.
    1 point
  33. الله يهديهم .. دايم أولاد بلدي لما يوصلو رسالتهم بيعرفو كيف يوصلوها ') لابد من وقت ... رح هذي الأشكال والأشكال التافهة رح نتساءل , اي مزبلة تاريخ رح تقبل تحويهم ؟؟ .. وشدي حيلك يا بلد .. لكن .. لابد من يوم رح ينتصر فيه الإسلام وتترفع راية الخلافة خفاقة بالسماء , رح يجي يوم ... وأمة محمد صلى الله عليه وسلم رح تتسيد كل الأمم ..
    1 point
  34. والله اتصلت علي قالت شركة نيوتريد ومدري وش والرقم اللي رقم أماراتي حق شركة بس صوتها يخرفن قالت تدخل معنا ع التداول قلت كم اذا بدخل قالت اذا بدك ٥٠٠ دولار او الف دولار قلت عشانك ٥ الاف دولار بس الحين مو فاضي. لاتشوفك عيني.
    1 point
  35. --------------------------------------- Corrigindo esse problema de sintaxe, ele funcionou o emprego aqui. MAS, tenho algumas observações: Você precisa dar feedback ao jogador quando ele entra no primeiro marker para fazer aparecer o caminhão, ex: AVISO: Você começou a trabalhar de leiteiro, entre no caminhão ao lado e leve o leite até o blip vermelho. Dessa forma o jogador não precisa adivinhar o que deve fazer em seguida. Você só paga $150 ao jogador por cada viagem, isso é pouco, considerando o tempo de viagem e a dificuldade de subir o morro de volta até a fazenda com um caminhão de baixa potência. A não ser que no seu servidor a economia baseie-se em supervalorização da moeda, você deve pagar mais ao jogador. Você deixou o blip do emprego com distância de visualização máxima (9999). Isso não é recomendável, pois se você tiver vários empregos com blips assim, seu radar ficará entupido de blips e pelo que estou percebendo, vc irá usar o mesmo blip para todos os empregos (T = Trabalho), o que aumentará ainda mais a confusão do jogador. Minha sugestão é deixar no máximo 600, assim o blip só aparecerá no radar quando o jogador estiver mais próximo dele. ------------------------------------------------ Em relação ao código: Não entendi a necessidade de vc criar uma matriz bidimensional para colocar os markers, blips e veículos. Mas como isso parece estar funcionando, nem tentei mudar isso. Preste atenção nas cores que vc usa no seu outputChatBox. Não há necessidade de colocar um código #HEX no início do texto se você pode colocá-lo direto nos parâmetros da função. Isso é questão de otimização. Ex: outputChatBox ("#FF0000Texto em vermelho #00FF00e verde.", thePlayer, 255, 255, 255, true) -- Errado. outputChatBox ("Texto em vermelho #00FF00e verde.", thePlayer, 255, 0, 0, true) -- Certo. Ambos vão enviar isso: Texto em vermelho e verde. Sua função de onVehicleExit está parando de executar na metade pois você colocou uma condição impossível de validar. Depure essa função colocando alguns print por ela, dessa maneira: (precisa estar com o /debugscript 3 ligado, como sempre) function sairVeh (elemento) local meuCarro = false print ("01") -- Coloque alguns desses pela função, para usar como depurador de código e saber onde ele está parando. if elemento and isElement(elemento) and getElementType(elemento) == "player" and tabela[elemento] and tabela[elemento]["carro"] then print ("02") if source == vehicle then -- vehicle não foi declarado em lugar nenhum, ele nunca vai passar daqui. (source ~= null) print ("03") meuCarro = vehicle end end if not meuCarro then return end -- Sempre vai parar aqui e não vai nem executar o resto. Pois meuCarro sempre será false. print ("04") if not isTimer (globalTimer[meuCarro]) then print ("05") outputChatBox ("ATENÇÃO: #8E8E8ERetorne para o veiculo da fazenda em 1 minuto, senão, perderá o trabalho!", elemento, 255, 0, 0, true) globalTimer[meuCarro] = setTimer (function() print ("06") destroyElement (meuCarro) end, 20000, 1) else print ("07") resetTimer (globalTimer[meuCarro]) end end addEventHandler ("onVehicleExit", root, sairVeh) Resultado da depuração: 01 02 Ele não chegou a ler do 03 em diante. Então significa que depois do 02 e antes do 03, houve algum problema. Esse problema não aparece de cara no /debugscript 3 pois não é um problema de sintaxe.
    1 point
  36. Sooo...there has been MASSIVE progress today! As of right now, we have been able to combine nearly all of the code projects thus far into one solution in Visual Studio 2017, which are compiling with absolutely NO errors, and only 3 warnings! (We're in the process of fixing one as we speak). Two of them are related to bugs we have to fix in MTAClient yet. To give everyone a better understanding, this code was originally created in Visual C++ 6.0, circa 2003-2005, and had to be converted numerous times over the years to get where we are now. In the process, numerous bugs and bad/experimental coding issues were found, and a multitude of literally THOUSANDS UPON THOUSANDS of errors and warnings were produced by modern compilers. The entire project also had very little to no documentation for us to go by, and A LOT of the code made absolutely no sense whatsoever, so tracing problems was extremely difficult! This project has come a VERY long way considering everything. Now I won't reveal much more right now, but be aware that there are huge changes coming soon! That being said, I'd also like to give a quick congratulations to Zurix, who has decided to take on a Developer role instead of simply just testing out our builds! Glad to have you aboard, buddy! For now, have fun everyone, and quit playing with yourselves!
    1 point
  37. في موقع اجنبي يبيع اداة لتهكير الايمبوت واشياء ثانية بس ياخذ منك رسوم كل شهر 30 درلار
    1 point
  38. طيب وش المشكلة لو رقصت كيكي؟, مافيها شيء الواحد يستمتع بحياته
    0 points
  39. You can add the stats to scoreboard like this; for _,v in ipairs({"Best Drift","Total Drift","Last Drift"}) do exports["scoreboard"]:addScoreboardColumn(v) end Calculate the drift scores on client, insert it to scoreboard and save the personal topscore to db (in this case preferably sqlite); connection = Connection("sqlite",":/drifttab.db") connection:exec("CREATE TABLE IF NOT EXISTS records (username TEXT, playername TEXT, score NUMBER)") Rather than a vast set of scripting functions, the code used to calculate/detect drifting is more utility-like. It's hard to point it out without looking at the complete picture, so I will just post the code of a recent drifting score resource; (you can study it to see how it calculates drifting scores) CLIENT: local screenWidth,screenHeight = guiGetScreenSize() local score = 0 local combo = 0 local multiplier = 1 local failDrift = false local size = 0.9 local fps = getFPSLimit() local vehicle local inVehicle = false local multipliers = { {100000,5}, {50000,4}, {25000,3}, {10000,2}, {0,1}, } local textX = screenWidth/2 local textY = screenHeight/4 local lineY = 45 local textScale = 0.95 local red = tocolor(255,0,0) local green = tocolor(0,255,0) local font = "bankgothic" local alignX = "center" local alignY = "center" local gui = {} local allowedType = { ["Automobile"] = true, ["Quad"] = true, ["Monster Truck"] = true, } local forcedEvents = { ["onClientElementDestroy"] = true, ["onClientPlayerWasted"] = true, } local function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1 %2') if ( k==0 ) then break end end return formatted end local function checkVehicleHandling() local flags = getVehicleHandling(vehicle)["handlingFlags"] if (bitAnd( flags, 32 ) == 32) or (bitAnd( flags, 64 ) == 64) then return true end end local function driftEnd (endscore,endcombo) local oldBestDrift = getElementData (localPlayer,"Best Drift") or 0 local oldTotalDrift = getElementData (localPlayer,"Total Drift") or 0 score = 0 combo = 0 if endscore ~= 0 then setElementData(localPlayer,"Total Drift",math.floor(endscore+oldTotalDrift)) setElementData(localPlayer,"Last Drift",math.floor(endscore)) end if endscore > oldBestDrift then setElementData(localPlayer,"Best Drift",endscore) end if endscore >= 2000 then triggerServerEvent("onDriftEnd",localPlayer,endscore) triggerEvent("onClientDriftEnd",localPlayer,endscore) end end local function calculateAngle () if not allowedType[vehicle.vehicleType] then return 0,0 end if not isVehicleOnGround(vehicle) then return 0,0 end if failDrift then return 0,0 end local vx,vy,vz = getElementVelocity(vehicle) local rx,ry,rz = getElementRotation(vehicle) local sn,cs = -math.sin(math.rad(rz)), math.cos(math.rad(rz)) local speed = (vx^2 + vy^2 + vz^2)^(0.5) local modV = math.sqrt(vx*vx + vy*vy) local cosX = (sn*vx + cs*vy)/modV if modV <= 0.2 then return 0,0 end if cosX > 0.966 or cosX < 0 then return 0,0 end return math.deg(math.acos(cosX))*0.5,speed end local function updateFPS(msSinceLastFrame) fps = (1 / msSinceLastFrame) * 1000 end local function resetFail() failDrift = false showScore=false end local function onCollide(attacker) if attacker or failDrift then return end failDrift = true driftEnd(0,0) setTimer(resetFail,2000,1) end local function drawMeter () if isWorldSpecialPropertyEnabled("hovercars") then return end if checkVehicleHandling() then return end if localPlayer.vehicle ~= vehicle then removeEventHandler("onClientVehicleDamage",vehicle,onCollide) removeEventHandler("onClientElementDestroy",vehicle,checkVehicle) removeEventHandler("onClientPlayerWasted",localPlayer,checkVehicle) removeEventHandler("onClientRender",root,drawMeter) removeEventHandler("onClientPreRender", root, updateFPS) vehicle=nil inVehicle=false checkVehicle() return end local angle,speed = calculateAngle() if isTimer (resetTimer) and angle ~= 0 then killTimer(resetTimer) showScore = true if comboReady then combo = combo + 1 comboReady = false end end if angle == 0 then if not isTimer(resetTimer) then comboReady = true resetTimer = setTimer (function() if score == 0 then return end driftEnd (score,combo) score = 0 combo = 0 showScore = false end,1300,1) end end local gameSpeed = getGameSpeed() for k,v in ipairs(multipliers) do local pointsNeeded,multi = unpack(multipliers[k]) if score > pointsNeeded then multiplier = multi break end end local fpsMultiplier = 100/fps local angleScore = angle/2 local speedScore = speed*3 local driftScore = angleScore*speedScore local addScore = math.floor(driftScore*multiplier) local gameSpeedFixedScore = math.floor(gameSpeed*addScore) score = score + math.floor(fpsMultiplier*gameSpeedFixedScore) if showScore then local color = (failDrift and red or green) dxDrawText ("Drift points x"..tostring(combo),textX,0,textX,textY-lineY,color,textScale,font,alignX,alignY) dxDrawText (score,textX,0,textX,textY,color,textScale,font,alignX,alignY) end end function checkVehicle(vehicleEntered) local isForcedFalse = forcedEvents[eventName] ~= true if localPlayer.inVehicle == inVehicle and isForcedFalse then return end local tempVehicle = vehicleEntered or getPedOccupiedVehicle(localPlayer) local seat = getPedOccupiedVehicleSeat(localPlayer) inVehicle = ((seat == 0 and allowedType[tempVehicle.vehicleType]) and (isForcedFalse and localPlayer.inVehicle or false) or false) if inVehicle and seat==0 then vehicle = tempVehicle addEventHandler("onClientVehicleDamage",vehicle,onCollide) addEventHandler("onClientElementDestroy",vehicle,checkVehicle) addEventHandler("onClientPlayerWasted",localPlayer,checkVehicle) addEventHandler("onClientRender",root,drawMeter) addEventHandler("onClientPreRender", root, updateFPS) elseif not inVehicle and vehicle then removeEventHandler("onClientVehicleDamage",vehicle,onCollide) removeEventHandler("onClientElementDestroy",vehicle,checkVehicle) removeEventHandler("onClientPlayerWasted",localPlayer,checkVehicle) removeEventHandler("onClientRender",root,drawMeter) removeEventHandler("onClientPreRender", root, updateFPS) vehicle=nil end end local function loadRecords(records,maxPosition,myAcc) guiSetText(gui.window,"Top "..tostring(maxPosition).." drifters") guiGridListClear(gui.list) local guestID = 0 for position,record in ipairs(records) do local player,score,name,isGuest = record.username,record.score,record.playername,record.isGuest if isGuest == "true" then guestID=guestID+1 if myAcc == "guest" then myAcc = hash("sha512",getPlayerSerial()) end end local row = guiGridListAddRow(gui.list,"#"..tostring(position).." "..name,(isGuest == "true" and "guest_"..tostring(guestID) or player),convertNumber(score)) if player == myAcc then guiGridListSetItemColor(gui.list,row,gui.namecolumn,0,255,0,255) guiGridListSetItemColor(gui.list,row,gui.usercolumn,0,255,0,255) guiGridListSetItemColor(gui.list,row,gui.scorecolumn,0,255,0,255) end end end local function toggleGUI() local isVisible = guiGetVisible(gui.window) if isVisible then guiSetVisible(gui.window,false) showCursor(false) else guiSetVisible(gui.window,true) showCursor(true) end end local function initScript() addEvent("onClientDriftEnd",false) addEvent("Drift:loadRecords",true) gui.window = guiCreateWindow(0.35,0.15,0.3,0.7,"",true) gui.list = guiCreateGridList(0,0.05,1,0.95,true,gui.window) gui.namecolumn = guiGridListAddColumn(gui.list,"Player",0.4) gui.usercolumn = guiGridListAddColumn(gui.list,"User",0.3) gui.scorecolumn = guiGridListAddColumn(gui.list,"Score",0.2) guiGridListSetSortingEnabled(gui.list,false) guiSetVisible(gui.window,false) bindKey("F5","down",toggleGUI) checkVehicle() addEventHandler("Drift:loadRecords",localPlayer,loadRecords) addEventHandler("onClientPlayerVehicleEnter",localPlayer,checkVehicle) addEventHandler("onClientPlayerVehicleExit",localPlayer,checkVehicle) triggerServerEvent("Drift:scriptLoaded",localPlayer) end addEventHandler("onClientResourceStart",resourceRoot,initScript) SERVER: local connection local driftRecords = {} local loadedClients = {} local recordListMaxPosition = 50 local excludedUsernames = -- Add accountnames of who you want to blacklist from ranking, like to prevent players tracking (undercover) admins through F5 (current nick + username) { ["Adminusername1"] = true, ["Test2"] = true, } local function comp(a,b) return a.score > b.score end local function checkDriftRecord(score) if not client.account then return end if excludedUsernames[client.account.name] then return end local acc = (client.account.name~="guest" and client.account.name or hash("sha512",client.serial)) local name = client.name local oldJSON = toJSON(driftRecords) local isGuest = tostring(isGuestAccount(client.account)) if driftRecords[#driftRecords] == nil or (score > driftRecords[#driftRecords].score or #driftRecords < recordListMaxPosition) then local existingPosition = false for position,record in ipairs(driftRecords) do if record.username == acc then existingPosition = position break end end if existingPosition and score > driftRecords[existingPosition].score then driftRecords[existingPosition].score = score driftRecords[existingPosition].playername = name elseif not existingPosition then table.insert(driftRecords,{username=acc,score=score,playername=name,isGuest=isGuest}) end else return end table.sort(driftRecords,comp) if #driftRecords > recordListMaxPosition then for position=recordListMaxPosition+1,#driftRecords do driftRecords[position]=nil end end if oldJSON == toJSON(driftRecords) then return end for player,_ in pairs(loadedClients) do triggerClientEvent(player,"Drift:loadRecords",player,driftRecords,recordListMaxPosition,player.account.name) end connection:exec("DELETE FROM records") for position,record in ipairs(driftRecords) do connection:exec("INSERT INTO records VALUES (?,?,?,?)",record.username,record.playername,record.score,record.isGuest) end end local function recheckPlayer() triggerClientEvent(source,"Drift:loadRecords",source,driftRecords,recordListMaxPosition,source.account.name) end local function resetPlayer() loadedClients[source] = nil end local function clientLoaded() if source~=client then return end triggerClientEvent(client,"Drift:loadRecords",client,driftRecords,recordListMaxPosition,client.account.name) addEventHandler("onDriftEnd",client,checkDriftRecord) loadedClients[client] = true addEventHandler("onPlayerLogin",client,recheckPlayer) addEventHandler("onPlayerLogout",client,recheckPlayer) addEventHandler("onPlayerQuit",client,resetPlayer) end local function initScript() connection = Connection("sqlite",":/drift.db") connection:exec("CREATE TABLE IF NOT EXISTS records (username TEXT, playername TEXT, score NUMBER, isGuest TEXT)") local handle = connection:query("SELECT * FROM records") driftRecords = handle:poll(-1) addEvent("Drift:scriptLoaded",true) addEvent("onDriftEnd",true) addEventHandler("Drift:scriptLoaded",root,clientLoaded) for _,v in ipairs({"Best Drift","Total Drift","Last Drift"}) do exports["scoreboard"]:addScoreboardColumn(v) end end addEventHandler("onResourceStart",resourceRoot,initScript) The code originates from https://community.multitheftauto.com/index.php?p=resources&s=details&id=14911, and this resource is a little different from your wishes; it does not persistently store the scores to scoreboard, but to a GUI located in F5 rankings, and moreover it offers this storing system which you didn't mention at all. It should be easy to adapt the code a little so that it saves only to scoreboard, or you could just take out the core (calculation of drift) and write the rest from scratch to your desires. Even better it would be if you just looked at it so you know how to achieve something like that, and rewrite it. You could also review & decide that the resource fullfills most of your needs and just use it. However, I would recommend you to adapt it or reproduce the utility code so you can write your own resource, in which process you can return here with any issues you stumble upon while doing so. I hope this gave you some insights on how to achieve it
    0 points
×
×
  • Create New...