Jump to content

Help me plz


Haze

Recommended Posts

Hi all how are You today i try to code this script is to make wanted lvl show up with Dx but when i start the script and i tape the command it dose not work help me plz

function createText ( ) 
    wantedLvl = getPlayerWantedLevel ( ) 
    if wantedLvl == 0 then 
dxDrawText( wantedLvl, 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
   else 
  
dxDrawText( wantedLvl, 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
  
addCommandHandler ( "wanted", createText ) 

Link to comment
function createText () 
addEventHandler ( "onClientRender", root, DrawText ) 
end 
addCommandHandler ( "wanted", createText ) 
  
function DrawText () 
wantedLvl = getPlayerWantedLevel() 
     if wantedLvl == 0 then 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     else 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     end 
end 

Edited by Guest
Link to comment

huh?

local screenWidth, screenHeight = guiGetScreenSize() 
  
function createText () 
addEventHandler ( "onClientRender", root, DrawText ) 
end 
addCommandHandler ( "wanted", createText ) 
  
function DrawText () 
wantedLvl = getPlayerWantedLevel() 
     if wantedLvl == 0 then 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     else 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     end 
end 

Link to comment
function createText () 
  
addEventHandler ( "onClientRender", root, DrawText ) 
end 
addCommandHandler ( "wanted", createText ) 
  
function DrawText () 
  
local screenHeight, screenWidth = guiGetScreenSize() 
wantedLvl = getPlayerWantedLevel() 
     if wantedLvl == 0 then 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     else 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     end 
end 

Link to comment
 function displayText () 
  
local screenHeight, screenWidth = guiGetScreenSize() 
wantedLvl = getPlayerWantedLevel() 
     if wantedLvl == 0 then 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     else 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
     end 
end 
addEventHandler ( "onClientRender", root, displayText ) 
addCommandHandler ( "wanted", displayText ) 

Probably won't work, but try it

Link to comment
ERROR:dd\server.lua:9:attempt to perform arithmetic on global 'screenHeight' (a nill value)

you didn't see my post !

if you say not work then you are crazy LOL

local screenWidth, screenHeight = guiGetScreenSize() 
  
function createText () 
addEventHandler ( "onClientRender", root, DrawText ) 
end 
addCommandHandler ( "wanted", createText ) 
  
function DrawText () 
wantedLvl = getPlayerWantedLevel() 
     if wantedLvl == 0 then 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1.02, "pricedown" ) 
     else 
          dxDrawText(tostring(wantedLvl), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1.02, "pricedown" ) 
     end 
end 

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