Altaïr Posted September 9, 2012 Posted September 9, 2012 Hello, I have a server with Hamachi, and I want to put public skins (everyone can see them). Because everytime I put one, I'm the onlyone than can see it. Why? If you can answer with pictures... I have Windows 7 Thanks!
Jaysds1 Posted September 9, 2012 Posted September 9, 2012 ok, if you're planning to put skins/pics on a gui then you would need to use guiCreateStaticImage else if you want to make others see the image that you see, then just use for _,v in ipairs(getElementsByType("player"))do local image=guiCreateStaticImage(x,y,width,height,"theimage.png",false) --create image setElementData(v,"image",image) --this is if you want to delete it after end My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Anderl Posted September 9, 2012 Posted September 9, 2012 ok,if you're planning to put skins/pics on a gui then you would need to use guiCreateStaticImage else if you want to make others see the image that you see, then just use for _,v in ipairs(getElementsByType("player"))do local image=guiCreateStaticImage(x,y,width,height,"theimage.png",false) --create image setElementData(v,"image",image) --this is if you want to delete it after end setElementData is doing nothing there, you can't delete the image by deleting element data. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Jaysds1 Posted September 9, 2012 Posted September 9, 2012 I know, If he brings down or close the image, then this code would come in: for _,v in ipairs(getElementsByType("player"))do If getElementData(v,"Image") then destroyElement(getElementData(v,"Image")) end end My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Anderl Posted September 9, 2012 Posted September 9, 2012 I know,If he brings down or close the image, then this code would come in: for _,v in ipairs(getElementsByType("player"))do If getElementData(v,"Image") then destroyElement(getElementData(v,"Image")) end end Pretty sure variables are not static, so image does not get deleted. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
robhol Posted September 9, 2012 Posted September 9, 2012 Do not post the same topic in more than one place. Locked. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
Recommended Posts