Jump to content

Blaawee

Members
  • Posts

    857
  • Joined

  • Last visited

Everything posted by Blaawee

  1. I'm not sure if this will work or not local screenx, screeny = guiGetScreenSize( ); local posX = 2; local posY = 247; -- Make sure it's the right values local width = 150; local height = 150; -- local scale = 2.2; local texture = dxCreateTexture( 'files/map.png', 'dxt5', true, 'clamp' ); imageWidth, imageHeight = dxGetMaterialSize( texture ); showPlayerHudComponent( "radar", false ) addEventHandler("onClientRender",root, function( ) local px ,py, pz = getElementPosition( localPlayer ) local mapX = px / ( 6000 / imageWidth ) + ( imageWidth / 2 ) - ( width / scale / 2 ); local mapY = py / ( -6000 / imageHeight ) + ( imageHeight / 2 ) - ( height / scale / 2 ); local cx,cy,cz,tx,ty,tz = getCameraMatrix( ); local rotation = findRotation( cx,cy,tx,ty ); dxDrawImageSection( posX, screeny - posY, width, height, mapX, mapY, width / scale, height / scale, texture, rotation, 0, 0, tocolor( 255, 255, 255, 255 ), false ); -- You can use a rectangle --dxDrawRectangle( posX + width / 2, screeny - posY + height / 2, 5, 5, tocolor( 0, 0, 255, 255 ) ); -- Or dxDrawImage( posX + width / 2, screeny - posY + height / 2, 5, 5, "files/me.png" ); --[[for i, v in ipairs( getElementsByType('player') ) do --Don't care to this. if v ~= localPlayer then local scale = 256/(3000*2) local apx,apy,apz = getElementPosition(v) local point_xx = box_screen_x+apx*scale local point_yy = box_screen_y+apy*scale dxDrawImage(point_xx, point_yy, ppx, ppy,"files/them.png") end end]] end ) function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) if t < 0 then t = t + 360 end return t end
  2. It's depend on your texture,try to find a good texture with a high dimensions.
  3. I'v been working on something like that before and i got it work. try this : local screenx, screeny = guiGetScreenSize( ); local posX = 2; local posY = 247; -- Make sure it's the right values local width = 150; local height = 150; -- local scale = 2.2; local texture = dxCreateTexture( 'files/map.png', 'dxt5', true, 'clamp' ); imageWidth, imageHeight = dxGetMaterialSize( texture ); showPlayerHudComponent( "radar", false ) addEventHandler("onClientRender",root, function( ) local px ,py, pz = getElementPosition( localPlayer ) local mapX = px / ( 6000 / imageWidth ) + ( imageWidth / 2 ) - ( width / scale / 2 ); local mapY = py / ( -6000 / imageHeight ) + ( imageHeight / 2 ) - ( height / scale / 2 ); dxDrawImageSection( posX, screeny - posY, width, height, mapX, mapY, width / scale, height / scale, texture, 0, 0, 0, tocolor( 255, 255, 255, 255 ), false ); -- You can use a rectangle --dxDrawRectangle( posX + width / 2, screeny - posY + height / 2, 5, 5, tocolor( 0, 0, 255, 255 ) ); -- Or dxDrawImage( posX + width / 2, screeny - posY + height / 2, 5, 5, "files/me.png" ); --[[for i, v in ipairs( getElementsByType('player') ) do --Don't care to this. if v ~= localPlayer then local scale = 256/(3000*2) local apx,apy,apz = getElementPosition(v) local point_xx = box_screen_x+apx*scale local point_yy = box_screen_y+apy*scale dxDrawImage(point_xx, point_yy, ppx, ppy,"files/them.png") end end]] end )
  4. Blaawee

    DxDraw

    Try this : addEventHandler ( 'onPlayerJoin', root, function ( ) setElementData ( source, 'Rankicon', ':Class/Rank/rank_0.png' ); end ); addEventHandler ( 'onPlayerLogin', root, function( _, account ) local LV = tonumber( getAccountData( account, 'LV' ) ); if ( LV and LV > 0 ) then setElementData ( source, 'Rankicon', ':Class/Rank/rank_'..LV..'.png' ); elseif ( LV == 50 or >= 50 )then setElementData ( source, 'Rankicon', ':Class/Rank/rank_50.png' ); else setElementData ( source, 'Rankicon', ':Class/Rank/rank_0.png' ); end end );
  5. Blaawee

    fetchRemote

    How did you use it ? compiledScirptFile("example.lua","compiled.lua")
  6. Blaawee

    fetchRemote

    Actually i'm not good in these thing, But try to replace fileRead with fileOpen. might work.
  7. Blaawee

    fetchRemote

    Maybe something like this : function compiledScirptFile( from, to ) if from and type( from ) == 'string' and to and type( to ) == 'string' then fetchRemote( 'https://luac.multitheftauto.com/?compile=1&debug=0&blockdecompile=0&encrypt=0', myCallBack, fileRead( from ), true, to ); end end function myCallBack( data, errno, path ) if errno == 0 then if not fileExists( ':'..sourceResource..'/'.. path ) then newFile = fileCreate( ':'..sourceResource..'/'.. path ) fileWrite( newFile, data ) fileClose( newFile ) end end end
  8. local myMarker = createMarker(-2596.625, 579.358, 15.626, 'corona', 2.0, 255, 0, 0, 150) -- i make marker function MarkerHit( hitElement, matchingDimension ) if hitElement and getElementType( hitElement ) == 'player' then fadeCamera( hitElement, true, 0.5 ) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit )
  9. Well, that's need math. here an example for you local screenSize = { guiGetScreenSize( ) }; function drawRectangle( ) dxDrawRectangle( screenSize[ 1 ] / 2 - 125, screenSize[ 2 ] / 2 - 12.5, 250, 25, tocolor( 255, 255, 255, 255 ) ); end function onClick( button, state, x, y ) if ( button == 'left' or button == 'right' and state == 'down' ) then -- mouseX > elementPosX mouseX < elementWidth local checkX = ( x > screenSize[ 1 ] / 2 - 125 and x < screenSize[ 1 ] / 2 - 20 + 250 ); -- mouseY > elementPosY mouseY < elementHeight local checkY = ( y > screenSize[ 2 ] / 2 - 12.5 and y < screenSize[ 2 ] / 2 - 12.5 + 25 ); if ( checkX and checkY ) then -- Do something. removeEventHandler( 'onClientRender', root, drawRectangle ); removeEventHandler( 'onClientClick', root, onClick ); end end end addEventHandler( 'onClientResourceStart', resourceRoot, function( ) addEventHandler( 'onClientRender', root, drawRectangle ); addEventHandler( 'onClientClick', root, onClick ); end ); Corect me guys if i'm wrong.
  10. local time = getRealTime( ); local hours = time.hour; local minutes = time.minute; local aTable2 = { [ 'Jarvis, what time is it?' ] = { hours.. ':' ..minutes }, } addEventHandler( 'onPlayerChat',root, function ( Massege ) for v in pairs ( aTable2 ) do if string.find ( Massege,v ) then cancelEvent ( ) outputChatBox ( ' Jarvis: ' .. aTable2 [ v ] [ 1 ]..' ', root, r, g, b ) end end end )
  11. Blaawee

    zday script

    createZombie ( x, y, z, rot, skin, interior, dimension ) And you got some missing end.
  12. Actually it's work. seems you didn't do like what i said. https://mega.co.nz/#!ppYEQboJ!fpNuOwHdjtTx-2i0gA3eijmkg6MgUPcu61tRjYPgX2U
  13. Why are you using farclip ? It's not a RPC function ! If you want to! you have to edit the server side. Because you are using a server interface call. BTW try this: function setWorld( leaf ) server.setElementDimension( g_Me, leaf.dimension ) local vehicle = getPedOccupiedVehicle( g_Me ) if vehicle then server.setElementDimension( vehicle, leaf.dimension ) --This will set the dimension for everyone in the vehicle. --[[for i=0,getVehicleMaxPassengers( vehicle ) do local player = getVehicleOccupant( vehicle, i ) if player and player ~= g_Me then server.setElementDimension( player, leaf.dimension ) end end]] end setPlayerPosition( leaf.posX, leaf.posY, leaf.posZ + 1 ) setFarClipDistance( leaf.farclip ) closeWindow( wndSetWorld ) end wndSetWorld = { 'wnd', text = 'Set World', width = 250, controls = { { 'lst', id = 'world', width = 230, height = 300, columns = { { text = 'Multi Worlds', attr = 'name' } }, rows = { xml = 'worlds.xml', attrs = { 'name', 'posX', 'posY', 'posZ', 'farclip', 'dimension' } }, onitemdoubleclick = setWorld }, {'btn', id='close', closeswindow=true} } } type="world"> "Freeroam" posX="0" posY="0" posZ="0" farclip="0" dimension="0"/> "Deathmatch" posX="0" posY="0" posZ="0" farclip="0" dimension="1"/> "Zombies" posX="0" posY="0" posZ="0" farclip="0" dimension="2"/> And don't forget to replace the server side with this: g_RPCFunctions = { addPedClothes = { option = 'clothes', descr = 'Modifying clothes' }, addVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, fadeVehiclePassengersCamera = true, fixVehicle = { option = 'repair', descr = 'Repairing vehicles' }, giveMeVehicles = { option = 'createvehicle', descr = 'Creating vehicles' }, giveMeWeapon = { option = 'weapons.enabled', descr = 'Getting weapons' }, givePedJetPack = { option = 'jetpack', descr = 'Getting a jetpack' }, killPed = { option = 'kill', descr = 'Killing yourself' }, removePedClothes = { option = 'clothes', descr = 'Modifying clothes' }, removePedFromVehicle = true, removePedJetPack = { option = 'jetpack', descr = 'Removing a jetpack' }, removeVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, setElementAlpha = { option = 'alpha', descr = 'Changing your alpha' }, setElementPosition = true, setElementInterior = true, setMyGameSpeed = { option = 'gamespeed.enabled', descr = 'Setting game speed' }, setMySkin = { option = 'setskin', descr = 'Setting skin' }, setPedAnimation = { option = 'anim', descr = 'Setting an animation' }, setPedFightingStyle = { option = 'setstyle', descr = 'Setting fighting style' }, setPedGravity = { option = 'gravity.enabled', descr = 'Setting gravity' }, setPedStat = { option = 'stats', descr = 'Changing stats' }, setTime = { option = 'time.set', descr = 'Changing time' }, setTimeFrozen = { option = 'time.freeze', descr = 'Freezing time' }, setVehicleColor = true, setVehicleHeadLightColor = true, setVehicleOverrideLights = { option = 'lights', descr = 'Forcing lights' }, setVehiclePaintjob = { option = 'paintjob', descr = 'Applying paintjobs' }, setVehicleRotation = true, setWeather = { option = 'weather', descr = 'Setting weather' }, spawnMe = true, setCameraInterior = true, warpMe = { option = 'warp', descr = 'Warping' }, -- I edit here setElementDimension = true, -- }
  14. Blaawee

    SQLlite

    Same thing nothing changed
  15. Use : fadeCamera setCameraMatrix
  16. Try this: .fx texture PaintjobTexture; technique vehiclePaintjobReplace { pass P0 { Texture[ 0 ] = PaintjobTexture; } } Client local myShader, tec, theTexture; addEventHandler( 'onClientResourceStart', resourceRoot, function( ) -- Version check if getVersion ().sortable < '1.1.0' then outputChatBox( 'Resource is not compatible with this client.' ); return end myShader, tec = dxCreateShader ( 'texreplace.fx', 0, 0, true, 'vehicle' ); if not myShader then outputChatBox( 'Could not create shader. Please use debugscript 3' ) else outputChatBox( 'Using technique [' . . tec. . ']' ); end theTexture = dxCreateTexture( 'textures/elegy.png' ); dxSetShaderValue( myShader, 'PaintjobTexture', theTexture ); engineApplyShaderToWorldTexture( myShader, 'elegy2body256'); end );
  17. Blaawee

    useful func

    No, it's not Built-in MTA functions.
  18. addEventHandler( 'onResourceStart', resourceRoot, function( ) for _, player in ipairs ( getElementsByType ( 'player' ) ) do if ( getElementDimension ( player ) == 10999 or getElementDimension ( player ) = 10998 and not getElementData ( player, 'inMission' ) ) then setElementDimension( player, 0 ); end end end );
  19. This might help you. https://wiki.multitheftauto.com/wiki/On ... WeaponFire
  20. In case if you will ask about how to get the element data, loop it -- It's just an example. local gObjects = { } local gGateID = 50 -- change it to the perfect gate ID. addEventHandler ( "onResourceStart", resourceRoot, function( ) for key, gates in ipairs ( getElementsByType( 'gate' ) ) do if getElementData( gates, "posX" ) and getElementData( gates, "posY" ) and getElementData( gates, "posZ" ) then gObjects[ key ] = createObject( gGateID, getElementData( gates, "posX" ), getElementData( gates, "posY" ), getElementData( gates, "posZ" ) ); end end end );
×
×
  • Create New...