M[ROYAL]RII Posted August 12, 2015 Share Posted August 12, 2015 السلام عليكم انا سويت لوحه قريد ليست بها سكنات ولكن عند الضغط مرتين على القريد ما يعطينى السكن الكود List = { { 'skin',41}, { 'skin2',45 }, { 'skin3',54}, { 'skin4',91 }, } for i, c in ipairs ( List ) do local aRow = guiGridListAddRow ( GridList[1] ) guiGridListSetItemText ( GridList[1], aRow, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList[1], aRow, 2, c[1], false, false ) guiGridListSetItemColor(GridList[1], aRow, 2, 255, 255, 0, 255) guiGridListSetItemColor(GridList[1], aRow, 1, 0, 255, 255, 255) end addEventHandler("onClientDoubleGUIClick", root , function() if source == GridList[1] then ID = guiGridListGetItemText ( GridList[1], guiGridListGetSelectedItem ( GridList[1] ), 3 ) triggerServerEvent("skin", localPlayer , S ,ID) end end ) addEvent ("skin" , true) addEventHandler("skin",root, function(ID) setPedSkin (source, ID ) end ) Link to comment
The Killer Posted August 12, 2015 Share Posted August 12, 2015 List = { { 'skin',41}, { 'skin2',45 }, { 'skin3',54}, { 'skin4',91 }, } for i, c in ipairs ( List ) do local aRow = guiGridListAddRow ( GridList[1] ) guiGridListSetItemText ( GridList[1], aRow, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList[1], aRow, 2, c[1], false, false ) guiGridListSetItemColor(GridList[1], aRow, 2, 255, 255, 0, 255) guiGridListSetItemColor(GridList[1], aRow, 1, 0, 255, 255, 255) end addEventHandler("onClientDoubleGUIClick", root , function() if source == GridList[1] then ID = guiGridListGetItemText ( GridList[1], guiGridListGetSelectedItem ( GridList[1] ), 3 ) triggerServerEvent("skin", localPlayer , ID) end end ) Link to comment
Naif Posted August 12, 2015 Share Posted August 12, 2015 غير setPedSkin الى setElementModel Link to comment
; Mr.T76eM # Posted August 12, 2015 Share Posted August 12, 2015 addEvent ("skin" , true) addEventHandler("skin",root, function(ID) setPedSkin (source, ID ) end ) مثل ما قال لك هذا الفنكشن لا ينصح بأستخدامه Link to comment
Naif Posted August 12, 2015 Share Posted August 12, 2015 -- Client List = { { 'skin',41}, { 'skin2',45 }, { 'skin3',54}, { 'skin4',91 }, } for i, c in ipairs ( List ) do local aRow = guiGridListAddRow ( GridList[1] ) guiGridListSetItemText ( GridList[1], aRow, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList[1], aRow, 2, c[1], false, false ) guiGridListSetItemData ( GridList[1], aRow,1,c[2] ) guiGridListSetItemColor(GridList[1], aRow, 2, 255, 255, 0, 255) guiGridListSetItemColor(GridList[1], aRow, 1, 0, 255, 255, 255) end addEventHandler('onClientGUIClick',root, function ( ) if ( source == GridList[1] ) then if ( guiGridListGetSelectedItem ( GridList[1] ) ~= -1 ) then triggerServerEvent('onSkinAdd',localPlayer,guiGridListGetItemData(GridList[1],guiGridListGetSelectedItem(GridList[1]),1)) end end end ) -- Server addEvent('onSkinAdd',true) addEventHandler('onSkinAdd',root, function ( id ) setElementModel(client,id) end) Link to comment
</Mr.Tn6eL> Posted August 12, 2015 Share Posted August 12, 2015 (edited) client addEventHandler("onClientGUIDoubleClick", resourceRoot, function( ) if source == GridList[1] then local row = guiGridListGetSelectedItem(GridList[1]) if row ~= -1 then triggerServerEvent("skin", localPlayer, tonumber(guiGridListGetItemText(GridList[1], row, 2))) end end end) server addEvent("skin", true) addEventHandler("skin", root, function(ID) if ID then setElementModel(source, ID) end end) Edited August 12, 2015 by Guest Link to comment
M[ROYAL]RII Posted August 12, 2015 Author Share Posted August 12, 2015 انا احاول و اشوف من الويكي و فشلت Link to comment
</Mr.Tn6eL> Posted August 12, 2015 Share Posted August 12, 2015 أنت ضغطت على القريد ليست مرتين ؟ Link to comment
!#NssoR_) Posted August 12, 2015 Share Posted August 12, 2015 client addEventHandler("onClientDoubleGUIClick", resourceRoot, function( ) if source == GridList[1] then local row = guiGridListGetSelectedItem(GridList[1]) if row ~= -1 then triggerServerEvent("skin", localPlayer, tonumber(guiGridListGetItemText(GridList[1], row, 2))) end end end) server addEvent("skin", true) addEventHandler("skin", root, function(ID) if ID then setElementModel(source, ID) end end) اسم الحدث غلط المفروض يكون onClientGUIDoubleClick Link to comment
</Mr.Tn6eL> Posted August 12, 2015 Share Posted August 12, 2015 اسم الحدث غلط المفروض يكون onClientGUIDoubleClick انا نسخت كوده وعدلته مانتبهت له ياصاحب الموضوع انسخ كودي مرة ثانية 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