Jump to content

Help me plz


Haze

Recommended Posts

Posted

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 ) 

Posted (edited)

We don't make fixed codes for the people here. We tell you what's wrong, you must fix it yourself.

Edited by Guest
Posted (edited)
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
Posted

...But sometimes there is people that breaks the idea of learning how to script, and give you the fixed code just like that. lol.

Posted

any way TAPL thx m8 but i try it its not working m8 thx any way

Benxamix2 im learning but some Time i need Some Help i think u got Help too when u was Beginer

Posted

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 

Posted

dont post u must u must and u must just how i must learne what Function should i read and dont just put the wiki Link and say Go to Wiki :(

Posted

dud nvm Im sry cause i post here omg i think u dont wana help pepole i will just wait for JR10 and Solidsnake14

Posted

i have script, it no work, help pls, me no no whi, Plz help, i lern lua son Promise men Help plz. u don wan hhelp me i wait snake :(

YES! WE ARE EVIL WE NEVER HELP PEOPLE, MWAHAHAHAHA.

If you want help, give us the debug error.. /debugscript 3 and start your script.

Posted
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 

Posted

no error m8 in the deubgscript i just get when i tape the command for the 2 time Render alerday handled and that because i tape it 2 time but there is not Error dammn m8

Posted
 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

Posted
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 

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