Jump to content

Help Please in Welcome Msg


E-mail

Recommended Posts

Hi All i start Script dont work :(

  
col = {} 
col.black = tocolor(0,0,0,200) 
col.npctitle = tocolor(142,196,131,255) 
  
newsMsg = { 
"آهلا بكم في سيرفر كلآن هآو", 
"سجل في السيرفر ليتم حفظ نقآطك", 
"BaseMode1.1" 
} 
text = newsMsg[1] 
  
local start = getTickCount() 
function drawInfoBox() 
 --[[dxDrawRectangle(0,sh-24,sw,sh,col.black) 
 dxDrawText(test, 10,sh-20,sw,sh,col.npctitle, 1,"default")]] 
  
local now = getTickCount() 
 local time = now - start 
  local scale = 0.6 
  local font = "bankgothic" 
 local duration = 30000 
 local width = dxGetTextWidth(text, scale, font) 
  
 dxDrawRectangle(0, sh-24, sw, sh, col.black) 
  
  if time > duration then 
  start = now 
  
    text = newsMsg[math.random(1, table.getn(newsMsg))] 
  end 
 dxDrawText(text, math.mod(time, duration) / duration * (sw + width) - width, sh-20, sw, sh, col.npctitle, scale, font) 
end 
  
addEventHandler("onClientPreRender", drawInfoBox) 
  
  

Please Fix :|

Link to comment

Where is variable sw,sh this is not full code maybe show full code ?

  
col = {} 
col.black = tocolor(0,0,0,200) 
col.npctitle = tocolor(142,196,131,255) 
  
newsMsg = { 
"آهلا بكم في سيرفر كلآن هآو", 
"سجل في السيرفر ليتم حفظ نقآطك", 
"BaseMode1.1" 
} 
text = newsMsg[1] 
  
local start = getTickCount() 
function drawInfoBox() 
  
local now = getTickCount() 
 local time = now - start 
  local scale = 0.6 
  local font = "bankgothic" 
 local duration = 30000 
 local width = dxGetTextWidth(text, scale, font) 
  
 dxDrawRectangle(0, sh-24, sw, sh, col.black) 
  
  if time > duration then 
  start = now 
  
    text = newsMsg[math.random(1, table.getn(newsMsg))] 
  end 
 dxDrawText(text, math.mod(time, duration) / duration * (sw + width) - width, sh-20, sw, sh, col.npctitle, scale, font) 
end 
  
addEventHandler("onClientRender",root, drawInfoBox) 
  
  

Edited by Guest
Link to comment

Ok then try this...

  
col = {} 
col.black = tocolor(0,0,0,200) 
col.npctitle = tocolor(142,196,131,255) 
  
newsMsg = { 
"آهلا بكم في سيرفر كلآن هآو", 
"سجل في السيرفر ليتم حفظ نقآطك", 
"BaseMode1.1" 
} 
text = newsMsg[1] 
  
local start = getTickCount() 
function drawInfoBox() 
  
local now = getTickCount() 
 local time = now - start 
  local scale = 0.6 
  local font = "bankgothic" 
 local duration = 30000 
 local width = dxGetTextWidth(text, scale, font) 
  
 dxDrawRectangle(0, sh-24, sw, sh, col.black) 
  
  if time > duration then 
  start = now 
  
    text = newsMsg[math.random(1, table.getn(newsMsg))] 
  end 
 dxDrawText(text, math.mod(time, duration) / duration * (sw + width) - width, sh-20, sw, sh, col.npctitle, scale, font) 
end 
  
addEventHandler("onClientPreRender", drawInfoBox) 
  

Link to comment

Number one you wouldnt use on client resource start, It would have to be onplayer join. Which is server side. He's using on client pre render, So when you download all the files, the first thing you will see is that message.

Thats why ;) But a good shot at it capy, Your getting better and off topic, Sorry about before...

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