devildead622 Posted March 29, 2013 Share Posted March 29, 2013 How can I make certain ids have defined another name? function hud ( ) local x, y = guiGetScreenSize() ammo = getPedTotalAmmo ( getLocalPlayer() ) clip = getPedAmmoInClip ( getLocalPlayer() ) weaponID = getPedWeapon(getLocalPlayer()) weapName = getWeaponNameFromID(weaponID) dxDrawText("#11A737"..weapName.." | "..clip.."/"..ammo,x-(x/2.9), y/33, x, y,tocolor(0,255,255,255),1.5,"clear","left","top",false,false,false,true) if isPedInVehicle (localPlayer) == false then return end Vname = getVehicleName(getPedOccupiedVehicle(localPlayer)) health = getElementHealth (getPedOccupiedVehicle(localPlayer)) sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) dxDrawText("#FFFFFFVeiculo: "..Vname,20.0,348.0,296.0,364.0,tocolor(0,255,255,255),0.5,"bankgothic","left","top",false,false,false,true) dxDrawText("#FFFFFFSaude do Veiculo: "..tostring(math.floor(health*0.1)).." %",20.0,368.0,296.0,384.0,tocolor(0,255,255,255),0.5,"bankgothic","left","top",false,false,false,true) dxDrawText("#FFFFFFVelocidade: "..tostring(kmhs).." Km/h",20.0,388.0,296.0,404.0,tocolor(0,255,255,255),0.5,"bankgothic","left","top",false,false,false,true) end addEventHandler("onClientRender",getRootElement(),hud) addEventHandler("onClientPlayerSpawn",getRootElement(),hud) so for example: weapName = if weaponID = 33 --the name will be: Lee Enfield but do not know how to do it Link to comment
iPrestege Posted March 29, 2013 Share Posted March 29, 2013 I didn't get it can you explain well? Link to comment
devildead622 Posted March 29, 2013 Author Share Posted March 29, 2013 In standard code, the name of the gun that is original game ( getWeaponNameFromID (weaponID) )! I want one that I choose to appear Link to comment
DNL291 Posted March 29, 2013 Share Posted March 29, 2013 Do you want to change the name of a specific weapon to show in dxText? Link to comment
devildead622 Posted March 30, 2013 Author Share Posted March 30, 2013 I want to change the name of all arms! Link to comment
devildead622 Posted March 30, 2013 Author Share Posted March 30, 2013 help-me!!!!!!!!!!! Link to comment
devildead622 Posted March 31, 2013 Author Share Posted March 31, 2013 sorry for the flood! but I need lots of help! someone? if only to say: impossible: even seems that this topic this invisible ... Link to comment
DNL291 Posted March 31, 2013 Share Posted March 31, 2013 Ok, try this: local weaponNames = { ["brassknuckle"] = "brassknuckle", ["golfclub"] = "golfclub", ["nightstick"] = "nightstick", ["knife"] = "knife", ["bat"] = "bat", ["shovel"] = "shovel", ["poolstick"] = "poolstick", ["katana"] = "katana", ["chainsaw"] = "chainsaw", ["dildo"] = "dildo", ["vibrator"] = "vibrator", ["flower"] = "flower", ["cane"] = "cane", ["grenade"] = "grenade", ["teargas"] = "teargas", ["molotov"] = "molotov", ["colt 45"] = "colt 45", ["silenced"] = "silenced", ["deagle"] = "deagle", ["shotgun"] = "shotgun", ["sawed-off"] = "sawed-off", ["combat shotgun"] = "combat shotgun", ["uzi"] = "uzi", ["mp5"] = "mp5", ["ak-47"] = "ak-47", ["m4"] = "m4", ["tec-9"] = "tec-9", ["rifle"] = "Lee Enfield", -- Custom weapon name ["sniper"] = "sniper", ["rocket launcher"] = "rocket launcher", ["rocket launcher hs"] = "rocket launcher hs", ["flamethrower"] = "flamethrower", ["minigun"] = "minigun", ["satchel"] = "satchel", ["bomb"] = "bomb", ["spraycan"] = "spraycan", ["fire extinguisher"] = "fire extinguisher", ["camera"] = "camera", ["nightvision"] = "nightvision", ["infrared"] = "infrared", } local _getWeaponNameFromID = getWeaponNameFromID function getWeaponNameFromID(weaponID) if weaponID then return weaponNames[_getWeaponNameFromID(weaponID)] else return false end end function hud ( ) local x, y = guiGetScreenSize() ammo = getPedTotalAmmo ( getLocalPlayer() ) clip = getPedAmmoInClip ( getLocalPlayer() ) weaponID = getPedWeapon(getLocalPlayer()) weapName = getWeaponNameFromID(weaponID) dxDrawText("#11A737"..weapName.." | "..clip.."/"..ammo,x-(x/2.9), y/33, x, y,tocolor(0,255,255,255),1.5,"clear","left","top",false,false,false,true) if isPedInVehicle (localPlayer) == false then return end Vname = getVehicleName(getPedOccupiedVehicle(localPlayer)) health = getElementHealth (getPedOccupiedVehicle(localPlayer)) sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) dxDrawText("#FFFFFFVeiculo: "..Vname,20.0,348.0,296.0,364.0,tocolor(0,255,255,255),0.5,"bankgothic","left","top",false,false,false,true) dxDrawText("#FFFFFFSaude do Veiculo: "..tostring(math.floor(health*0.1)).." %",20.0,368.0,296.0,384.0,tocolor(0,255,255,255),0.5,"bankgothic","left","top",false,false,false,true) dxDrawText("#FFFFFFVelocidade: "..tostring(kmhs).." Km/h",20.0,388.0,296.0,404.0,tocolor(0,255,255,255),0.5,"bankgothic","left","top",false,false,false,true) end addEventHandler("onClientRender",getRootElement(),hud) addEventHandler("onClientPlayerSpawn",getRootElement(),hud) Link to comment
devildead622 Posted March 31, 2013 Author Share Posted March 31, 2013 very thanks ^^ <3 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now