Ulysses

General => Developers Corner => Topic started by: DankNessProvides on April 11, 2016, 12:54:31 AM

Title: Yet another error
Post by: DankNessProvides 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