Jump to content

#CroSs

Members
  • Posts

    275
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by #CroSs

  1. #CroSs

    سؤال

    ذي الوظيفة ما تجيب أكثر واحد معه فلوس
  2. ي حبيبي الفيد كاميرا تجعل الشاشة سوداء لو تبيها سوداء خله true ولو ﻻ خله false fadeCamera ( [ player thePlayer ], bool fadeIn, [ float timeToFade = 1.0, int red = 0, int green = 0, int blue = 0 ] )
  3. FormatTime . هذه الوظيفة تقوم بتحويل الوقت أو حسابه وترجع جدول مع سترنق Syntax table, string FormatTime( float Time, string TimeFormula, bool Convert, string MaximumTimeFormula, table BannedTimeFormulas ) Required Arguments Time : الوقت TimeFormula : ..صيغة الوقت مثل ثانية ، ساعة ، يوم ، سنة ، الخOptional Arguments Convert : . false ينحسب + القيمة الافتراضية هي false يتحول و true ، قيمة منطقية قائمة على أن الوقت المعطاه بيتحول أو بينحسب MaximumTimeFormula : ... . ( قرن ) century القيمة الافتراضية هي + hour أعلى صيغة وقت الوظيفة راح تحسب بها ، يعني مثلاً تبي تحسب بالساعات فقط ، حط BannedTimeFormulas : . صيغ الوقت إلي بتنحذف من جدول الوقت + ما راح تظهر في السترنق إلي يرجع ، طبعًا تحط الصيغ إلي تبي تحذفها في جدول + الافتراضي أنه يطلع الكل إذا كان قيمتهم مو صفر ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ صيغ الوقت المدعومة ( picosecond, nanosecond, microsecond, millisecond, centisecond, decisecond, second, minute, hour, day, week, month, year, decade, century ) ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ Returns . إذا صار خطأ false ترجع جدول فيه الوقت وسترنق فيه الوقت كـ كلام ، ويرجع Source Code function FormatTime( Time, TimeFormula, Convert, MaximumTimeFormula, BannedTimeFormulas ) if ( type( Time ) == "number" and type( TimeFormula ) == "string" ) then local SomeTable = { picosecond = Time / 1000000000000, nanosecond = Time / 1000000000, microsecond = Time / 1000000, millisecond = Time / 1000, centisecond = Time / 100, decisecond = Time / 10, second = Time, minute = Time * 60, hour = Time * 3600, day = Time * 86400, week = Time * 604800, month = Time * 2592000, year = Time * 31536000, decade = Time * 315360000, century = Time * 3153600000 } MaximumTimeFormula = string.lower( tostring( MaximumTimeFormula ) ) Time, MaximumTimeFormula = SomeTable[string.lower( TimeFormula )], SomeTable[MaximumTimeFormula] and MaximumTimeFormula or "century" if ( Time ) then local TimeTable, Time, String, Convert = {}, math.abs( Time ), "", not Convert TimeTable["picosecond"] = math.floor( Convert and MaximumTimeFormula ~= "picosecond" and Time * 1000000000000 % 10 or Time * 1000000000000 ) TimeTable["nanosecond"] = math.floor( Convert and MaximumTimeFormula ~= "nanosecond" and Time * 1000000000 % 10 or Time * 1000000000 ) TimeTable["microsecond"] = math.floor( Convert and MaximumTimeFormula ~= "microsecond" and Time * 1000000 % 10 or Time * 1000000 ) TimeTable["millisecond"] = math.floor( Convert and MaximumTimeFormula ~= "millisecond" and Time * 1000 % 10 or Time * 1000 ) TimeTable["centisecond"] = math.floor( Convert and MaximumTimeFormula ~= "centisecond" and Time * 100 % 10 or Time * 100 ) TimeTable["decisecond"] = math.floor( Convert and MaximumTimeFormula ~= "decisecond" and Time * 10 % 10 or Time * 10 ) TimeTable["second"] = math.floor( Convert and MaximumTimeFormula ~= "second" and Time % 60 or Time ) TimeTable["minute"] = math.floor( Convert and MaximumTimeFormula ~= "minute" and Time % 3600 / 60 or Time / 60 ) TimeTable["hour"] = math.floor( Convert and MaximumTimeFormula ~= "hour" and Time % 86400 / 3600 or Time / 3600 ) TimeTable["day"] = math.floor( Convert and MaximumTimeFormula ~= "day" and Time % 31536000 % 2592000 % 604800 / 86400 or Time / 86400 ) TimeTable["week"] = math.floor( Convert and MaximumTimeFormula ~= "week" and Time % 2592000 / 604800 or Time / 604800 ) TimeTable["month"] = math.floor( Convert and MaximumTimeFormula ~= "month" and Time % 31536000 / 2592000 or Time / 2592000 ) TimeTable["year"] = math.floor( Convert and MaximumTimeFormula ~= "year" and Time % 315360000 / 31536000 or Time / 31536000 ) TimeTable["decade"] = math.floor( Convert and MaximumTimeFormula ~= "decade" and Time % 3153600000 / 315360000 or Time / 315360000 ) TimeTable["century"] = math.floor( Time / 3153600000 ) local TimeFormulas = { "picosecond", "nanosecond", "microsecond", "millisecond", "centisecond", "decisecond", "second", "minute", "hour", "day", "week", "month", "year", "decade", "century" } for _, TimeFormula in next, TimeFormulas, ( { picosecond = 1, nanosecond = 2, microsecond = 3, millisecond = 4, centisecond = 5, decisecond = 6, second = 7, minute = 8, hour = 9, day = 10, week = 11, month = 12, year = 13, decade = 14 } )[MaximumTimeFormula] or 15 do TimeTable[TimeFormula] = nil end if ( type( BannedTimeFormulas ) == "table" ) then for _, TimeFormula in ipairs( BannedTimeFormulas ) do TimeTable[string.lower( TimeFormula )] = nil end end for _, TimeFormula in ipairs( { "century", "decade", "year", "month", "week", "day", "hour", "minute", "second", "decisecond", "centisecond", "millisecond", "microsecond", "nanosecond", "picosecond" } ) do local Time = TimeTable[TimeFormula] if ( Time and Time ~= 0 ) then TimeFormula = string.upper( string.sub( TimeFormula, 1, 1 ) )..string.sub( TimeFormula, 2, #TimeFormula )..( Time == 1 and "" or "s" ) TimeFormula = TimeFormula == "Centurys" and "Centuries" or TimeFormula String = ( String == "" and String or String..( Convert and " and " or ", " ) )..( Convert and Time.." "..TimeFormula or TimeFormula.." = "..Time ) end end return TimeTable, String..( String ~= "" and " ." or "" ) end return false end return false end Example print( select( -1, FormatTime( 10, "Day" ) ) ) --> 1 Week and 3 Days . الحساب print( select( -1, FormatTime( 10, "Decisecond" ) ) ) --> 1 Second . الحساب print( select( -1, FormatTime( 1, "Second", true ) ) ) --> Second = 1, Deciseconds = 10, Centiseconds = 100, Milliseconds = 1000, Microseconds = 1000000, Nanoseconds = 1000000000, Picoseconds = 1000000000000 . -- التحويل print( select( -1, FormatTime( 2.6, "day", nil, "hour" ) ) --> 62 Hours and 24 Minutes . --> hour الحساب + أعلى صيغة هي print( select( -1, FormatTime( 2.6, "day", nil, "hour", { "minute" } ) ) --> 62 Hours . --> شلنا الدقائق من الجدول والسترنق + hour الحساب + أعلى صيغة Author : #CroSs .
  4. آيفون معفن 0/10 . هذا تقييمي
  5. متأكد انك حاط السطر ذا في الملف local KillTimers = {} إلي باين عندي انك مو حاطه ثاني شيء في فنكشن isPedDead او الأرقمنت الثاني إذا كان موجود "kill" مب Player متأكد أنك حاط داخله
  6. -- #Server local KillTimers = {} addEventHandler( "onPlayerWasted", root, function() setTimer( function( source ) if ( isElement( source ) ) then spawnPlayer( source, 0, 0, 3 ) setElementData( source, "Ghost", true ) setElementAlpha( source, 150 ) setTimer( function( source ) if ( isElement( source ) ) then setElementData( source, "Ghost", false ) setElementAlpha( source, 255 ) end end, 6000, 1, source ) end end, 2000, 1, source ) end ) addCommandHandler( "kill", function( Player ) if ( not isPedDead( Player ) ) and not ( isTimer( KillTimers[Player] ) ) then KillTimers[Player] = setTimer( function() if ( isElement( Player ) ) then killPed( Player, Player ) end KillTimers[Player] = nil end, 5000, 1 ) end end ) -- #Client addEventHandler( "onClientElementDataChange", root, function( DataName ) if ( DataName == "Ghost" ) and ( getElementType( source ) == "player" ) then local State = not ( getElementData( source, DataName ) == true ) for _, player in ipairs( getElementsByType( "player" ) ) do setElementCollidableWith( player, source, State ) end end end ) addEventHandler( "onClientPlayerDamage", localPlayer, function() if ( getElementData( source, "Ghost" ) == true ) then cancelEvent() end end )
  7. "onClientGUIClick" -- Event guiCreateWindow guiCreateButton guiSetVisible ثانياً كيف تدخل مود ؟ يعني تضغط عليه يشتغل مود ؟
  8. تقدر تختصره كذا return posz <= getGroundPosition( posx, posy, posz ) + 1 ???? قصدي يسوي كذا function isElementOnGround (element) if not element then outputDebugString("Bad argument @ 'isElementOnGround",1) return false end local posx,posy,posz = getElementPosition(element) return posz <= getGroundPosition(posx,posy,posz) +1 end
  9. تقدر تختصره كذا return posz <= getGroundPosition( posx, posy, posz ) + 1
  10. local TeamName = "Ballas" local myMarker = createMarker( 2485.64136, -1666.60461 ,12.5, "cylinder", 2.0, 255, 0, 0, 150 ) local hillRadar = createRadarArea( 2485.64136, -1666.60461, 111, 440, 0, 255, 0, 175 ) addEventHandler( "onMarkerHit", resourceRoot, function( hitElement ) if ( source == myMarker ) and ( getElementType( hitElement ) == "player" ) then local PlayerTeam = getPlayerTeam( hitElement ) if ( PlayerTeam ) and ( getTeamName( PlayerTeam ) == TeamName ) then if ( not isTimer( TurfTimer ) ) then function Turf( R, G, B ) local Team = getTeamFromName( TeamName ) if ( not Team ) then return end setRadarAreaColor( hillRadar, R, G, B, 255 ) local Money, Boolean = math.random( 500, 5000 ) for _, Player in ipairs( getPlayersInTeam( Team ) ) do if ( isElementWithinMarker( Player, myMarker ) and Boolean ~= true ) then Boolean = true end outputChatBox( "The Rader Color Has Been Changed !", Player, 0, 255, 0, true ) givePlayerMoney( Player, Money ) end if ( Boolean ) then TurfTimer = setTimer( Turf, 180000, 1, getTeamColor( PlayerTeam ) ) end end TurfTimer = setTimer( Turf, 180000, 1, getTeamColor( PlayerTeam ) ) end end end end )
  11. -- #Client function toggleWindow( Element ) if ( Element == localPlayer ) then local Boolean = eventName == "onClientMarkerHit"; local Boolean = Boolean and getElementData( localPlayer, "Group" ) == "The Group" guiSetVisible( TheWindow, Boolean ) showCursor( Boolean ) end end addEventHandler( "onClientMarkerHit", Marker, toggleWindow ) addEventHandler( "onClientMarkerLeave", Marker, toggleWindow ) function Vehicles() if ( source == Button or source == GridList ) then if ( getElementData( localPlayer,"Group" ) == "The Group" ) then local SelectedItem = guiGridListGetSelectedItem( GridList ) if ( SelectedItem ~= -1 ) then local VehicleID = guiGridListGetItemData( GridList, SelectedItem, 1 ) triggerServerEvent( "Base:GiveVehicle", localPlayer, VehicleID ) end else guiSetVisible( TheWindow, false ) showCursor( false ) end end end addEventHandler( "onClientGUIClick", guiRoot, Vehicles ) -- #Server local PlayersVehicles = {} addEvent( "Base:GiveVehicle", true ) addEventHandler( "Base:GiveVehicle", root, function( VehicleID ) if ( isElement( PlayersVehicles[source] ) ) then destroyElement( PlayersVehicles[source] ) PlayersVehicles[source] = nil end PlayersVehicles[source] = createVehicle( VehicleID, getElementPosition( localPlayer ) ) warpPedIntoVehicle( source, PlayersVehicles[source] ) end ) addEventHandler( "onVehicleExplode", resourceRoot, function() for Player, Vehicle in pairs( PlayersVehicles ) do if ( Vehicle == source ) then setTimer( function() if ( isElement( Vehicle ) ) then destroyElement( Vehicle ) end end, 5000, 1 ) PlayersVehicles[Player] = nil break end end end ) addEventHandler( "onPlayerQuit", root, function() if ( isElement( PlayersVehicles[source] ) ) then destroyElement( PlayersVehicles[source] ) PlayersVehicles[source] = nil end end )
  12. #CroSs

    طلب ؟

    لو تبيها تفتح وتغلق سوي كذا addCommandHandler( "openUpgrade", function() toggleWindow( wndUpgrades ) end ) بدون شرط ؟ else بعدين كيف حاط تروح تكتب اكواد هريسة ما تدري وش سالفتها وتقول لنا ما ظبط
  13. #CroSs

    طلب ؟

    يبقى مسروق من الأساس
  14. #CroSs

    طلب ؟

    بالنسبة للفري روم -- #Client addCommandHandler( "openUpgrade", function() createWindow( wndUpgrades ) end ) -- حط ذا في اي ملف كلنت بالفري روم addEventHandler( "onClientGUIClick", guiRoot, function() if ( source == الزر ) then executeCommandHandler( "openUpgrade" ) end end ) -- حط ذا في المود حقك والطلب الثاني ، السكربت مسروق
  15. في السيرفر createColCuboid فنكشن الأرقمنت الثالث حق الارتفاع ، عدل عليه مثل ما تبي
  16. ما ادري وش فيني اليوم ههه الزبدة ارجع خذ كود السيرفر
  17. قوس زايد ، لكن عدلته ارجع خذ كود الكلنت + احتمال كبير إحداثيات الكول شيب غلط
  18. -- #Server local Safe_Col = createColCuboid( 97.395660400391, 1809.7053222656, 17.648149490356, 255, 255, 255 ) local Safe_Zone_Radar = createRadarArea( 97.395660400391, 1809.7053222656, 255, 255, 255, 255, 0, 100 ) local Circle_Area = createColCircle( 0, 0, 10 ) setElementData( Safe_Zone_Radar, "zombieProof", true ) setRadarAreaFlashing( Safe_Zone_Radar, true ) local AllowedSkins = { [293] = true, [284] = true, [217] = true, [283] = true, [284] = true, [286] = true, [288] = true, [312] = true } function ColShape( Element ) if ( getElementType( Element ) == "player" ) then if ( AllowedSkins[getElementModel( Element )] ) then local Boolean = eventName == "onColShapeHit" toggleControl( Element, "fire", not Boolean ) toggleControl( Element, "aim_weapon", not Boolean ) toggleControl( Element, "vehicle_fire", not Boolean ) outputChatBox( "", Element, 0, 255, 0 ) triggerClientEvent( Element, "ColShape:RenderDx", Element, Boolean ) else killPed( Element ) end end end addEventHandler( "onColShapeHit", Safe_Col, ColShape ) addEventHandler( "onColShapeLeave", Safe_Col, ColShape ) -- #Client local ScreenW, ScreenH = guiGetScreenSize() function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end addEvent( "ColShape:RenderDx", true ) addEventHandler( "ColShape:RenderDx", root, function( Boolean ) if ( Boolean ) then if ( not isEventHandlerAdded( "onClientRender", root, Dx ) ) then addEventHandler( "onClientRender", root, Dx ) end else if ( isEventHandlerAdded( "onClientRender", root, Dx ) ) then removeEventHandler( "onClientRender", root, Dx ) end end end ) function Dx() dxDrawRectangle( ScreenW * 0.2828, ScreenH * 0.6198, ScreenW * 0.1094, ScreenH * 0.0521, tocolor( 0, 0, 0, 72 ), true ) dxDrawText( "Save Zone", ( ScreenW * 0.2961 ) + 1, ( ScreenH * 0.6250 ) + 1, ( ScreenW * 0.3719 ) + 1, ( ScreenH * 0.6406 ) + 1, tocolor( 0, 0, 0, 255 ), 1, "pricedown", "left", "top", false, false, false, false, false ) dxDrawText( "Save Zone", ScreenW * 0.2961, ScreenH * 0.6250, ScreenW * 0.3719, ScreenH * 0.6406, tocolor( 229, 199, 0, 242 ), 1, "pricedown", "left", "top", false, false, false, false, false ) end
  19. local PlayersVehicles = {} addEvent( "carx", true ) addEventHandler( "carx", root, function( CarID, CarCost ) takePlayerMoney( source, tonumber( CarCost ) ) if ( isElement( PlayersVehicles[source] ) then destroyElement( PlayersVehicles[source] ) PlayersVehicles[source] = nil end local X, Y, Z = getElementPosition( source ) PlayersVehicles[source] = createVehicle( tonumber( CarID ), X + 2, Y, Z ) warpPedIntoVehicle( source, PlayersVehicles[source] ) end ) addEventHandler( "onVehicleExplode", root, for Player, Vehicle in pairs( PlayersVehicles ) do if ( source == Vehicle ) then destroyElement( Vehicle ) PlayersVehicles[Player] = nil break end end end ) addEventHandler( "onPlayerQuit", root, function() if ( isElement( PlayersVehicles[source] ) then destroyElement( PlayersVehicles[source] ) PlayersVehicles[source] = nil end end )
×
×
  • Create New...