Jump to content

what error?


Gallagher

Recommended Posts

Posted

hello guys

I found this script in the community

but it is not working.

the debugsdcript says this error on this line 9

Local MimgW, MimgH = dxGetMaterialSize (mapRadar)

in MimgW ,

--// Created by KryPtoHolYx 
--\\ 
  
local s = {guiGetScreenSize()} 
local icons = {} 
for k = 1,65 do 
icons[k] = dxCreateTexture("blips/"..k..".png") 
end 
addEventHandler( "onClientResourceStart", getRootElement( ),function (res) 
    if res ~= getThisResource() then return end 
        radarTexture = dxCreateTexture("radar.jpg") 
        currentZoomState = 0.5 
        local width, height = 1200,1200 
        radar = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900 )  
        mapRadar = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900 )  
        radararea = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true )  
        pathmap = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true )  
      
     local MimgW,MimgH    = dxGetMaterialSize(mapRadar) 
    addEventHandler ("onClientPreRender",root, 
            function () 
                local blips = {} 
                dxSetRenderTarget( mapRadar,true )      
                dxDrawImage (0,0,MimgW,MimgH, radarTexture)    
                 
                    for i, v in ipairs( getElementsByType('blip') ) do 
                            local icon = getBlipIcon(v) 
                        if icon > 3 then 
                            local px,py = getElementPosition(v) 
                            local blip_x = (3000+px)/6000*MimgW 
                            local blip_y = (3000-py)/6000*MimgH 
                            local rot = getPedCameraRotation( localPlayer ) 
                            size = 20 
                            dxDrawImage(blip_x-size/2, blip_y-size/2, size, size,icons[icon],rot) 
                        end 
                    end 
                for i, v in ipairs(getElementsByType('player') ) do 
                    if v ~= localPlayer then  
                            local r,g,b = 20,200,20 or getPlayerNametagColor(v)  
                            local px,py = getElementPosition(v) 
                            local p_x = (3000+px)/6000*MimgW 
                            local p_y = (3000-py)/6000*MimgH 
                            local prot = getPedRotation( v ) 
                            local p_blipsize = 20-currentZoomState 
                            dxDrawImage (p_x-p_blipsize/2,p_y-p_blipsize/2,p_blipsize,p_blipsize, "blips/3.png",-prot,0,0,tocolor(r,g,b))    
                    end 
                end 
                dxSetRenderTarget(  )      
             
                dxSetRenderTarget( radararea,true )      
                 
                    for i, v in ipairs( getElementsByType('radararea') ) do 
                            local r,g,b,a = getRadarAreaColor(v) 
                            local w,h = getRadarAreaSize(v) 
                            x,y = getElementPosition(v) 
                             
                            x = x / (6000 / MimgW)  + MimgW/2  
                            y = y / (-6000/ MimgH) + MimgH/2  
                            dxDrawRectangle(x, (y-h) + 4 + (h/2), (w/2), (h/2), tocolor(r,g,b,a)) 
  
  
                    end 
                dxSetRenderTarget(  )      
             
                dxSetRenderTarget( radar,true )            
                    local x,y,z = getElementPosition(localPlayer) 
                    local rot = getPedCameraRotation( localPlayer ) 
                    local mapx = x / (6000/MimgW) + MimgW/2 - width*currentZoomState/2 
                    local mapy = y / (-6000/MimgH) + MimgH/2 - height*currentZoomState/2 
  
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,mapRadar,-rot) 
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,radararea,-rot) 
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,pathmap,-rot) 
                     
                    local px,py = getElementPosition(localPlayer) 
                    local prot = getPedRotation( localPlayer ) 
                    local pblipsize = 20 - currentZoomState 
                    dxDrawImage (width/2-pblipsize/2,height/2-pblipsize/2,pblipsize,pblipsize, icons[3],-rot-prot)    
                dxSetRenderTarget()    
    showPlayerHudComponent("radar",false) 
  
     
    dxDrawImageSection(s[1]*50/1440, s[2]*650/900, s[1]*300/1440, s[2]*200/900, 450,490, 300, 200,radar, 0, -90, 0, tocolor(255, 255, 255, 255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*650/900,s[1]*300/1440,s[2]*2/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*850/900,s[1]*300/1440,s[2]*2/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*350/1440, s[2]*650/900,s[1]*2/1440,s[2]*202/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*650/900,s[1]*2/1440,s[2]*200/900,tocolor(0,0,0,255),true) 
  
    local x,y,z = getElementPosition(localPlayer) 
    local zone = getZoneName(x,y,z) 
    local textwidth = dxGetTextWidth(zone, 1.02,"default-bold") 
     
    dxDrawRectangle(s[1]*50/1440, s[2]*820/900,s[1]*(textwidth+25)/1440,s[2]*30/900,tocolor(0,0,0,120),true) 
    dxDrawText ( zone, s[1]*63/1440, s[2]*828/900,s[1]*(textwidth+25)/1440,s[2]*30/900, tocolor ( 255, 255, 255, 255 ), 1.02, "default-bold", "left", "top",false,false,true,false,true, 0,0,0) 
         
                if getKeyState("num_add") then 
                    if  currentZoomState - 0.01 < 0.5 then 
                        return 
                    else 
                        currentZoomState = currentZoomState - 0.03 
                     end 
                elseif getKeyState("num_sub") then 
                    if  currentZoomState + 0.01 > 1.5 then 
                        return 
                    else 
                        currentZoomState = currentZoomState + 0.03 
                     end 
                end 
             
            end 
   ) 
end) 

Posted

I'd say try contacting the resource author, or just wait for the other users to help you out, sorry, i couldn't help you as I'm not ready for reading the whole code :P

F4MZM4.gif

Posted
Post the whole error .

He did. Error is:

the debugsdcript says this error on this line 9

Local MimgW, MimgH = dxGetMaterialSize (mapRadar)

in MimgW

Ready the whole message then reply.

Posted
Post the whole error .

He did. Error is:

the debugsdcript says this error on this line 9

Local MimgW, MimgH = dxGetMaterialSize (mapRadar)

in MimgW

Ready the whole message then reply.

Huh? Where's the whole error such : ERROR: call: failed to call 'ID_System:getPlayerFromPartialName' [string "?"]

And please if you want to ask me about something leave the topic in a corner and tell me what you want via 'PM' :)!

  

Posted

error

EN5fTdb.png

--// Created by KryPtoHolYx 
--\\ 
  
local s = {guiGetScreenSize()} 
local icons = {} 
for k = 1,65 do 
icons[k] = dxCreateTexture("blips/"..k..".png") 
end 
local blips = {} 
addEventHandler( "onClientResourceStart", getRootElement( ),function (res) 
    if res ~= getThisResource() then return end 
  
        radarTexture = dxCreateTexture("radar.jpg") 
        currentZoomState = 0.5 
        local width, height = 1200,1200 
        radar = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900 )  
        mapRadar = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true )  
        radararea = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true )  
        pathmap = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true )  
      
     local MimgW,MimgH    = dxGetMaterialSize(mapRadar) 
      
     setTimer(function () 
                blips = {} 
                    for i, v in ipairs( getElementsByType('blip') ) do 
                            local icon = getBlipIcon(v) 
                        if icon > 3 then 
                            local px,py = getElementPosition(v) 
                            local blip_x = (3000+px)/6000*MimgW 
                            local blip_y = (3000-py)/6000*MimgH 
                            local rot = getPedCameraRotation( localPlayer ) 
                            table.insert(blips,{x = blip_x, y = blip_y,icon = icon}) 
                        end 
                    end 
     end,10000,0) 
      
    addEventHandler ("onClientPreRender",root, 
            function () 
  
                dxSetRenderTarget( mapRadar,true )      
                dxDrawImage (0,0,MimgW,MimgH, radarTexture)    
                 
                    for i, v in ipairs( blips ) do 
                            local rot = getPedCameraRotation( localPlayer ) 
                            dxDrawImage(v.x-20/2, v.y-20/2, 20, 20,icons[v.icon],rot) 
                    end 
                for i, v in ipairs(getElementsByType('player') ) do 
                    if v ~= localPlayer then  
                            local r,g,b = 20,200,20 or getPlayerNametagColor(v)  
                            local px,py = getElementPosition(v) 
                            local p_x = (3000+px)/6000*MimgW 
                            local p_y = (3000-py)/6000*MimgH 
                            local prot = getPedRotation( v ) 
                            local p_blipsize = 20-currentZoomState 
                            dxDrawImage (p_x-p_blipsize/2,p_y-p_blipsize/2,p_blipsize,p_blipsize, icons[3],-prot,0,0,tocolor(r,g,b))    
                    end 
                end 
                dxSetRenderTarget(  )      
             
                dxSetRenderTarget( radararea,true )      
                 
                    for i, v in ipairs( getElementsByType('radararea') ) do 
                            local r,g,b,a = getRadarAreaColor(v) 
                            local w,h = getRadarAreaSize(v) 
                            x,y = getElementPosition(v) 
                             
                            x = x / (6000 / MimgW)  + MimgW/2  
                            y = y / (-6000/ MimgH) + MimgH/2  
                            dxDrawRectangle(x, (y-h) + 4 + (h/2), (w/2), (h/2), tocolor(r,g,b,a)) 
  
  
                    end 
                dxSetRenderTarget(  )      
             
                dxSetRenderTarget( radar,true )            
                    local x,y,z = getElementPosition(localPlayer) 
                    local rot = getPedCameraRotation( localPlayer ) 
                    local mapx = x / (6000/MimgW) + MimgW/2 - width*currentZoomState/2 
                    local mapy = y / (-6000/MimgH) + MimgH/2 - height*currentZoomState/2 
  
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,mapRadar,-rot) 
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,radararea,-rot) 
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,pathmap,-rot) 
                     
                    local px,py = getElementPosition(localPlayer) 
                    local prot = getPedRotation( localPlayer ) 
                    local pblipsize = 20 - currentZoomState 
                    dxDrawImage (width/2-pblipsize/2,height/2-pblipsize/2,pblipsize,pblipsize, icons[3],-rot-prot)    
                dxSetRenderTarget()    
    showPlayerHudComponent("radar",false) 
  
     
    dxDrawImageSection(s[1]*50/1440, s[2]*650/900, s[1]*300/1440, s[2]*200/900, 450,490, 300, 200,radar, 0, -90, 0, tocolor(255, 255, 255, 255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*650/900,s[1]*300/1440,s[2]*2/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*850/900,s[1]*300/1440,s[2]*2/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*350/1440, s[2]*650/900,s[1]*2/1440,s[2]*202/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*650/900,s[1]*2/1440,s[2]*200/900,tocolor(0,0,0,255),true) 
  
    local x,y,z = getElementPosition(localPlayer) 
    local zone = getZoneName(x,y,z) 
    local textwidth = dxGetTextWidth(zone, 1.02,"default-bold") 
     
    dxDrawRectangle(s[1]*50/1440, s[2]*820/900,s[1]*(textwidth+25)/1440,s[2]*30/900,tocolor(0,0,0,120),true) 
    dxDrawText ( zone, s[1]*63/1440, s[2]*828/900,s[1]*(textwidth+25)/1440,s[2]*30/900, tocolor ( 255, 255, 255, 255 ), 1.02, "default-bold", "left", "top",false,false,true,false,true, 0,0,0) 
         
                if getKeyState("num_add") then 
                    if  currentZoomState - 0.01 < 0.5 then 
                        return 
                    else 
                        currentZoomState = currentZoomState - 0.03 
                     end 
                elseif getKeyState("num_sub") then 
                    if  currentZoomState + 0.01 > 1.5 then 
                        return 
                    else 
                        currentZoomState = currentZoomState + 0.03 
                     end 
                end 
             
            end 
   ) 
end) 

Posted
local MimgW,MimgH    = dxGetMaterialSize(mapRadar) 

Remove the "local" infront of it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post the new code.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Post the new code.
--// Created by KryPtoHolYx 
--\\ 
  
local s = {guiGetScreenSize()} 
local icons = {} 
for k = 1,65 do 
icons[k] = dxCreateTexture("blips/"..k..".png") 
end 
local blips = {} 
addEventHandler( "onClientResourceStart", getRootElement( ),function (res) 
    if res ~= getThisResource() then return end 
  
        radarTexture = dxCreateTexture("radar.jpg") 
        currentZoomState = 0.5 
        local width, height = 1200,1200 
        radar = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900 ) 
        mapRadar = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true ) 
        radararea = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true ) 
        pathmap = dxCreateRenderTarget( s[1]*width*3/1440, s[2]*height*3/900,true ) 
      
    --local MimgW,MimgH    = dxGetMaterialSize(radarTexture) 
     MimgW, MimgH = dxGetMaterialSize(mapRadar) 
      
     setTimer(function () 
                blips = {} 
                    for i, v in ipairs( getElementsByType('blip') ) do 
                            local icon = getBlipIcon(v) 
                        if icon > 3 then 
                            local px,py = getElementPosition(v) 
                            local blip_x = (3000+px)/6000*MimgW 
                            local blip_y = (3000-py)/6000*MimgH 
                            local rot = getPedCameraRotation( localPlayer ) 
                            table.insert(blips,{x = blip_x, y = blip_y,icon = icon}) 
                        end 
                    end 
     end,10000,0) 
      
    addEventHandler ("onClientPreRender",root, 
            function () 
  
                dxSetRenderTarget( mapRadar,true )     
                dxDrawImage (0,0,MimgW,MimgH, radarTexture)   
                
                    for i, v in ipairs( blips ) do 
                            local rot = getPedCameraRotation( localPlayer ) 
                            dxDrawImage(v.x-20/2, v.y-20/2, 20, 20,icons[v.icon],rot) 
                    end 
                for i, v in ipairs(getElementsByType('player') ) do 
                    if v ~= localPlayer then 
                            local r,g,b = 20,200,20 or getPlayerNametagColor(v) 
                            local px,py = getElementPosition(v) 
                            local p_x = (3000+px)/6000*MimgW 
                            local p_y = (3000-py)/6000*MimgH 
                            local prot = getPedRotation( v ) 
                            local p_blipsize = 20-currentZoomState 
                            dxDrawImage (p_x-p_blipsize/2,p_y-p_blipsize/2,p_blipsize,p_blipsize, icons[3],-prot,0,0,tocolor(r,g,b))   
                    end 
                end 
                dxSetRenderTarget(  )     
            
                dxSetRenderTarget( radararea,true )     
                
                    for i, v in ipairs( getElementsByType('radararea') ) do 
                            local r,g,b,a = getRadarAreaColor(v) 
                            local w,h = getRadarAreaSize(v) 
                            x,y = getElementPosition(v) 
                            
                            x = x / (6000 / MimgW)  + MimgW/2 
                            y = y / (-6000/ MimgH) + MimgH/2 
                            dxDrawRectangle(x, (y-h) + 4 + (h/2), (w/2), (h/2), tocolor(r,g,b,a)) 
  
  
                    end 
                dxSetRenderTarget(  )     
            
                dxSetRenderTarget( radar,true )           
                    local x,y,z = getElementPosition(localPlayer) 
                    local rot = getPedCameraRotation( localPlayer ) 
                    local mapx = x / (6000/MimgW) + MimgW/2 - width*currentZoomState/2 
                    local mapy = y / (-6000/MimgH) + MimgH/2 - height*currentZoomState/2 
  
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,mapRadar,-rot) 
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,radararea,-rot) 
                    dxDrawImageSection (0,0,width,height,mapx,mapy,width*currentZoomState,height*currentZoomState,pathmap,-rot) 
                    
                    local px,py = getElementPosition(localPlayer) 
                    local prot = getPedRotation( localPlayer ) 
                    local pblipsize = 20 - currentZoomState 
                    dxDrawImage (width/2-pblipsize/2,height/2-pblipsize/2,pblipsize,pblipsize, icons[3],-rot-prot)   
                dxSetRenderTarget()   
    showPlayerHudComponent("radar",false) 
  
    
    dxDrawImageSection(s[1]*50/1440, s[2]*650/900, s[1]*300/1440, s[2]*200/900, 450,490, 300, 200,radar, 0, -90, 0, tocolor(255, 255, 255, 255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*650/900,s[1]*300/1440,s[2]*2/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*850/900,s[1]*300/1440,s[2]*2/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*350/1440, s[2]*650/900,s[1]*2/1440,s[2]*202/900,tocolor(0,0,0,255),true) 
    dxDrawRectangle(s[1]*50/1440, s[2]*650/900,s[1]*2/1440,s[2]*200/900,tocolor(0,0,0,255),true) 
  
    local x,y,z = getElementPosition(localPlayer) 
    local zone = getZoneName(x,y,z) 
    local textwidth = dxGetTextWidth(zone, 1.02,"default-bold") 
    
    dxDrawRectangle(s[1]*50/1440, s[2]*820/900,s[1]*(textwidth+25)/1440,s[2]*30/900,tocolor(0,0,0,120),true) 
    dxDrawText ( zone, s[1]*63/1440, s[2]*828/900,s[1]*(textwidth+25)/1440,s[2]*30/900, tocolor ( 255, 255, 255, 255 ), 1.02, "default-bold", "left", "top",false,false,true,false,true, 0,0,0) 
        
                if getKeyState("num_add") then 
                    if  currentZoomState - 0.01 < 0.5 then 
                        return 
                    else 
                        currentZoomState = currentZoomState - 0.03 
                     end 
                elseif getKeyState("num_sub") then 
                    if  currentZoomState + 0.01 > 1.5 then 
                        return 
                    else 
                        currentZoomState = currentZoomState + 0.03 
                     end 
                end 
            
            end 
   ) 
end) 

Posted

It doesn't show any error here, it works perfectly fine.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I guess the blip is too big, that's why.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

The script has the "radar.jpg" missing.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I'm confused, what is the problem now? because you earlier posted some script errors, but they didn't appear when I tested it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
I'm confused, what is the problem now? because you earlier posted some script errors, but they didn't appear when I tested it.

the script worked for you?

did not work for me

Posted

Yes, it works fine.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Add this after dxGetMaterialSize:

outputChatBox ( tostring ( dxGetStatus ( ).VideoMemoryFreeForMTA ) ) ) 

And post the result.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...