Jump to content

How do I put skins in my MTA server?


Altaïr

Recommended Posts

Posted

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!

Posted

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/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted
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

Posted

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/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted
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

Posted

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.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...