Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/01/17 in all areas

  1. أتمني ما اكون جبت شئ من رأسي . واذا تشوف فوق قلتلك استخدم table.sort وانت دايمأ تستعجل علي الاشيا ! انت عندك غلط ي الحبيب locql taple={} التصحيح local taple={}
    2 points
  2. Have the MTA Team setup an official Discord server? I saw an unofficial one on a topic a few weeks back and joined it, but somebody speaks once every few days and it's full of weird bot scripts. Would be an idea to get one going, especially as it can link to IRC.
    1 point
  3. 1971 Plymouth barracuda been working on it for quite a while now for no real reason. To do to make it work in game -- Cut out the doors hood and trunk Finish up interior (Would probably just use a SA cars interior to save polys and time) Clean up the wheel models a bit; they are quite high poly. Add engine block Texture it (Whats seen above is simply rendered with colors and reflects applied.)
    1 point
  4. Make another variable that checks if it already added a lap and create a greater radius it has to leave so it goes back to the beginning situation. I made some alterations: local sx,sy = guiGetScreenSize() fontLCD22 = dxCreateFont("lcd.ttf", 22) local lap = 1 local x, y, z = false local a, b, c = false local dist = false local newLap = false function updateDisplay() a, b, c = getElementPosition(localPlayer) if x and y and z then dist = getDistanceBetweenPoints3D(x, y, z, a, b, c) end if getElementData(localPlayer, "race.checkpoint") == nil then return end if getElementData(localPlayer, "race.checkpoint") >= 4 then if dist and dist < 40 then if newLap == false then setElementData(localPlayer, "lap", lap+1) lap = lap+1 newLap = true end elseif dist and dist > 50 then if newLap then newLap = false end end end local target = localPlayer if getElementData(localPlayer, "race.spectating") then target = getVehicleOccupant(getCameraTarget(localPlayer), 0) end dxDrawText("Lap: "..tostring(getElementData(target, "lap")), sx - 90, sy- 155, 40, 30, tocolor(255, 255, 255, 255), 0.6, fontLCD22, "left", "top", false, false, false) end addEventHandler("onClientRender", getRootElement(), updateDisplay) addEvent("onClientMapStarting", true) function onMapStart() if getElementData(localPlayer, "lap") ~= 1 then setElementData(localPlayer, "lap", 1) end x, y, z = getElementPosition(localPlayer) end addEventHandler("onClientMapStarting", root, onMapStart) function onClientResStart() if getElementData(localPlayer, "lap") ~= lap then setElementData(localPlayer, "lap", lap) end end addEventHandler("onClientResourceStart", resourceRoot, onClientResStart) This way it only adds once and only triggers again if the player leaves the radius of 50 and goes back to the radius of 40 around the start/finish.
    1 point
  5. The error is possibly caused by one of the .dll files you have copied into the GTA directory. Start with removing dxgi.dll, and if that doesn't help, try removing the other .dll files
    1 point
  6. + لو تشوف كود نكست فيه table.sort
    1 point
  7. اخوي منب كاتب لوكال اولا اللوكال لاني بستخدم التيبل باكثر من ايفينت +_+ ثانيا لو تقرا الردود ثاني مره انبه عليك شف رد الاخ نكست قال عبي التيبل بالداتا ذذ ثالثا table.sort اعتقدت سلفا انها للجريد لست فقط وارجع انبه عليك ذذ اقرا قبل لا تكتب
    1 point
  8. جرب locql taple={} setTimer(function() for k,v in ipairs(getElementsByType('player'))do local g1 = getElementData(v,"pointplayer") if getElementData(v,"pointplayer") then if getPlayerTeam(v)then table.insert(taple,{g1}) setElementData(v,"bestplr",getPlayerName(v)) end end end end,250,0) + لا ترد ردود بغيضة كان يحاول يساعدك ابو سولو
    1 point
  9. يعطيك العافيه ما تقصر لكن حاول تاخذها مني نصيحه يعطييك العافيه لبى قلبك افدتني
    1 point
  10. سوي جدول, وضيف الداتا للجدول ورتب القيم وجيب أعلى قيمه
    1 point
  11. العفو. بأي وقت بالتوفيق لك ~
    1 point
  12. gridlist = guiCreateGridList(500, 26, 420, 254, false) guiGridListAddColumn(gridlist, "Name", 0.5) showCursor(true) local table_category = { --[Categoría] = { { "Nombre", "ID" } }, { "Gorros", { {"Gorros", 1},{"Name_2", 2},{"Name_3", 3}}}, { "Gorras" , { {"Gorras", 1550},{"Name_4", 2},{"Name_5", 3}}}, { "Lentes" , { {"Lentes", 1},{"Name_4", 2},{"Name_5", 3}}}, { "Relojes" , { {"Relojes", 1},{"Name_4", 2},{"Name_5", 3}}}, { "Mochilas", { {"Mochilas", 1},{"Name_4", 2},{"Name_5", 3}}}, { "Mascaras", { {"Mascaras", 1},{"Name_4", 2},{"Name_5", 3}}}, { "Armas de mentira", { {"Armas de mentira", 1},{"Name_4", 2},{"Name_5", 3}}}, { "Otros", { { "Otros", 1},{"Name_4", 2},{"Name_5", 3}}} } for i, v in ipairs ( table_category ) do local r = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, r, 1, tostring ( v[1] ), false, false ) end addEventHandler("onClientGUIDoubleClick", guiRoot, function() if ( source == gridlist ) then local row, col = guiGridListGetSelectedItem ( source ) --outputChatBox(row) if ( row and col and row ~= -1 and col ~= -1 ) then guiGridListClear ( gridlist ) guiGridListAddColumn(gridlist, "ID", 0.5) for _, v in ipairs ( table_category[row+1][2]) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, 1, v[1], false, false ) guiGridListSetItemText ( gridlist, row, 2, v[2], false, false ) end end end end ) Espero te sirva como para guiarte, Saludos
    1 point
  13. thank you, that's works
    1 point
  14. -- Let's define some respect levels local colors = { [ -3 ] = 420, -- Purple [ -2 ] = 435, -- Blue [ -1 ] = 480, -- Teal [ 0 ] = 510, -- Green [ 1 ] = 580, -- Yellow [ 2 ] = 605, -- Orange [ 3 ] = 670 -- Red } -- Let's make a function that returns us the color local function getRespectColor( respect ) local function wavelengthToRGBA( length, alpha ) local r, g, b, factor if ( length >= 380 ) and ( length < 440 ) then r, g, b = -( length - 440 ) / ( 440 - 380 ), 0, 1 elseif ( length < 489 ) then r, g, b = 0, ( length - 440 ) / ( 490 - 440 ), 1 elseif ( length < 510 ) then r, g, b = 0, 1, -( length - 510 ) / ( 510 - 490 ) elseif ( length < 580 ) then r, g, b = ( length - 510 ) / ( 580 - 510 ), 1, 0 elseif ( length < 645 ) then r, g, b = 1, -( length - 645 ) / ( 645 - 580 ), 0 elseif ( length < 780 ) then r, g, b = 1, 0, 0 else r, g, b = 0, 0, 0 end if ( alpha ) then if ( length >= 380 ) and ( length < 420 ) then factor = 0.3 + 0.7 * ( length - 380 ) / ( 420 - 380 ) elseif ( length < 701 ) then factor = 1 elseif ( length < 780 ) then factor = 0.3 + 0.7 * ( 780 - length ) / ( 780 - 700 ) else factor = 0 end else factor = 1 end return r * 255, g * 255, b * 255, factor * 255 end return tocolor( wavelengthToRGBA( colors[ math.floor( respect ) ] or 510 ) ) end -- Our current respect level local respect = -3 -- Let's render to see the demo addEventHandler( 'onClientRender', root, function( ) -- Rectangle with fill color dxDrawRectangle( 500, 500, 100, 100, getRespectColor( respect ) ) -- We draw the respect level dxDrawText( math.floor( respect ), 550, 550, 570, 570, tocolor( 0, 0, 0, 255 ) ) -- Increase it over time respect = respect + 0.025 -- If we're done, let's return to level -3 if ( respect >= 4 ) then respect = -3 end end ) Well, here you go, perhaps this does something of that sort.
    1 point
  15. http://crystalmv.net84.net/pages/scripts/npchlc_traffic.php
    1 point
  16. El formato de la tabla cambió, por eso, eso ya no te sirve. function getIndexFromCategory (category) for k, v in ipairs(table_category) do if ( v == category ) then return k end end return false end local index = getIndexFromCategory(category) if ( index ) then for _, id in ipairs ( table_category[index][2] ) then local row = guiGridListAddRow ( GRIDs ) guiGridListSetItemText ( GRIDs, row, 1, id[1], false, false ) end end
    1 point
  17. function wantedLevelChange(attacker, weapon, bodypart) if isElement(attacker) and getElementType(attacker) == "player" then local playerTeam = getPlayerTeam ( attacker ) if playerTeam then local teamName = getTeamName(playerTeam) if ( teamName ~= "Police" ) then if ( bodypart == 9 ) then setPlayerWantedLevel(attacker,5) else setPlayerWantedLevel(attacker,3) return end else if ( bodypart == 9 ) then setPlayerWantedLevel(attacker,0) else setPlayerWantedLevel(attacker,3) return end end end end end addEventHandler("onPlayerDamage", getRootElement(), wantedLevelChange)
    1 point
×
×
  • Create New...