xXNemesiSXx Posted February 25, 2011 Share Posted February 25, 2011 So... now i've to edit a resource that isn't made by me... look here: https://community.multitheftauto.com/index.php?p= ... ils&id=593 i want to set that you must select your skin at the join... can anyone help me? here there is the script: c_skinselect.lua function CreateSelectorWindow() wdwselector = guiCreateWindow(0.438,0.880,0.15,0.10,"",true) guiWindowSetMovable(wdwselector,false) btnLeft = guiCreateButton(0.0,0.4,0.200,0.350,"<-",true,wdwselector) btnRight = guiCreateButton(0.76,0.4,0.200,0.350,"->",true,wdwselector) btnSelect = guiCreateButton(0.30,0.4,0.400,0.350,"Select",true,wdwselector) guiSetVisible(wdwselector, false) end function selectorenable () CreateSelectorWindow() addEventHandler("onClientGUIClick", btnLeft, clientSkinLeft, false) addEventHandler("onClientGUIClick", btnSelect, clientSkinSelect, false) addEventHandler("onClientGUIClick", btnRight, clientSkinRight, false) if (wdwselector ~= nil) then guiSetVisible(wdwselector, true) triggerServerEvent("FrontCamera", getLocalPlayer()) end showCursor(true) end addCommandHandler("skin", selectorenable, false, false) function clientSkinSelect(button) guiSetVisible(wdwselector, false) showCursor(false) triggerServerEvent("SkinSelected", getLocalPlayer()) end function clientSkinRight(button) triggerServerEvent("SkinRight", getLocalPlayer()) end function clientSkinLeft(button) triggerServerEvent("SkinLeft", getLocalPlayer()) end s_skinselect: function camf() local px,py,pz = getElementPosition( source ) local rot = setPedRotation(source, 1) setCameraMatrix( source, px, py+2, pz, px, py, pz) end addEvent("FrontCamera", true) addEventHandler("FrontCamera", getRootElement(), camf) function selected() fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Skin erflogreich geändert", source) end addEvent("SkinSelected", true) addEventHandler("SkinSelected", getRootElement(), selected) function skinright() local skin = getPedSkin(source) if (skin == 0) then setPedSkin(client, 7) elseif (skin == 7) then setPedSkin(client, 9) elseif (skin == 41) then setPedSkin(client, 43) elseif (skin == 64) then setPedSkin(client, 66) elseif (skin == 85) then setPedSkin(client, 87) elseif(skin == 118) then setPedSkin(client, 120) elseif(skin == 148) then setPedSkin(client, 150) elseif(skin == 207) then setPedSkin(client, 209) elseif(skin == 238) then setPedSkin(client, 240) elseif(skin == 264) then setPedSkin(client, 274) elseif(skin == 288) then setPedSkin(client, 0) else setPedSkin(source, skin+1) end end addEvent("SkinRight", true) addEventHandler("SkinRight", getRootElement(), skinright) function skinleft() local skin = getPedSkin(source) if (skin == 7) then setPedSkin(client, 0) elseif (skin == 9) then setPedSkin(client, 7) elseif (skin == 43) then setPedSkin(client, 41) elseif (skin == 66) then setPedSkin(client, 64) elseif (skin == 87) then setPedSkin(client, 85) elseif(skin == 120) then setPedSkin(client, 118) elseif(skin == 150) then setPedSkin(client, 148) elseif(skin == 209) then setPedSkin(client, 207) elseif(skin == 240) then setPedSkin(client, 238) elseif(skin == 274) then setPedSkin(client, 264) elseif(skin == 0) then setPedSkin(client, 288) else setPedSkin(source, skin-1) end end addEvent("SkinLeft", true) addEventHandler("SkinLeft", getRootElement(), skinleft) Link to comment
Castillo Posted February 25, 2011 Share Posted February 25, 2011 function CreateSelectorWindow() wdwselector = guiCreateWindow(0.438,0.880,0.15,0.10,"",true) guiWindowSetMovable(wdwselector,false) btnLeft = guiCreateButton(0.0,0.4,0.200,0.350,"<-",true,wdwselector) btnRight = guiCreateButton(0.76,0.4,0.200,0.350,"->",true,wdwselector) btnSelect = guiCreateButton(0.30,0.4,0.400,0.350,"Select",true,wdwselector) guiSetVisible(wdwselector, false) end function selectorenable () CreateSelectorWindow() addEventHandler("onClientGUIClick", btnLeft, clientSkinLeft, false) addEventHandler("onClientGUIClick", btnSelect, clientSkinSelect, false) addEventHandler("onClientGUIClick", btnRight, clientSkinRight, false) if (wdwselector ~= nil) then guiSetVisible(wdwselector, true) triggerServerEvent("FrontCamera", getLocalPlayer()) end showCursor(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), selectorenable) function clientSkinSelect(button) guiSetVisible(wdwselector, false) showCursor(false) triggerServerEvent("SkinSelected", getLocalPlayer()) end function clientSkinRight(button) triggerServerEvent("SkinRight", getLocalPlayer()) end function clientSkinLeft(button) triggerServerEvent("SkinLeft", getLocalPlayer()) end Check that. Link to comment
xXNemesiSXx Posted February 25, 2011 Author Share Posted February 25, 2011 function CreateSelectorWindow() wdwselector = guiCreateWindow(0.438,0.880,0.15,0.10,"",true) guiWindowSetMovable(wdwselector,false) btnLeft = guiCreateButton(0.0,0.4,0.200,0.350,"<-",true,wdwselector) btnRight = guiCreateButton(0.76,0.4,0.200,0.350,"->",true,wdwselector) btnSelect = guiCreateButton(0.30,0.4,0.400,0.350,"Select",true,wdwselector) guiSetVisible(wdwselector, false) end function selectorenable () CreateSelectorWindow() addEventHandler("onClientGUIClick", btnLeft, clientSkinLeft, false) addEventHandler("onClientGUIClick", btnSelect, clientSkinSelect, false) addEventHandler("onClientGUIClick", btnRight, clientSkinRight, false) if (wdwselector ~= nil) then guiSetVisible(wdwselector, true) triggerServerEvent("FrontCamera", getLocalPlayer()) end showCursor(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), selectorenable) function clientSkinSelect(button) guiSetVisible(wdwselector, false) showCursor(false) triggerServerEvent("SkinSelected", getLocalPlayer()) end function clientSkinRight(button) triggerServerEvent("SkinRight", getLocalPlayer()) end function clientSkinLeft(button) triggerServerEvent("SkinLeft", getLocalPlayer()) end Check that. Tomorrow i will try it Link to comment
xXNemesiSXx Posted February 27, 2011 Author Share Posted February 27, 2011 OK... it works perfectly, but i don't know how to add skins to the menu'... can you help me ? Link to comment
Castillo Posted February 27, 2011 Share Posted February 27, 2011 elseif (skin == id) then that way if i'm right. Link to comment
Moderators Citizen Posted February 27, 2011 Moderators Share Posted February 27, 2011 Yeah but it's not easy to add skin and close the loop of the skin selection Link to comment
Moderators Citizen Posted February 27, 2011 Moderators Share Posted February 27, 2011 Double Post: Ok I just understand the skin selection system, I explain you: All skins are available by this script so you can't add other skins In fact, this script jump the Non-working IDs ( see the bottom of this page ) elseif (skin == 7) then setPedSkin(client, 9) The skin 8 is a Non-working ID so he jump this ID and give the skin 9 Conclusion: All skins are available 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