Jump to content

Search the Community

Showing results for tags 'blip error'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 2 results

  1. Hello guys! I have an issue with my radar script and I can't fix it. I wanted to draw the server's blips to the player's minimap, but i don't know how to calculate the X,Y coordinates on the radar when I rotate my camera. That's my client side script: local c = exports.gw_core local screenX,screenY = guiGetScreenSize() local fonts = c:getFonts() local options = c:getOptions() local s = c:getSize(300) local bx,by = c:getSize(50), screenY - c:getSize(50)-s local x,y = c:getSize(60), screenY - c:getSize(40) - s local arrowSize = c:getSize(30) local bs = s*2 local mapTarget = dxCreateRenderTarget(bs,bs) local map = dxCreateTexture('world.jpg') local blipTarget = dxCreateRenderTarget(3000,3000) setPlayerHudComponentVisible ( 'radar',false) function getMapCord(element) local x,y = getElementPosition(element) local imgSize = 3072 return ((x + 3000) / 6000) * imgSize, (-(y - 3000) / 6000) * imgSize end local blip = createBlip (1962.291015625,-1751.20703125,13.3828125, 0) addEventHandler('onClientRender',root,function() local _,_,r = getElementRotation(getCamera()) local _,_,pr = getElementRotation(localPlayer) local posX,posY = getMapCord(localPlayer) dxSetRenderTarget(blipTarget) dxDrawImageSection ( posX - bs/2, posY - bs/2, bs,bs,posX - bs/2, posY - bs/2, bs,bs,map,r) for k,v in pairs(getElementsByType('blip')) do local blipX,blipY = getMapCord(v) dxDrawImage(blipX - 10, blipY - 10, 20, 20, 'player.png'); -- I don't have blip images yet end dxSetRenderTarget() dxDrawRectangle ( bx,by,s+c:getSize(20),s+c:getSize(20), options.panelDark) dxDrawImageSection ( x,y,s,s,posX - s/2, posY - s/2, s,s,blipTarget) dxDrawImage ( x + s/2 - arrowSize/2, y + s/2 - arrowSize/2, arrowSize,arrowSize,'player.png',r-pr,0,0) end) There's the problem in the game :
  2. I have a problem, I tried to make a local blip for each player, that is, if you are a business owner on the server (in my case), then only you have a note of where your business is. Errors in the console are not any no, it's completely clean. ----------------------------------------------------- this is server.lua function dbCreateBusinessesCallback(queryHandle) local sql = dbPoll(queryHandle, 0) if sql and #sql > 0 then for index, sqlRow in ipairs(sql) do local pos = split(sqlRow["bPos"], ",") local bMarker = createMarker(pos[1], pos[2], pos[3], "corona", 1.5, settings["business.markerColor"][1], settings["business.markerColor"][2], settings["business.markerColor"][3], settings["business.markerColor"][4]) setElementInterior(bMarker, pos[4]) setElementDimension(bMarker, pos[5]) local timer = setTimer(businessPayout, sqlRow["bPayoutCurTime"] , 1, bMarker) setElementData(bMarker, "bData", {sqlRow["bID"], sqlRow["bName"], sqlRow["bOwner"], sqlRow["bCost"], sqlRow["bPayout"], sqlRow["bPayoutTime"], sqlRow["bPayoutOTime"], sqlRow["bPayoutUnit"], sqlRow["bBank"], timer}) local bData = getElementData(bMarker, "bData") local id, name, owner, cost, payout, payoutTime, payoutOTime, payoutUnit, bank, timer = unpack(bData) if settings["business.blip"] ~= false then if sqlRow["bOwner"] == "For Sale" then addEventHandler( 'onPlayerLogin', root, function(getPlayerAccount) setElementData( source, 'account', getAccountName(getPlayerAccount(player))); triggerClientEvent(source,"createBizBlips", source) end); end end addEventHandler("onMarkerHit", bMarker, onBusinessMarkerHit) addEventHandler("onMarkerLeave", bMarker, onBusinessMarkerLeave) local timer = setTimer(businessPayout, sqlRow["bPayoutCurTime"] , 1, bMarker) setElementData(bMarker, "bData", {sqlRow["bID"], sqlRow["bName"], sqlRow["bOwner"], sqlRow["bCost"], sqlRow["bPayout"], sqlRow["bPayoutTime"], sqlRow["bPayoutOTime"], sqlRow["bPayoutUnit"], sqlRow["bBank"], timer}) end end end ---------------------------------------------------- this is client.lua ---------------this is bind bindKey( 'i', 'both', function( key, keyState ) if keyState == 'down' then for k, v in ipairs ( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'bOwner' ) and getElementData( v, 'bOwner' )[7] then if getElementData( v, 'bOwner' )[7] ~= '' then else createBlipAttachedTo( v, 52 ); end; end; end; else for k, v in ipairs( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'bOwner' ) then for k, elem in ipairs( getAttachedElements( v ) ) do if getElementType( elem ) == 'bBlip' then destroyElement( elem ); end; end; end; end; createBlips() end; end ); ------------------------ And this is the second part function getPlayerByAccountName( name ) for i, v in ipairs( getElementsByType( 'player' ) ) do if getElementData( v, 'account' ) == name then return v; end; end; return false; end; function creatbBlips() local account = getAccount(owner) for k, v in ipairs ( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'bOwner' ) and getElementData( v, 'bOwner' )[7] then if getElementData( v, 'bOwner' )[7] == getElementData( localPlayer, account) then createBlipAttachedTo( v, 52 ); end; end; end; end addEvent("createBizBlips",true) addEventHandler("createBizBlips",root,createBlips) createBlips() help me pleas :3 so, then I'm a terrible perplexity
×
×
  • Create New...