Leaderboard


Popular Content

Showing content with the highest reputation on 27/07/17 in all areas

  1. 6 points
    ،وبعض الناس يحاولون يبرمجون مثل هالواجهات لكن تواجهم مشاكل، DX هالأيام كثرت الواجهات الي مصممة بوظائف الـ عشان كذا قررت انشر سكربت برمجته من زمان، لكن أعدت برمجته بالكامل مؤخرًأ ،السكربت راح يعطيك إمكانية تسوي نقاط (مساحات معينة من شاشة اللاعب) أو زر لأكون أوضح (focus لما اللاعب يسوي شيء معين على نقطة، يشتغل حدث بالشيء إلي سواه. مثلا: لما يدخل الماوس النقطة ،أو يضغط على النقطة، أو يركز على نقطة (الـ .طبعا في مميزات أكثر بنشرح أول كيف تستخدمه أولًا، السكربت مبرمج على أنه يكون خارجي exports أو من الجدول call بالوظيفة createPoint عشان تبدأ تستخدمه، تسوي استدعاء للوظيفة createPoint(x, y, width, height, relativeToWidth, relativeToHeight, parent) x, y: الإحداثيات width, height: حجم النقطة relativeToWidth, relativeToHeight: nil مقاس الشاشة المنسوب لها الإحداثيات والحجم (الشاشة إلي سويت بها النقطة) عشان يعدل المقاس لكل الشاشات. الاثنين لازم يكونون ارقام أو اثنينهم parent: أب النقطة. تستخدمه بالغالب عشان تخلي أولوية الماوس والضغط لأولاده لو كان الماوس عليهم (في كل هذي الأحداث هو النقطة نفسها source بعد ما تسوي النقطة، تقدر تستعمل هذي الأحداث عليها (ملاحظة: الـ onClientMouseEnterDP, onClientMouseLeaveDP: لما الماوس يدخل النقطة أو يطلع منها onClientDPClick: لما اللاعب يضغط على النقطة :يجي معه برامترين، هم button: (إذا انضغطت بالزر إلي بالنص (إلي ترفع وتنزل به middle أو right-click إذا كان right ،left-click إذا كان left يعبر عن الزر إلي انضغطت به النقطة. يكون state: إذا كان شايل يده عنه upإذا كان اللاعب ضاغط على الزر و down يكون onClientDPDoubleClick: onClientDPClick بنفس حالة button لما اللاعب يضغط مرتين على النقطة، يجي ببرامتر واحد وهو onClientDPFocus: لما اللاعب يركز على النقطة onClientDPBlur: لما اللاعب يشيل التركيز عن النقطة :السكربت يجي مع وظائف ثانية، عشان لو بغيت تعدل على خصائص النقطة، وهي ذول وظائف واضحين من اسمهم getPointPosition(point) setPointPosition(point, x, y) getPointSize(point) setPointSize(point, width, height) getPointParent(point) getPointCreatorResource(point) isMouseOverPoint(point) isPointFocused(point) :ذول يحتاجون توضيح getPointChildren(point) يرجع جدول فيه عناصر أطفال النقطة setPointEnabled(point, enabled) يفعل نقطة أو يعطلها. لما تعطلها يكون الوضع كأنها مو موجودة وبالتالي تجي لنا هذي الوظيفة isPointEnabled(point) setPointParent(point, parent) الحالي للنقطة (لو كان موجود) وراح يكون بدون أب parent النقطة. الأرقمنت الثاني اختياري، ولو ما حطيته راح يشيل الـ parent توضع bringPointToFront(point, getPropagated) (تقدم النقطة للأمام (النقاط إلي بالأمام دايمًا تكون أولوية الماوس لهم getPropagated: يعبر عن هل أن الوظيفة راح تقدم آباء النقطة بعد ولا لا boolean عبارة عن :للتوضيح validatePoint(point) boolean تتحقق إذا كانت النقطة صالحة، ترجع في وظائف ثانية، وقبل وما نشرحهم لازم نشرح شيء أول السكربت راح ينظم لك رندر النقاط وش يعني؟ لما ترسم مستطيل مثلًا، وبعدين ترسم مستطيل فوقه، المستطيل الثاني راح يطلع عليه مب وراه DX في وظائف الرسم ولأنك تبي النقاط الأولاد يطلعون فوق النقاط الآباء، السكربت ينظم لك هذا الشيء كيف؟ لو افترضت عندك هالنقاط لو جينا نسوي لهم رندر بالترتيب، لازم يكون الترتيب كذا عشان تطلع لنا هالنتيجة Point1, Point2, Point4, Point3 لو غيرت الترتيب وسويته كذا Point2, Point3, Point4, Point1 راح يكون كذا طيب كيف تسوي رندر للنقطة؟ لما لازم تسوي رندر للنقطة DXUI-Controller راح يتم استدعائه من السكربت exported function هالـ ،onPointRender في سكربتك اسمه exported function تحط بجيك برامتر واحد وقت الاستدعاء وهو النقطة إلي المفروض يصير لها رندر لأن لو سويت حدث راح يسبب لاق وبكذا ما راح يكون عملي exported function ملاحظة: خليت الرندر في تقدر تعطل رندر النقطة وتفعله بهالوظيفة setPointRenderingEnabled(point, enabled) أو تتحقق إذا كان مفعل ولا لا isPointRenderingEnabled(point) ملاحظة: الرندر مفعل افتراضيًا (السكربت الوحيد إلي يستدعى وقت رندر النقطة هو السكربت إلي سواها (افتراضيًا تقدر تعدل هذا الشيء بهالوظيفة allowOtherResourcesToRenderPoint(point, allow) (داخله (لو كانت موجودة onPointRender تسمح للسكربتات الأخرى بعمل رندر للنقطة، باستدعاء الوظيفة وتقدر تتحقق إذا كانت هالخاصية مفعلة ولا لا بهالوظيفة doesPointCreatorResourceAllowOtherResourcesToRender(point) ملاحظة: للأسف، لم أجد اسم اطول روابط التحميل النسخة الأصلية النسخة المصغرة
  2. 1 point
    We offer free Game Server Host to our community members! All you have to do is post on our forums! Signing up to http://www.PiratesHosting.com only takes about 10 seconds. Once you have posted 25 posts, you can request a free Game Server. Sign up and claim your free Game Server today! PiratesHosting - One of the best hosting provider in term of affordable price and premium services in performance, offers a low latency worldwide network, enabling you to deploy your service infrastructure in close proximity to your customer base ! pirateshosting.com providing game servers (Free and Paid ) from past 3 years 2017-2020 We provide game servers like MTA SA,Samp And CS1.6 you can check the plans and costs from below links : https://pirateshosting.com/ Free game servers details : MTA AND SAMP For free 1GB Storage provided Up to 30- 500 Slots free No Mysql provided No DDOS protection provided No guarentee of 99% uptime No responsibilty for data loss Europe Locations : France,London ,Amsterdam termination of server and account if found any copyrights ,stolen resources reports ! If you intrested to get a free game server contact me : via discord Storm-Hanma#9704 or use our website to contact us : https://helpdesk.pirateshosting.com/contact.php Cheap cost paid plans : MTA SA PLAN 1 300 Slots 2 GB Storage(SSD Process) Advanced DDOS Protection 1 MYSQL Europe Locations : France,London ,Amsterdam Game Panel provided 24 Hrs support 99% Uptime online Option to add Subaccounts COST : starting from 1.50 Euros /monthly, Semiannually-5Euros , Annually-10Euros Visit here to check more plans for mta sa https://helpdesk.pirateshosting.com/cart.php?a=confproduct&i=1 Note : Leaked resources ,stolen resources ,copyrights issues not allowed to upload in our mta sa servers it may lead to termination of account and game server without any money refund ! We thank our sponsor for being with us from past years https://evolution-host.com/ want to reach us Join Pirateshosting.com discord channel : https://discord.com/invite/bR5CEN5 Quick FAQ's (Frequently asked questions) [/b] 1. How to Request free game Server? A: When you reach minimum Requirements goto "Game Server Request" section create new thread use format. fill the formats question and post your thread. Our Admin reply you as soon as possible. 2. How to keep Warning Level 0%? A: Make sure your post is legally. don't post Adult things, don't spam. any abuse post can make your account Upto 90% Warning OR 100% means permanent Banned. 3. Is This Website provide free shared Hosting too? A: well yes but not yet. as soon as possible for us we'll. Yet we need developers. 4. I can Become staff member on PiratesHosting? A: Ofcourse, Staff seats are available such as (Live Chat Agent, Administrator, Web-Developer, Server-Developer,) Watch the video how to get free server : https://youtu.be/sT2sDF6qxy8 Join official discord channel : https://discord.gg/DnZh5Cr 5/7/2018: Updates : ogp game panel support added! Europe locations available ! Up to 500 slots for free !
  3. 1 point
    APPENDIX DATA SYNCHRONIZATION. What is it? MTA's synchronization methods. Optimization tips. DATA SYNCHRONIZATION 1. What is it? Since unmemorable times humanity have faced problems caused mainly due to the storage of different ideas in almost each human. But thank God, machines storage methods are different and they have the possibility of having stored the same values in more than 100 machines. Well this is great, but those values must be set by someone, and here's where the server-side and client-side can be used as example of data synchronization. The server-side store's all the values given by each client-side and give's back those values to the all the client-sides ending up into something like this ( Figure 1 ). This is a way to get the same data in all the client-side, but there's also other methods well known like P2P. Figure 1. 2. MTA's synchronization methods. Since data sync it's a base element of every multiplayer game or mod, MTA is not an exception. That's why MTA scripting interface gives us two core ways to sync the server data with the client data or client data with server data. Well this two methods are the following one's. Element Data, it consists of assigning values to an element that are being stored under a key ( the key usually being a string like "health" ). This way is being used by a great amount of scripters in MTA because it's easy to use. But there are also negative points if this way is not being used properly like saving small amount of data in just one key and syncing it with the server or client's. An example of it would be: [[--CLIENT.LUA--]] local value = 0 local function handleStart() value = getTickCount() -- WE GET THE TIME THE SERVER HAS BEEN WORKING WHEN THE RESOURCE START setElementData( localPlayer, "start_tick", value, true ) -- WE SAVE THE 'value' VARIABLE INTO THE 'localPlayer' ELEMENT WITHIN THE KEY 'start_tick' AND WE SYNC IT TO GET THIS DATA TO THE SERVER. end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), handleStart ) [[--SERVER.LUA--]] local function handleCMD( thePlayer ) local mineTick = getElementData( thePlayer, "start_tick" ) -- WE RETRIEVE THE DATA, THAT HAS BEEN SAVED INTO 'thePlayer' DATA. local resultTick = getTickCount() - mineTick -- GET HOW MUCH TIME HAS PASSED SINCE THE RESOURCE STARTED FOR THE PLAYER outputChatBox( resultTick, thePlayer ) -- PRINT INTO THE CHAT THE RESULT end addCommandHandler( "mytime", handleCMD ) -- IN CASE YOU WANT TO TRY IT SAVE THE CODE WITH THE NAME MARKED ABOVE THEM. [[--META.XML--]] <meta> <script src="server.lua" type="server"/> <script src="client.lua" type="client"/> </meta> Events, this method is the one that elementData's one bases on, which means this is a 'rawer' method which can also be faster than elementData if it's being used efficiently. An event is just a message that's being send to one or various systems, if these systems handle the message then when the message is sent to the system there's a trigger which calls the functions that are defined like a reaction to that message that has been sent. It's pretty easy to understand, just think of this. You say hello to someone, the message in this case is 'Hello' and the system where is pointed to mainly is the person, the person gets the message and handles it by calling some cognitive functions, these functions at their time trigger another message as result which in the most common case would be 'Hello' or just a strange face motion because he or she doesn't know you. Maybe you will ask yourself about what does a hello to someone have to do with Events in MTA. Well let's convert the situation above into script. We've got to define first the message by using addEvent( "Hello" ), good we have defined our message, but if we stop here then we have made some useless stuff that's not going to be used ever, that's why we have to use this message somewhere and here is when we simulate the action of saying something the message by using triggerEvent( "Hello" ) but... wait who's supposed to say the message? Let's make it look like the localPlayer was saying the message so it would be like triggerEvent( "Hello", localPlayer ), okay we have said the message but do we talk alone? Maybe but it's not pretty normal, so we must find a receptor which in this case will be a ped so we add the a ped to the game by using createPed( 0, 105, 20, 5.5 ) supposing we are located in the position 104, 20, 5.5. Okay we have the receptor now but it won't answer to our message so let's obligate him to answer us by adding a handler for the message to the ped like this addEventHandler( "Hello", thePed ), okay but this way it will do the same as we wouldn't have used addEventHandler that's why we need to pass also a function to call like an argument which in this case is going to be called 'answerToHello' and we would finish up with addEventHandler( "Hello", thePed, answerToHello ). All this and little bit more of code below for simulating an answer to hello from a person in a non-realistic way. [[--CLIENT--]] -- EVENTS addEvent( "Hello", false ) -- LET'S MAKE IT LIKE JUST THE CLIENT CAN TRIGGER IT SO WE MAKE SURE JUST WE ARE GOING TO TALK TO THE PED -- VARIABLES local thePed = createPed( 0, 105, 20, 5.5 ) -- WE ADD THE PED SO WE DON'T FEEL LONELY -- FUNCTIONS -- SAY HELLO local function sayHello() -- THIS FUNCTION WILL BE USED TO SEND UP THE MESSAGE TO THE PED triggerEvent( "Hello", thePed ) -- WE SAY HELLO TO THE PED end -- ANSWER local function answerToHello() -- WE DEFINE THE MESSAGE HANDLER SO WE MAKE SURE THE PED ANSWERS TO US outputChatBox( "Hello to you too!" ) -- THE PED GET'S THE MESSAGE AND GIVES US BACK A MESSAGE THAT WE CAN CHECK INTO THE CHAT. end -- COMMANDS addCommandHandler( "sayit", sayHello ) -- WE'VE GOT TO SAY SOMEHOW HELLO TO THE PED SO LET'S USE A COMMAND -- EVENT HANDLERS addEventHandler( "Hello", thePed, answerToHello ) 3. Optimization tips. Well both methods can be used in large development but there are some tips you can follow to make sure your script will run in an efficient way. Pack reasonable amount of data into one's element data key, don't save values like ( health, armor, money ) into different keys, compress them into an only one by using tables, by using this method we pass 3 values packed in one sync meanwhile separating each value with one key creates upon 3 different syncs which would end up in a greater amount of packets sent between the server and the client. This tip can be used for both methods [ elementData, Events ]. local basic_data = { health = 100, armor = 100, money = 100 } -- COMPRESSED PLAYER INFO setElementData( thePlayer, "main", basic_data, true ) -- WE GIVE 3 DIFFERENT VALUES TO 'main' KEY BY USING JUST A VARIABLE THAT'S A TABLE 'basic_data' triggerClientEvent( thePlayer, "onSync", thePlayer, basic_data ) -- WE SEND A MESSAGE TO THE CLIENT IN ORDER TO MAKE IT SYNC THE DATA OF THE PLAYER TO THE ONE THAT IS BEING STORED IN THE SERVER Lua is a garbage collection language so the reduce the amount of global variables as much as possible in order to make it run faster. Hope you enjoyed the tutorial, if you have any question just feel free to ask it in this post or by PM, Skype ( killer.68x ) or Email ( simple01@zoho.com ) or Discord ( Simple01#1106 ).
  4. 1 point
    Menkää t ö i h i
  5. 1 point
    That's wrong. It should be this way: local pickupA = createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 ) local pickupB = createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 ) You can also do like this: local pickupA, pickupB = createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 ), createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 )
  6. 1 point
    Try addEventHandler ( "onPickupHit", root, aa )
  7. 1 point
    الفرق أن النسخة الأصلية هي النسخة إلي برمجت عليها، أكواد السكربت مرتبة وكل جزء محطوط بملف خاص به أما المصغرة، كل شيء في ملف واحد لكل جانب والأكواد كلها في سطر ومصغر بشكل عام بالنسبة لتفوقت على الآخرين، ما حبيت هالجملة صراحة، لأنها مهينة للبعض بس شكرا على مرورك
  8. 1 point
    النسخة المصغرة مصغرة والنسخة الأصلية أصلية
  9. 1 point
    Сила Lua - в таблицах. Имей ввиду что индекс первого элемента таблицы начинается с 1 а не с 0 как во многих языках программирования. http://www.lua.ru/doc/5.6.html Математика везде используется. Готовые функции помогают улучшить восприятие кода. https://wiki.multitheftauto.com/wiki/Category:Useful_Functions Тут пользовательских функций полно, во многих случаях позволяют не углубл*ться в высшую математику, аля матрицы шматрицы. Для интеграции с веб сервером можно использовать https://wiki.multitheftauto.com/wiki/PHP_SDK Для стандартизированной мультиязычностиязычной системы можно использовать например https://www.transifex.com/. Рекомендую изначально исходный язык делать английским. Так как в будущем проще будет на остальные языки перевести. Создай страницу на https://github.com/. Совместно с другими разрабатывай скрипты. Часто в OpenSource проектах единомышленники интерес проявляют. За одно ошибки поправят твои, да и труды твои не пропадут на случай если забросишь это дело.
  10. 1 point
    No. You need to make a new timer. Completely separate from the other one. addEventHandler( "onResourceStart", resourceRoot, function( ) setTimer( function( ) -- Function to execute -- Put the code in here end, 1000 * 60 * 5, -- Time in milliseconds (5 minutes) 0 -- Times to repeat (0 = forever) ) end )
  11. 1 point
    استخدم "onAccountDataChange" triggerClientEvent guiSetText افضل من التايمر
  12. 1 point
    You should make a timer using setTimer and then have that set to 1000 * 60 * 5 so it runs every 5 minutes. In there you can basically just copy paste the code from the manual respawn script like so: local vehicles = getElementsByType( "vehicle" ) for i, v in ipairs( vehicles ) do local _, occupant = next( getVehicleOccupants( v ) ) if ( not occupant ) then respawnVehicle( v ) end end
  13. 1 point
    الله يعطيك العافية ي بعدي مشكور
  14. 1 point
    local sx, sy = guiGetScreenSize () local px, py = 1600, 900 local x, y = ( sx / px ), ( sy / py ) addEventHandler ( "onClientHUDRender", root, function () if getPedControlState ( "aim_weapon" ) then local target = getPedTarget ( localPlayer ) if target then if getElementType ( target ) == "player" then local posX, posY, posZ = getPedBonePosition ( target, 8 ) local screenX, screenY = getScreenFromWorldPosition ( posX, posY, posZ ) if screenX and screenY then dxDrawText ( "Текст заменить на картинку", screenX, screenY, screenX, screenY, tocolor ( 255, 255, 255, 200 ), x * 1.4, "default-bold", "center", "center", false, false, true, true, false ) end end end end end )
  15. 1 point
    تقدر تكتفي ب html+css اسهل وافضل+ تقدر تستخدمهم الاثنين دداخل php كمثال <?php print "<p style='color:red;'>Roses are $colo</p>"; print "<br>"; print "<p style='color:red;'>Roses are $color</p>"; ?> كذا بيعطيك اللون الاحمر وبيحطها على اساس انها برجراف
  16. 1 point
    ي حبيب ماهو تحدي ترا تخديي !! بحرف الخاء المرسومة على السطر ,, بس شغله وايد يتعب مافيني حيل اتعب : ( - لعيون نصور هاللهجة
  17. 1 point
  18. 1 point
    Now i just realised that it is only works on server So @IIYAMA i will use your solution. Thank you
  19. 1 point
    Hey Guys! After a long time, I finally got the map! Today I present to you this good simple map and easy to pass! .. I hope you like it and enjoy! ••Video••»Supremacy II••Music••»Nutronic - Digital UniverseMusic used for entertainment only, under copyright disclaimer section 107.••Game••MTA San Andreas http://www.mtasa.com»Infernus mod : Micra v5»Lights made by: Nitron»Ultrathing»Subscribe please !!»I hope you like the video.••Want to record your map?••»Contact Me:»Skype: quartztvRegards KATGE
  20. 1 point
    Update-first 10 users will get free MTA sa server without requirements claim ur free server !!
  21. 1 point
    You should be able to change it yourself. See this topic for more details:
  22. 1 point
    Space_Unicorn, Держи, может пригодится, углы поворота объектов уже указаны в эйлерах. не в кватернионах.
  23. 1 point
    Este es un problema sorprendente tanto por lo común que se ha vuelto como por el poco interés que las páginas como ésta ponen en ayudar a su arreglo. MTA es el único juego en línea que sencillamente no puedo jugar por este condenado problema que viene con lo clásico: Aparecen 5000 servidores en la lista, la mayoría sin latencia y, pasados unos segundos, comienzan a desaparecer. Aún seleccionarlos antes es inútil pues son inaccesibles por el "error cc23 tiempo expirado". He desinstalado MTA y colocado la correspondiente copia sacada de la página unas cinco veces, eso no sirve. Lo he probado con dos GTA, eso no sirve. Mi conexión me permite jugar en línea y ver Netflix (que chupa mucha banda ancha) al mismo tiempo sin apenas problemas. El problema es MTA y me vuelve loco gente; 20,000 jugadores en 5,000 servidores y no puedo jugar por esto.
  24. 1 point
    Hey, i make carshop system new button "token" with buy car. If you have token you can buy car with him, please help with this. client side: if itemID == 300 then gui["btnCoin"] = guiCreateButton(232, 140, 105, 41, "Redeem token", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["btnCoin"], carshop_buyCar_click, false) guiSetEnabled(gui["btnCoin"], coinEnabled) else gui["btnCash"] = guiCreateButton(10, 140, 105, 41, "Pay by cash", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["btnCash"], carshop_buyCar_click, false) guiSetEnabled(gui["btnCash"], cashEnabled) end function carshop_buyCar_click() if exports.global:hasSpaceForItem(getLocalPlayer(), 3, 1) then local sourcestr = "cash" if (source == gui["btnBank"]) then sourcestr = "bank" elseif (source == gui["btnCoin"]) then sourcestr = "coin" end triggerServerEvent("carshop:buyCar", theVehicle, sourcestr) else outputChatBox("You don't have space in your inventory for a key", 0, 255, 0) end carshop_buyCar_close() end server side: elseif (paymentMethod == "coin") then if itemID == 300 and costCar < 15000 then if isOverlayDisabled then outputChatBox("Token 15'000$ you dont have token with up to 15'000$!", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "Wrong token - 15'000$", "Token 15'000$ you dont have token with up to 15'000$!") end else takeItemFromSlot(client, 300) end Please help me!