Jump to content

[HELP]Image for weapon rendering is not working .


Recommended Posts

Posted

Hi guys! I want to make a script ,like this : If for example a M4 is in my hand , then an m4 image appears . But it's not working :/ 

The script : 

local x,y = guiGetScreenSize()
local oX, oY = 1920, 1080
function weaponRender ()
 local weapon = getPedWeapon(localPlayer)
 if weapon == 356 then
 
  dxDrawImage(1650/oX*x, 120/oY*y, 250, 200, "guns/0.png", 0, 0, 0, tocolor(255, 255, 200, 255)) 
 end
  
end
addEventHandler("onClientRender", root, weaponRender)
Posted
16 minutes ago, DarkMagic said:

if weapon == 356 then

There is no such weapon ID in MTA. M4 ID would be 31.

  • Thanks 1

If I helped you, make sure you click the reaction button on the right to support me!
It will grant me more visibility and will help me to help others!

If you have any kind of request or subject you would like to discuss about with me,
don't hesitate to send me a private message about it!

 

Posted
1 minute ago, DarkMagic said:

Ohhh . Thank u , It' s working now :)

You're welcome :)

If I helped you, make sure you click the reaction button on the right to support me!
It will grant me more visibility and will help me to help others!

If you have any kind of request or subject you would like to discuss about with me,
don't hesitate to send me a private message about it!

 

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...