Jump to content

Rockyz

Members
  • Posts

    1,862
  • Joined

  • Days Won

    8

Everything posted by Rockyz

  1. بسم الله الرحمن الرحيم string.toTable or itemsToTable الوضيفة واضحة من الأسم تحويل السترنق الى تيبل الفنكشن عكس الفنكشن الي فوق _________________________________ string.toTable Syntax : string.toTable ( string textString, string separatingChar ) _________________________________ itemsToTable Syntax : itemsToTable ( mixed arguments... ) _________________________________ string.toTable Source Code : function string.toTable ( str, char ) assert ( type ( str ) == 'string', 'expected table at argument 1 got ' .. type ( str ) ) assert ( type ( char ) == 'string', 'expected string at argument 2 got ' .. type ( char ) ) assert ( char:len ( ) <= 2, 'expected charcter at argument 2 got ' .. char ) local s = { }; local charSplit = split ( str, char ) for k, v in pairs ( charSplit ) do table [ 'insert' ] ( s, v ) end return s; end _________________________________ itemsToTable Source Code : function itemstoTable ( ... ) if ( ... ) then local s = { }; for k, v in pairs ( { ... } ) do table [ 'insert' ] ( s, v ) end return s; end return false end _________________________________ Example ( string.toTable Source Code ) : function string.toTable ( str, char ) assert ( type ( str ) == 'string', 'expected table at argument 1 got ' .. type ( str ) ) assert ( type ( char ) == 'string', 'expected string at argument 2 got ' .. type ( char ) ) assert ( char:len ( ) <= 2, 'expected charcter at argument 2 got ' .. char ) local s = { }; local charSplit = split ( str, char ) for k, v in ipairs ( charSplit ) do table [ 'insert' ] ( s, v ) end return s; end local tablee = string.toTable ( 'FIRST, a, b, c, LAST', ', ' ) -- { 'FIRST', 'a', 'b', 'c', 'LAST' } for _,v in ipairs(tablee)do if(_==1)then print(v..':') elseif(_~=#tablee and _~=1)then print(v..', ') elseif(_==#tablee)then print(v..'.') end end--[[ FIRST: a, b, c, LAST. ]] _________________________________ Example ( itemsToTable Source Code ) : function itemsToTable ( ... ) if ( ... ) then local s = { }; for k, v in pairs ( { ... } ) do table [ 'insert' ] ( s, v ) end return s; end return false end local tablee1 = itemsToTable ( 'a', 'b', 'c' ) -- { 'a', 'b', 'c' } for k, v in ipairs ( tablee1 ) do print ( v ) --[[ a b c ]] end _________________________________ طريقة الأستخدام بسيطة مثلا عندي هذا السترنق ( السورس كود الأول )ء '1;2;3' ابيه يكون على شكل تيبل كذا : table1 = { '1', '2', '3' } نسوي كذا table1 = string.toTable ( '1;2;3', ';' ) -- { '1', '2', '3' } _________________________________ او تقدر تسوي كذا بالسورس كود الثاني : table1 = itemsToTable ( '1', '2', '3' ) -- { '1', '2', '3' }
  2. المود ابداع واصل وحاول تضيف مميزات اكثر وشكرا ع الاهداء
  3. فيه خطأ في المود يمكن في الميتا او يمكن المود مو موجود مود ( scoreboard )
  4. بسم الله الرحمن الرحيم table.toString وضيفة تحويل الجدول الى سترنق Syntax : table.toString ( table theTable, string separatingChar ) source Code : function table.toString ( theTable, char ) assert ( type ( theTable ) == 'table', 'expected table at argument 1 got ' .. type ( theTable ) ) assert ( type ( char ) == 'string', 'expected string at argument 2 got ' .. type ( char ) ) assert ( char:len ( ) <= 2, 'expected charcter at argument 2 got ' .. char ) local m, t = '', { }; for _, v in pairs ( theTable ) do table [ 'insert' ] ( t, v ) end for k, v in pairs ( t ) do if ( k == #t ) then m = m .. v else m = m .. v .. char end end return m; end Example : function table.toString ( theTable, char ) assert ( type ( theTable ) == 'table', 'expected table at argument 1 got ' .. type ( theTable ) ) assert ( type ( char ) == 'string', 'expected string at argument 2 got ' .. type ( char ) ) assert ( char:len ( ) <= 2 and char:len ( ) >= 1, 'expected charcter at argument 3 got ' .. char ) local m = ''; for k, v in pairs ( theTable ) do if ( k == #theTable ) then m = m .. v else m = m .. v .. char end end return m; end local example1 = { 'a', 'b', 'c' }; print ( table.toString ( example1, ', ' ) ) -- a, b, c
  5. قلت لك مايحتاج اكثر من صورة بس استخدم صورة واحدة ليش مسوي im2 im2 im3 im4 بس استخدم صورة واحدة لاتستخدم اكثر من واحدة واحدة تكفي
  6. ليش مسوي هالزحمة تقدر تسوي صورة واحدة وتستخدم guiStaticImageLoadImage بدل انك تستخدم guiSetVisible بشكل متكرر ماشوف انك غيرت شي في كوده
  7. هذا مثال + متأكد انك غيرت احداثيات الشاشة ؟
  8. تعديل بسيط : addEventHandler ( 'onPlayerDamage', root, function ( atk, atkwp, bodypart, loss ) if ( atkwp == 34 ) then if ( bodypart == 9 ) outputChatBox ( 'Head Shot', source, 255, 0, 0, true ) setElementHealth ( source, 0 ) end else if ( bodypart == 9 ) then setElementHealth ( source, getElementHealth ( source ) + loss ) end end end )
  9. getIDFromName = ? جرب كذا : addEventHandler ( 'onPlayerDamage', root, function ( atk, atkwp, bodypart, attacker ) if ( atkwp == 34 and bodypart == 9 ) outputChatBox ( 'Head Shot', source, 255, 0, 0, true ) setElementHealth ( source, 0 ) end end )
  10. عندي اضافة بسيطة بس الي يبي الأخطاء دقيقة في الديبق يستبدل فنكشن addDebug بهذا function addDebug(msg,lv,file,line) if ( lv == 0 or lv == 3 ) then lv = 'INFO : ' elseif ( lv == 1 ) then lv = 'ERROR : ' elseif ( lv == 2 ) then lv = 'WARNING : ' end guiSetText(GUIEditor.memo[2],guiGetText(GUIEditor.memo[2])..lv..msg..' at line '..line..'\n') guiMemoSetCaretIndex(GUIEditor.memo[2],#guiGetText(GUIEditor.memo[2])) end
  11. الطلب الثاني : 'onClientGUIAccepted'
  12. قرأت ردي فوق ؟ https://forum.multitheftauto.com/topic/33407-list-of-predefined-variables/ http://prntscr.com/gogxjn
  13. https://forum.multitheftauto.com/topic/33407-list-of-predefined-variables/ صحيح كلامك مانتبهت كذا يصير الكود : Door = createObject(980,2481.1999511719,-1742.4000244141,15.300000190735,0,0,0) markerDoor = createMarker(2481.1000976563,-1743.0999755859,13.5,'cylinder',12,0,0,0,0) function doorMove ( hitElement ) if ( getElementType ( hitElement ) == 'player' ) then local acc = getPlayerAccount ( hitElement ) if ( not isGuestAccount ( acc ) and isObjectInACLGroup ( 'user.' .. getAccountName ( acc ), aclGetGroup ( 'Console' ) ) ) then if ( eventName == 'onMarkerHit' ) then moveObject ( Door, 1000, 2481.1999511719, -1742.4000244141, 19.799999237061 ) elseif ( eventName == 'onMarkerLeave' ) then moveObject ( Door, 1000,2481.1999511719, -1742.4000244141,15.300000190735 ) end end end end addEventHandler ( 'onMarkerHit', markerDoor, doorMove ) addEventHandler ( 'onMarkerLeave', markerDoor, doorMove )
  14. جرب كذا : Door = createObject(980,2481.1999511719,-1742.4000244141,15.300000190735,0,0,0) markerDoor = createMarker(2481.1000976563,-1743.0999755859,13.5,'cylinder',12,0,0,0,0) function doorMove ( hitElement ) local acc = getPlayerAccount ( hitElement ) if ( getElementType ( hitElement ) == 'player' and not isGuestAccount ( acc ) and isObjectInACLGroup ( 'user.' .. getAccountName ( acc ), aclGetGroup ( 'Console' ) ) ) then if ( eventName == 'onMarkerHit' ) then moveObject ( Door, 1000, 2481.1999511719, -1742.4000244141, 19.799999237061 ) elseif ( eventName == 'onMarkerLeave' ) then moveObject ( Door, 1000,2481.1999511719, -1742.4000244141,15.300000190735 ) end end end addEventHandler ( 'onMarkerHit', markerDoor, doorMove ) addEventHandler ( 'onMarkerLeave', markerDoor, doorMove )
  15. try this : function playerName ( nick, nick1 ) local plrName = ( eventName == 'onPlayerConnect' and nick or ( eventName == 'onPlayerChangeNick' and nick1 ) ) local plrName = plrName:lower ( ); if ( plrName:find 'admin' ) then local plr = ( eventName == 'onPlayerConnect' and getPlayerFromName ( plrName ) or ( eventName == 'onPlayerChangeNick' and source ) ) kickPlayer ( plr, 'admin Tag is banned, please remove it' ) end end function playerName1 ( ) for _, player in ipairs ( getElementsByType 'player' ) do if ( getPlayerName ( player ):lower ( ):find 'admin' ) then kickPlayer ( player, 'admin Tag is banned, please remove it' ) end end end addEventHandler ( 'onPlayerConnect', root, playerName ) addEventHandler ( 'onPlayerChangeNick', root, playerName ) addEventHandler ( 'onResourceStart', resourceRoot, playerName1 )
  16. واصل ماستر /debugscript 3 فنان صح ؟
  17. addEvent ( 'Donen', true ) addEventHandler ( 'Donen', root, function ( ) executeSQLQuery ( 'DROP TABLE aSave' ) executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aSave ( NK, NKC, Serial, Name )' ) triggerEvent ( 'Refresh_', root ) end ) او addEvent ( 'Donen', true ) addEventHandler ( 'Donen', root, function ( ) executeSQLQuery ( 'DELETE * FROM aSave' ) triggerEvent ( 'Refresh_', root ) end ) الأثنين صحيحين
  18. #[9MoD] House System [BETA] By ahmedfef عرض المود هو ماقال انه نشر المود مكتوب انه عرض فقط
  19. على ماضن انه صاحب هالسيرفر
×
×
  • Create New...