Jump to content

join intro


sagi100

Recommended Posts

  • Moderators

CLIENT SIDE

local settings = {
	imageSource = "images/logo.png", -- example
 	imageWidth = 64, -- 64 pixels width
  	imageHeight = 64, -- 64 pixels height
 	showDuration = 10, -- hide after 10 sec
}

local sx,sy = guiGetScreenSize()

function renderImage()
	dxDrawImage(sx/2-settings.imageWidth/2,sy/2-settings.imageHeight/2,  settings.imageWidth, settings.imageHeight, settings.imageSource) -- image render
end

function showImageOnJoin()
	addEventHandler("onClientRender", getRootElement(), renderImage)  -- render function
 	setTimer(function()
    	removeEventHandler("onClientRender", getRootElement(), renderImage)
    end, 1000*settings.showDuration, 1) -- disable render after 'showDuration'
end


setTimer(showImageOnJoin, 2000, 1)  -- start render

 

Link to comment
21 minutes ago, Patrick2562 said:

CLIENT SIDE


local settings = {
	imageSource = "images/logo.png", -- example
 	imageWidth = 64, -- 64 pixels width
  	imageHeight = 64, -- 64 pixels height
 	showDuration = 10, -- hide after 10 sec
}

local sx,sy = guiGetScreenSize()

function renderImage()
	dxDrawImage(sx/2-settings.imageWidth/2,sy/2-settings.imageHeight/2,  settings.imageWidth, settings.imageHeight, settings.imageSource) -- image render
end

function showImageOnJoin()
	addEventHandler("onClientRender", getRootElement(), renderImage)  -- render function
 	setTimer(function()
    	removeEventHandler("onClientRender", getRootElement(), renderImage)
    end, 1000*settings.showDuration, 1) -- disable render after 'showDuration'
end


setTimer(showImageOnJoin, 2000, 1)  -- start render

 

it does not working

Link to comment
Just now, Patrick2562 said:

errors?

no,btw do you know how can i disable the original race intro?

local settings = {
    imageSource = "images/image.png", -- example
     imageWidth = 64, -- 64 pixels width
      imageHeight = 64, -- 64 pixels height
     showDuration = 10, -- hide after 10 sec
}

local sx,sy = guiGetScreenSize()

function renderImage()
    dxDrawImage(sx/2-settings.imageWidth/2,sy/2-settings.imageHeight/2,  settings.imageWidth, settings.imageHeight, settings.imageSource) -- image render
end

function showImageOnJoin()
    addEventHandler("onClientRender", getRootElement(), renderImage)  -- render function
     setTimer(function()
        removeEventHandler("onClientRender", getRootElement(), renderImage)
    end, 1000*settings.showDuration, 1) -- disable render after 'showDuration'
end


setTimer(showImageOnJoin, 2000, 1)  -- start render

 

meta:

<meta>
    <info author="sagi" version="1.1" name="intro_image" type="script" />

    <script src="intro.lua" type="client" />

    <file src="image/image.png" />

</meta>
 

Link to comment
Just now, Patrick2562 said:

You need a meta. Did you do that?

yes :

<meta>
    <info author="sagi" version="1.1" name="intro_image" type="script" />

    <script src="intro.lua" type="client" />

    <file src="image/image.png" />

</meta>
 

Link to comment
  • Moderators
2 minutes ago, sagi100 said:

yes :

<meta>
    <info author="sagi" version="1.1" name="intro_image" type="script" />

    <script src="intro.lua" type="client" />

    <file src="image/image.png" />

</meta>
 

In the script, you can see a settings table. Here you need change the 'imageSource' to "image/image.png". (Like in the meta.xml)

Edited by Patrick2562
Link to comment
  • Moderators
Just now, sagi100 said:

still not work bro

I can not believe it.

I think you don't use 'debugscript'. If you have admin rights, type this to console(F8): debugscript 3

After this, restart the script and send me the errors.

Link to comment
Just now, Patrick2562 said:

I can not believe it.

I think you don't use 'debugscript'. If you have admin rights, type this to console(F8): debugscript 3

After this, restart the script and send me the errors.

now its work , but it too small , and its keep shows up more than 10 sec since players join.

can you help me?

Link to comment
1 minute ago, Patrick2562 said:

I can not believe it.

I think you don't use 'debugscript'. If you have admin rights, type this to console(F8): debugscript 3

After this, restart the script and send me the errors.

and its shows up too late

Just now, Patrick2562 said:

Bro... check the settings....

like edit the script?

Link to comment
2 minutes ago, Patrick2562 said:

Change this: setTimer(showImageOnJoin, 2000, 1) -- start render

To this: setTimer(showImageOnJoin, 500, 1) -- start render

yes , now its great , i just need to make the image bigger like 1024 on 1024 can you help me with this?

Link to comment
  • Moderators
Just now, sagi100 said:

yes , now its great , i just need to make the image bigger like 1024 on 1024 can you help me with this?

Ohh my god.. Bro.. I made you a settings table.. Only for you... please check it...

Change this:..

imageWidth = 1024,
imageHeight = 1024,

 

Link to comment
3 minutes ago, Patrick2562 said:

Ohh my god.. Bro.. I made you a settings table.. Only for you... please check it...

Change this:..


imageWidth = 1024,
imageHeight = 1024,

 

tnx bro, now i just have to take off this race intro, do you know how?

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