• Help with HasGunLicense [DarkRP]
    8 replies, posted
I have an error with HasGunLicense. What's the problem, I'm just a beginner in programming in Lua. Example [CODE]if LocalPlayer():getDarkRPVar("HasGunLicense") then draw.SimpleText("text",TargetID,0,0,Color(255,255,255,255),0, 2) end[/CODE] Error [CODE][ERROR] addons/darkrpmodification/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:118: attempt to concatenate a nil value 1. v - addons/darkrpmodification/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:118 2. unknown - lua/includes/modules/hook.lua:84 [/CODE]
According to the error that part of code you gave us has nothing to do with it. Also please, put code inside [CODE] tags like so: [CODE] -- HELLO [/CODE] [editline]18th January 2017[/editline] What is line 118 of cl_hudreplacement?
[QUOTE=geferon;51688683]According to the error that part of code you gave us has nothing to do with it. Also please, put code inside [CODE] tags like so: [CODE] -- HELLO [/CODE] [editline]18th January 2017[/editline] What is line 118 of cl_hudreplacement?[/QUOTE] [CODE]draw.SimpleText("Job: "..LocalPlayer():getDarkRPVar("job"),TargetID,ScrH() * 0.01, ScrW() * 0.590,Color(255,255,255,255),0, 2)[/CODE]
Do "Job: "..(LocalPlayer():getDarkRPVar("job") or "Undefined") as the first arg instead
[QUOTE=code_gs;51688755]Do "Job: "..(LocalPlayer():getDarkRPVar("job") or "Undefined") as the first arg instead[/QUOTE] Like that? [code]draw.SimpleText("Job: "..LocalPlayer():getDarkRPVar("job") or "Undefined"),TargetID,ScrH() * 0.01, ScrW() * 0.300,Color(255,255,255,255),0, 2)[/code]
You're missing the open parenthesis before the LocalPlayer call.
[QUOTE=code_gs;51688872]You're missing the open parenthesis before the LocalPlayer call.[/QUOTE] You can give the corrected code?
Reread my first post -- I already did.
Thanks to you code_gs, i already solved it [code]local hasLicense = LocalPlayer():getDarkRPVar( "HasGunlicense" ) if ( hasLicense ) then draw.SimpleText("text",TargetID,scrh * 0.18, scrw * 0.283 * 2,white) end[/code]
Sorry, you need to Log In to post a reply to this thread.