Fox261098 Posted May 16, 2016 Share Posted May 16, 2016 Hello i made an gui but it doesnt open can somone teach me how to find errors. code GUIEditor = { button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function(gui) GUIEditor.window[1] = guiCreateWindow(424, 489, 942, 252, "Skin Panel 1.0 Beta1", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(24, 38, 173, 55, "Crysis Nanosuit", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(745, 41, 173, 55, "Crysis Nanosuit", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(385, 41, 173, 55, "Crysis Nanosuit", false, GUIEditor.window[1]) addCommandHandler ("panel", gui) --- Events addEventHandler("onClientGUIClick", GUIEditor.button[1], skin1, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], skin2, false) addEventHandler("onClientGUIClick", GUIEditor.button[3], skin3, false) end) addEventHandler("onClientRender", root, function() dxDrawText("Skin Panely by LuckyDude", 506, 374, 825, 431, tocolor(6, 248, 6, 255), 3.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(469, 464, 1338, 463, tocolor(39, 12, 241, 255), 5, false) end ) function skin1 () nanosuitTXD = engineLoadTXD("nanosuit.txd") engineImportTXD(nanosuitTXD, 23 ) nanosuitDFF = engineLoadDFF("nanosuit.dff") engineReplaceModel(nanosuitDFF, 23) end end function skin2 () anonymousTXD = engineLoadTXD("anonymous.txd") engineImportTXD(anonymousTXD, 24 ) anonymousDFF = engineLoadDFF("anonymous.dff") engineReplaceModel(anonymousDFF, 24) end end function skin3 () screamTXD = engineLoadTXD("scream.txd") engineImportTXD(screamTXD, 25 ) screamDFF = engineLoadDFF("scream.dff") engineReplaceModel(screamDFF, 25) end end Link to comment
Fox261098 Posted May 16, 2016 Author Share Posted May 16, 2016 guiSetVisible showCursor Where to put dat Link to comment
Fox261098 Posted May 16, 2016 Author Share Posted May 16, 2016 Ok i fixed it and its opening but it doesnt change the skin Link to comment
Bean666 Posted May 16, 2016 Share Posted May 16, 2016 try this : add this in client: addEventHandler("onClientGUIClick",GUIEditor.button[1],function() if ( source == GUIEditor.button[1]) then triggerServerEvent ("skin1",getLocalPlayer(),skin1) end end ) addEventHandler("onClientGUIClick",GUIEditor.button[2],function() if ( source == GUIEditor.button[2]) then triggerServerEvent ("skin2",getLocalPlayer(),skin2) end end ) addEventHandler("onClientGUIClick",GUIEditor.button[3],function() if ( source == GUIEditor.button[3]) then triggerServerEvent ("skin3",getLocalPlayer(),skin3) end end ) server: addEvent("skin1",true) addEventHandler("skin1",root, function() if ( getPlayerMoney (source) >= 0 ) then setElementModel ( source, 23 ) end end) addEvent("skin2",true) addEventHandler("skin2",root, function() if ( getPlayerMoney (source) >= 0 ) then setElementModel ( source, 24 ) end end) addEvent("skin3",true) addEventHandler("skin3",root, function() if ( getPlayerMoney (source) >= 0 ) then setElementModel ( source, 25 ) end end) Link to comment
BEN. Posted May 16, 2016 Share Posted May 16, 2016 Don't write 2 end after function and try this function skin1 () nanosuitTXD = engineLoadTXD("nanosuit.txd") engineImportTXD(nanosuitTXD, 23 ) nanosuitDFF = engineLoadDFF("nanosuit.dff") engineReplaceModel(nanosuitDFF, 23) setPedSkin(localPlayer,23) end function skin2 () anonymousTXD = engineLoadTXD("anonymous.txd") engineImportTXD(anonymousTXD, 24 ) anonymousDFF = engineLoadDFF("anonymous.dff") engineReplaceModel(anonymousDFF, 24) setPedSkin(localPlayer,24) end function skin3 () screamTXD = engineLoadTXD("scream.txd") engineImportTXD(screamTXD, 25 ) screamDFF = engineLoadDFF("scream.dff") engineReplaceModel(screamDFF, 25) setPedSkin(localPlayer,25) end Link to comment
AlvareZ_ Posted May 16, 2016 Share Posted May 16, 2016 Don't write 2 end after function and try this function skin1 () nanosuitTXD = engineLoadTXD("nanosuit.txd") engineImportTXD(nanosuitTXD, 23 ) nanosuitDFF = engineLoadDFF("nanosuit.dff") engineReplaceModel(nanosuitDFF, 23) setPedSkin(localPlayer,23) end function skin2 () anonymousTXD = engineLoadTXD("anonymous.txd") engineImportTXD(anonymousTXD, 24 ) anonymousDFF = engineLoadDFF("anonymous.dff") engineReplaceModel(anonymousDFF, 24) setPedSkin(localPlayer,24) end function skin3 () screamTXD = engineLoadTXD("scream.txd") engineImportTXD(screamTXD, 25 ) screamDFF = engineLoadDFF("scream.dff") engineReplaceModel(screamDFF, 25) setPedSkin(localPlayer,25) end read the wiki: setPedSkin Shared function This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. Please use setElementModel instead. Link to comment
BEN. Posted May 16, 2016 Share Posted May 16, 2016 Oh really but now I don't have a problems with it Link to comment
Fox261098 Posted May 16, 2016 Author Share Posted May 16, 2016 Don't write 2 end after function and try this function skin1 () nanosuitTXD = engineLoadTXD("nanosuit.txd") engineImportTXD(nanosuitTXD, 23 ) nanosuitDFF = engineLoadDFF("nanosuit.dff") engineReplaceModel(nanosuitDFF, 23) setPedSkin(localPlayer,23) end function skin2 () anonymousTXD = engineLoadTXD("anonymous.txd") engineImportTXD(anonymousTXD, 24 ) anonymousDFF = engineLoadDFF("anonymous.dff") engineReplaceModel(anonymousDFF, 24) setPedSkin(localPlayer,24) end function skin3 () screamTXD = engineLoadTXD("scream.txd") engineImportTXD(screamTXD, 25 ) screamDFF = engineLoadDFF("scream.dff") engineReplaceModel(screamDFF, 25) setPedSkin(localPlayer,25) end Works fine but i made setElementModel not setPedSkin cuz it wont work with setpedskin Link to comment
#|_oskar_|# Posted May 16, 2016 Share Posted May 16, 2016 try this function ReplaceModel(Name,ID) engineImportTXD(engineLoadTXD(Name..'.txd'),ID) engineReplaceModel(engineLoadDFF(Name..'.dff'),ID) setElementModel(localPlayer,ID) end --- function skin1 () ReplaceModel('nanosuit',23) end function skin2 () ReplaceModel('anonymous',24) end function skin3 () ReplaceModel('screamTXD',25) end Link to comment
BEN. Posted May 16, 2016 Share Posted May 16, 2016 I think setElementModel will better. Use it 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