Jump to content

Getting the weapon name


Clipper_

Recommended Posts

Hello Guys!

I wanna get the current weapon name of player and to draw it on my hud

local weapon = getPedWeapon (getLocalPlayer()) 
local weaponID = getWeaponNameFromID (getLocalPlayer(), weapon) 
dxDrawText("Weapon: "..weaponID..".", (0.585)*sWidth, (0.087)*sHeight, (0.293)*sWidth, (0.263)*sHeight, tocolor (64, 64, 64, 255),1.4,"pricedown","left","top",false,false,false,true) 

only with line 1, it shows me the ID. then tried to convert the ID in Name by following function from line 2.

TY

Link to comment

try that:

  
local weapon = getPedWeapon (getLocalPlayer()) 
local weaponID = getWeaponNameFromID (weapon) 
dxDrawText("Weapon: "..weaponID..".", (0.585)*sWidth, (0.087)*sHeight, (0.293)*sWidth, (0.263)*sHeight, tocolor (64, 64, 64, 255),1.4,"pricedown","left","top",false,false,false,true) 
  

Link to comment

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