sagi100 Posted April 7, 2018 Share Posted April 7, 2018 (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 April 7, 2018 by sagi100 Link to comment
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 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
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 1 minute ago, sagi100 said: it does not working errors? Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 Just now, sagi100 said: no,btw do you know how can i disable the original race intro? I have no idea. Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 Just now, Patrick2562 said: I have no idea. do you know why it does not working? Link to comment
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 You need a meta. Did you do that? Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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 Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 (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 April 7, 2018 by Patrick2562 Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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 Link to comment
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 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'. Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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 Link to comment
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 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
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 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.... Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 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 Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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 Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 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
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 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
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 (edited) What Intro? Send me a screenshot of it. Edited April 7, 2018 by Patrick2562 Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 1 minute ago, Patrick2562 said: What Intro? Send me a screenshot of it. do you have skype? Link to comment
Moderators Patrick Posted April 7, 2018 Moderators Share Posted April 7, 2018 Just now, sagi100 said: do you have skype? I have not. Upload it to imgur and send me the link. Link to comment
sagi100 Posted April 7, 2018 Author Share Posted April 7, 2018 (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 April 7, 2018 by sagi100 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now