Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 30/03/19 in all areas

  1. Eu n entendi nada que ele disse '-'
    1 point
  2. actually if you don't know both of them, i'd say go with XML for now. and here is an example
    1 point
  3. كفوووووووووووووووووووو شكرااااااا افدتني كثير
    1 point
  4. يعتبر انتقاد بناء اكثر من هو استنقاص ولكن في النهاية الحق ينقال, مافي سيرفر يستاهل المدح الا قلة منهم كيف تبينا نتطور دام نذب عليه وابل من المدح وهو ماسوى شيء !؟ مايحتاج اكرر همم انا عندي افكار ونفذت بعضها في السيرفرات وعندي مشاريع مستقبلية ولكن في عندي ضيق في الوقت وان شاء الله بينفرج قريب عالعموم الي مايعرفون البرمجة = مايعرفون المنطق فيقترحون اقتراحات غير قابلة للتنفيذ (بسبب اللعبة واجراءاتها الأمنية وكذلك امكانياتها الضعيفة) فلذلك تجد قلة من المبرمجين يسوي مشاريع قوية فيتم الغائه بسبب اللعبة بحد ذاتها او لصعوبة التنفيذ وضيق الوقت موضوعك جميل ولكن الاجابات واضحة لو بحثت عنها اكثر
    1 point
  5. TimeWaitSet [ getPlayerSerial ( source ) ] بـ TimeWaitSet [ source ] استبدل بس يطفي السكربت سوي لوب على قاعد البيانات جيب جميع السريالات وسوي تحقق اذا فيه تايمر على السريال تحدث القيمة وتوقف التايمر واذا اشتغل السكربت لوب على قاعد البيانات جيب جميع السريالات سوي تايمر على السريال ومدة التايمر بتكون مخزنة بالقاعدة تستخرجها onPlayerQuit + onPlayerLogin = delete
    1 point
  6. I noticed that I haven't gave you an useful examples. @majqq Well here you have an example of: B In OOP. Not MTA OOP, which I do not like, but pure Lua OOP. And see how the magic does it's job. local newTable = enchantedTable:create() newTable:add({type = "yes", 1, 2, 3, 4}, {type = "no", 5, 6, 7, 8}, {type = "no", 5, 6, 7, 8}) -- add three items local collection = newTable:get() -- get the whole collection print(collection[1]) -- get the first print(collection[2]) -- get the second print(collection[3]) -- get the third -- Getting the result of the item records. print("all: ", newTable:count()) -- count all: 3 print("`yes`: ", newTable:count("yes")) -- count only type `yes`: 1 print("`no`: ", newTable:count("no")) -- count only type `no`: 2 newTable:remove(2) -- remove item 2. print("`no`: ", newTable:count("no")) -- count only type `no`: 1 When using this code you can easy extend functionality a long the way. Just adding methods to the methods-table and new functionality opens up to you. But remember, do not modify the collection (of the items) without using these functions, or the registration will not be able to get track of the item count.
    1 point
  7. XML has most of the cons. It is also much older, so it is to be expected. There are a few XML haters on the community, so I will keep it short. So a few pro's: - Readability is very high, especially in case of inheritance. In JSON that can also be good, but you will need a proper reader for that. - Maintenance. In case of breaking it, it is very easy to fix it. (That being said, it breaks easier if you do not know the rules.) - Saving JSON inside the notes and keeping a secondary XML layer of properties that do not have to be saved in your main data. There are not many user cases where you want that on clientside. Unless you have a shared settings file for all resources. In that case you only have to parse JSON of a specific resource node. - (not related to player settings) Can be use for multiple files that are already integrated in mta. XML, map, (acl*) So JSON? Yes, if you keep your lua table it's structure: arrays and object separated.
    1 point
  8. test it client.lua: SHADER_CODE = [[ texture GrayscaleTexture; sampler screenSampler = sampler_state { Texture = <GrayscaleTexture>; }; float4 main(float2 uv : TEXCOORD0) : COLOR0 { float4 Color; Color = tex2D( screenSampler , uv); Color.rgb = round((Color.r+Color.g+Color.b)*10.0f)/30.0f; Color.r=Color.rgb; Color.g=Color.rgb; Color.b=Color.rgb; return Color; }; technique Grayscale { pass P1 { PixelShader = compile ps_2_0 main(); } } ]] local scx,scy = guiGetScreenSize() local screenSource = dxCreateScreenSource(scx,scy) local shader = dxCreateShader(SHADER_CODE) addEventHandler('onClientHUDRender', root, function() dxUpdateScreenSource(screenSource, true) dxSetShaderValue(shader, 'GrayscaleTexture', screenSource) end ); addEventHandler('onClientRender', root, function() dxDrawImage(0,0,scx,scy,screenSource) end );
    1 point
  9. فكرتك حلوة بس في شوية اخطاء 1 - ما يصير تلزق النقط لازم تسوي فاصل tempStr = tostring(0..digit) 2 - بدل ما تعرف كل دالة لحالها باللوكل تقدر تيجي في اول السكريبت وتسوي كدا اسهل function addZero( str ) local arg1 , arg2 , arg3 , etc 3 - string.gmatch --> علي حد علمي ان هي ترجع فنكشن مب تيبل بالتوفيق function addZero (str,sign) local Table if( ( str and sign ) and ( string.find( tostring( str ) , tostring( sign ) ) ) ) then Table = split( str , sign ); for index = 1 , #Table do Table[ index ] = 0 .. Table[ index ] end return table.concat( Table , sign ) end return false end -- Example -- print( addZero( "2:5" , ":" ) ) -- 02:05 print( addZero( "1,8" , "," ) ) -- 01,08
    1 point
  10. guiCreateEdit 'onClientGUIClick' or 'onClientGUIAccepted' guiGetText and setTimer
    1 point
  11. No saudi not arabic: Arabic: العربية Saudi: ةيدوعسلا
    1 point
×
×
  • Create New...