Jump to content

join intro


sagi100

Recommended Posts

Posted (edited)

hey , can some one help me , i need a script of this:

when i join the server it will show   logo / image /  for 7 seconds , and then it will stop auto.

Edited by sagi100
  • Moderators
Posted

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

 

Posted
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

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

  • Moderators
Posted
Just now, sagi100 said:

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

I have no idea.

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

  • Moderators
Posted (edited)
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
Posted
Just now, Patrick2562 said:

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

i have did it already

  • Moderators
Posted
1 minute ago, sagi100 said:

i have did it already

In meta you use 'image/image.png', but in the script I set the folder name to 'images'. I think you forgotten a 's'.

Posted
3 minutes ago, Patrick2562 said:

In meta you use 'image/image.png', but in the script I set the folder name to 'images'. I think you forgotten a 's'.

still not work bro

  • Moderators
Posted
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.

Posted
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?

  • Moderators
Posted
Just now, sagi100 said:

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

can you help me?

Bro... check the settings....

Posted
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?

  • Moderators
Posted
Just now, sagi100 said:

and its shows up too late

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

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

Posted
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?

  • Moderators
Posted
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,

 

Posted
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?

Posted (edited)
14 minutes ago, Patrick2562 said:

I have not. Upload it to imgur and send me the link.

https://imgur.com/a/6B6Sd

14 minutes ago, Patrick2562 said:

I have not. Upload it to imgur and send me the link.

do you know bro?

 

Edited by sagi100

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