Jump to content

Need Help


mint3d

Recommended Posts

I need some help on this code I made

When I login it still shows

  
local x,y = guiGetScreenSize() 
local textPosition = 0 -- Main counter. You can do the same with anything you want to move or change per frame. 
local text = "MOTD: Welcome to the server have fun!" 
local animate = true 
  
function renderText() 
   if animate == true then -- If we want to animate stuff 
      textPosition = textPosition + 1 
      if textPosition > x then 
         textPosition = 0 
      end 
   end 
   dxDrawText(text,textPosition,0.2/2,x,y, tocolor ( 255, 255, 255, 1000 ), 1.5, "default-bold" ) 
   dxDrawRectangle ( x/2.2, y/2000, x/0, y/25, tocolor ( 0, 0, 0, 255 ) ) -- Create our black transparent MOTD background Rectangle. -- Create our black transparent MOTD background Rectangle. -- Create our black transparent MOTD background Rectangle. -- draw the text -- Add this into the "if" check if you don't want to draw it anymore 
    dxDrawText(text,textPosition,0/2,x,y, tocolor ( 255, 255, 255, 1000 ), 1.5, "default-bold" ) 
end 
addEventHandler("onClientRender",getRootElement(),renderText) 
addEventHandler ( "onClientGUIClick",loginButton,function() 
   animate = false -- Stop animating. 
end) 

Link to comment
  
local x,y = guiGetScreenSize() 
local textPosition = 0 -- Main counter. You can do the same with anything you want to move or change per frame. 
local text = "MOTD: Welcome to the server have fun!" 
local animate = true 
  
function renderText() 
   if animate == true then -- If we want to animate stuff 
      textPosition = textPosition + 1 
      if textPosition > x then 
         textPosition = 0 
      end 
   dxDrawText(text,textPosition,0.2/2,x,y, tocolor ( 255, 255, 255, 1000 ), 1.5, "default-bold" ) 
   dxDrawRectangle ( x/2.2, y/2000, x/0, y/25, tocolor ( 0, 0, 0, 255 ) ) -- Create our black transparent MOTD background Rectangle. -- Create our black transparent MOTD background Rectangle. -- Create our black transparent MOTD background Rectangle. -- draw the text -- Add this into the "if" check if you don't want to draw it anymore 
    dxDrawText(text,textPosition,0/2,x,y, tocolor ( 255, 255, 255, 1000 ), 1.5, "default-bold" ) 
end 
end 
addEventHandler("onClientRender",getRootElement(),renderText) 
addEventHandler ( "onClientGUIClick",loginButton,function() 
   animate = false -- Stop animating. 
end) 

Link to comment

Didnt work

If it would be easier we could use onClientPLayerSpawn

local x,y = guiGetScreenSize() 
local textPosition = 0 -- Main counter. You can do the same with anything you want to move or change per frame. 
local text = "MOTD: Welcome to the server hope you have fun!" 
local animate = true 
  
function renderText() 
   if animate == true then -- If we want to animate stuff 
      textPosition = textPosition + 1 
      if textPosition > x then 
         textPosition = 0 
      end 
   dxDrawText(text,textPosition,0.2/2,x,y, tocolor ( 255, 255, 255, 1000 ), 1.5, "default-bold" ) 
   dxDrawRectangle ( x/2.2, y/2000, x/0, y/25, tocolor ( 0, 0, 0, 255 ) ) -- Create our black transparent MOTD background Rectangle. -- Create our black transparent MOTD background Rectangle. -- Create our black transparent MOTD background Rectangle. -- draw the text -- Add this into the "if" check if you don't want to draw it anymore 
    dxDrawText(text,textPosition,0/2,x,y, tocolor ( 255, 255, 255, 1000 ), 1.5, "default-bold" ) 
end 
end 
addEventHandler("onClientRender",getRootElement(),renderText) 
addEventHandler ( "onClientGUIClick",bLogin,function() 
   animate = false -- Stop animating. 
end) 

Link to comment
What do you mean remove onClientRender it needs that for it to work doesn't it?

This event is triggered every time GTA renders a new frame. It is required for the DirectX drawing functions, and also useful for other clientside operations that have to be applied repeatedly with very short time differences between them. 

You want to remove the dx right? Then just remove the event. :)

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