ULX

Author Topic: Yet another error  (Read 1174 times)

0 Members and 1 Guest are viewing this topic.

Offline DankNessProvides

  • Newbie
  • *
  • Posts: 26
  • Karma: -3
Yet another error
« on: April 11, 2016, 12:54:31 AM »
I am getting an error with these lines of code and I know why it's because it's trying to call upon the GetPrintName of the weapon when the player is dead so it is creating an error but I cannot find a fix that works I have found fixes but they do not work at all. All help appreciated I have tried if LocalPlayer():GetActiveWeapon():GetPrintName() != nil and LocalPlayer():Alive()

Code: [Select]

if LocalPlayer():GetActiveWeapon():GetPrintName() != nil then
draw.SimpleText( LocalPlayer():GetActiveWeapon():GetPrintName(), "Trebuchet24", ScrW() / 2 + 690, ScrH() / 2 + 305, Color(255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
end