3B00DG4MER Posted March 31, 2014 Posted March 31, 2014 Hello,Skin shop lol ,I think it's too hard this time ! all things alright one thing only which is when i click buy then nothing happened Client Side: addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) if ( tostring(Selected) ) then for i=1, 67 do clothe = getClothesByTypeIndex ( 0, i ) crow = guiGridListAddRow ( NameClothes_Grid ) guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) end end end) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == CloseClothesWindow then guiSetVisible(Clothes_Window,false) showCursor(false) end elseif source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes ( source, tostring(Selected2), "vest", Selected ) guiSetVisible(Clothes_Window,false) showCursor(false) end end)
3B00DG4MER Posted March 31, 2014 Author Posted March 31, 2014 Some message in the debug? There is No Bug
Alexs Posted March 31, 2014 Posted March 31, 2014 Try this: addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) if ( tostring(Selected) ) then for i=1, 67 do clothe = getClothesByTypeIndex ( 0, i ) crow = guiGridListAddRow ( NameClothes_Grid ) guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) end end end) addEventHandler("onClientGUIClick",root, function (b) if b == "left" then if source == CloseClothesWindow then guiSetVisible(Clothes_Window,false) showCursor(false) end elseif source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes ( source, tostring(Selected2), "vest", Selected ) guiSetVisible(Clothes_Window,false) showCursor(false) end end)
3B00DG4MER Posted March 31, 2014 Author Posted March 31, 2014 Try this: addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) if ( tostring(Selected) ) then for i=1, 67 do clothe = getClothesByTypeIndex ( 0, i ) crow = guiGridListAddRow ( NameClothes_Grid ) guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) end end end) addEventHandler("onClientGUIClick",root, function (b) if b == "left" then if source == CloseClothesWindow then guiSetVisible(Clothes_Window,false) showCursor(false) end elseif source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes ( source, tostring(Selected2), "vest", Selected ) guiSetVisible(Clothes_Window,false) showCursor(false) end end) Not work I tried to add outputchatbox But nothing mean Button problem ?
justn Posted March 31, 2014 Posted March 31, 2014 Removed 'end' on line 24, should work now. addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) if ( tostring(Selected) ) then for i=1, 67 do clothe = getClothesByTypeIndex ( 0, i ) crow = guiGridListAddRow ( NameClothes_Grid ) guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) end end end) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == CloseClothesWindow then guiSetVisible(Clothes_Window,false) showCursor(false) elseif source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes ( source, tostring(Selected2), "vest", Selected ) guiSetVisible(Clothes_Window,false) showCursor(false) end end)
3B00DG4MER Posted March 31, 2014 Author Posted March 31, 2014 Removed 'end' on line 24, should work now. addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) if ( tostring(Selected) ) then for i=1, 67 do clothe = getClothesByTypeIndex ( 0, i ) crow = guiGridListAddRow ( NameClothes_Grid ) guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) end end end) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == CloseClothesWindow then guiSetVisible(Clothes_Window,false) showCursor(false) elseif source == BuyClothes then local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes ( source, tostring(Selected2), "vest", Selected ) guiSetVisible(Clothes_Window,false) showCursor(false) end end) Thanks man !!
3B00DG4MER Posted March 31, 2014 Author Posted March 31, 2014 Now problem is can't add clothes Client side : addEventHandler("onClientGUIClick",Clothes_Window, function (beer) if b == "left" then if source == BuyClothes then guiSetVisible(Clothes_Window,false) local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) triggerServerEvent("getClothes",localPlayer,Selected,Selected2) outputChatBox("You Selected"..Selected.."for 0$") guiSetVisible(Clothes_Window,false) showCursor(false) end end end) Server Side: function get_Clothes ( Selected, Selected2 ) addPedClothes (source,""..tostring(Selected2).."", "hoodyamerc", tonumber(Selected) ) end addEvent("getClothes",true) addEventHandler("getClothes",getRootElement(),get_Clothes)
3B00DG4MER Posted April 1, 2014 Author Posted April 1, 2014 Now problem is can't add clothes Client side : addEventHandler("onClientGUIClick",Clothes_Window, function (beer) if b == "left" then if source == BuyClothes then guiSetVisible(Clothes_Window,false) local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) triggerServerEvent("getClothes",localPlayer,Selected,Selected2) outputChatBox("You Selected"..Selected.."for 0$") guiSetVisible(Clothes_Window,false) showCursor(false) end end end) Server Side: function get_Clothes ( Selected, Selected2 ) addPedClothes (source,""..tostring(Selected2).."", "hoodyamerc", tonumber(Selected) ) end addEvent("getClothes",true) addEventHandler("getClothes",getRootElement(),get_Clothes) No one ?
justn Posted April 1, 2014 Posted April 1, 2014 Try this ( I dont know if works ) (NOTE: Client Side Only) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == BuyClothes then guiSetVisible(Clothes_Window,false) local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes (localPlayer,tostring(Selected2),tostring(Selected2), tonumber(Selected)) outputChatBox("You selected a "..Selected2.." for $25") guiSetVisible(Clothes_Window,false) showCursor(false) end end end)
3B00DG4MER Posted April 1, 2014 Author Posted April 1, 2014 Try this ( I dont know if works ) (NOTE: Client Side Only) addEventHandler("onClientGUIClick",Clothes_Window, function (b) if b == "left" then if source == BuyClothes then guiSetVisible(Clothes_Window,false) local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) addPedClothes (localPlayer,tostring(Selected2),tostring(Selected2), tonumber(Selected)) outputChatBox("You selected a "..Selected2.." for $25") guiSetVisible(Clothes_Window,false) showCursor(false) end end end) Not working SO,NO ONE CAN FIX IT
Castillo Posted April 1, 2014 Posted April 1, 2014 You are using the same string for clothes texture and clothes model.
3B00DG4MER Posted April 1, 2014 Author Posted April 1, 2014 You are using the same string for clothes texture and clothes model. How do i get Texture from index then ?
justn Posted April 1, 2014 Posted April 1, 2014 My code works, for only some of the clothes like 'vest' etc..Maybe the local variable 'selected' isn't the type of clothes
3B00DG4MER Posted April 1, 2014 Author Posted April 1, 2014 There is a function. Just look for it in wiki. i mean how do i get model from texture or index ?
justn Posted April 2, 2014 Posted April 2, 2014 getClothesByTypeIndex This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).
3B00DG4MER Posted April 2, 2014 Author Posted April 2, 2014 getClothesByTypeIndex This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type). Thanks it work I'm waiting u to add it lol
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