OrbTanT Posted August 4, 2014 Share Posted August 4, 2014 How can I set a picture in the background, an image to behind the skins, someone can help if possible. client: local x, y = guiGetScreenSize() SkinMusic = "data/music/SkinSelectMusic.mp3" SkinAnims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"} StartSkin = 0 NewSkin = false --client addEvent("TriggerClient",true) function SelectSkin () setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) setCameraMatrix( 2745.8266601563,-2231.1694335938,62.25520324707, 3999.9999499991,-2607.4000244141,16.1) skin = createPed ( StartSkin, 2749.7502441406,-2232.7170410156,61.727611541748,60 ) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) fadeCamera( true, 10) setTime(0,0) SkinSelectMusic = playSound(SkinMusic,true) bindKey("arrow_r","down",NextSkin) bindKey("arrow_l","down",LastSkin) bindKey(".","down",SpawnPlayer) addEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) guiSetVisible(lnextskin,true) guiSetVisible(rnextskin,true) guiSetVisible(spawnskin,true) showCursor(true) showChat(false) showPlayerHudComponent ( "radar", false ) end addEventHandler("TriggerClient",root,SelectSkin) function SpawnPlayer() local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b) unbindKey("arrow_r","down",NextSkin) unbindKey("arrow_l","down",LastSkin) unbindKey("lshift","down",SpawnPlayer) setTime(12,0) stopSound(SkinSelectMusic) removeEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(false) showChat(true) showPlayerHudComponent ( "radar", true ) guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) setElementData(getLocalPlayer(),"red",r) setElementData(getLocalPlayer(),"green",g) setElementData(getLocalPlayer(),"blue",b) end function NextSkin() if StartSkin == 312 then StartSkin = -1 elseif StartSkin == 2 then StartSkin = 8 end StartSkin = StartSkin + 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end function LastSkin() if StartSkin == 0 then StartSkin = 313 elseif StartSkin == 9 then StartSkin = 3 end StartSkin = StartSkin - 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end lnextskin = guiCreateButton(x-x/1.30,y/1.22,x/5,y/20,"<<<",false) guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") guiSetFont(lnextskin,"sa-header") rnextskin = guiCreateButton(x-x/2.90,y/1.22,x/5,y/20,">>>",false) guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") guiSetFont(rnextskin,"sa-header") spawnskin = guiCreateButton(x-x/1.80,y/1.22,x/5,y/20,"Play",false) guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") guiSetFont(spawnskin,"sa-header") guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) addEventHandler( "onClientGUIClick", getRootElement(), function() if source == lnextskin then LastSkin() elseif source == rnextskin then NextSkin() elseif source == spawnskin then SpawnPlayer() end end) ------PEDS function FreezeBots() local Bots = getElementsByType("ped") for k,v in ipairs(Bots) do setElementFrozen(v,true) end end Link to comment
xXMADEXx Posted August 4, 2014 Share Posted August 4, 2014 I'm sure there is another way, but the most simple way (that I could think of) would be to set an objects texture to the image and create the object behind the ped. Link to comment
OrbTanT Posted August 4, 2014 Author Share Posted August 4, 2014 It is possible to use dxDrawImage, or fadeCamera? Link to comment
Bonsai Posted August 5, 2014 Share Posted August 5, 2014 You could create a material line facing the camera. Easiest solution. https://wiki.multitheftauto.com/wiki/Dx ... rialLine3D Link to comment
OrbTanT Posted August 5, 2014 Author Share Posted August 5, 2014 Thanks for the help, one more thing, within the script skinSelector has an object created that would be the place where the ped is on top, how can I leave this object with alpha 0. I tried to do it this way, plus did not work. local object = createObject ( 3095, 2276.4716796875,-3781.8464355459,41.400001525879, 0, 0, 270 ) function object1() if isElement (object) then setElementAlpha (object, 0) end end addEventHandler("onResourceStart", getRootElement(), object1) Link to comment
Bonsai Posted August 5, 2014 Share Posted August 5, 2014 Maybe setting Alpha doesn't work for any object, no idea. Link to comment
Saml1er Posted August 5, 2014 Share Posted August 5, 2014 Try this local object = nil function object1() object = createObject ( 3095, 2276.4716796875,-3781.8464355459,41.400001525879, 0, 0, 270 ) if object and isElement (object) then setElementAlpha (object, 0) end end addEventHandler("onResourceStart", getRootElement(), object1) 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