#Mr.Rajo~,< Posted April 7, 2016 Share Posted April 7, 2016 يعني انا عامل 2 كلوم في القريد لستوفاتح جدول الكلوم اسمه ID والتاني Skins عاوز ال2 يتكتو في حاجات ومفروض اعمل حاجه 3 عشان رقم السكين انا عملته كدا {'Army','123',2}, ما طلعلي 123 في القريد لست @ شوف امسح اللي بالنوت باد كله وحط هذا بكلاينت ranks = { {'Skin1',1}, {'Skin2',2}, {'Skin3',3} } addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(242, 139, 318, 332, ":: Skins Systeam :", false) guiWindowSetSizable(wnd, false) guiSetVisible(wnd, false) grid = guiCreateGridList(9, 23, 289, 207, false, wnd) guiGridListAddColumn(grid, "Name", 0.9) guiGridListAddColumn(grid, "ID", 0.9) btn = guiCreateButton(17, 254, 276, 47, "Buy", false, wnd) end ) bindKey("x","down", function ( ) guiSetVisible ( wnd , not guiGetVisible ( wnd ) ) SetSkins() showCursor ( not isCursorShowing ( ) ) end ); function SetSkins() for _, v in ipairs (ranks) do local Row = guiGridListAddRow(grid) guiGridListSetItemText(grid, Row, 1, v[1], false, false) guiGridListSetItemText(grid, Row, 2, v[2], false, false) end end addEventHandler("onGUIClientClick" ,resourceRoot , function () if ( source == btn ) then local SkinID = guiGridListGetItemText(grid ,guiGridListGetSelectedItem(grid) ,2) triggerServerEvent("SetSkin" ,localPlayer ,SkinID ) end end ) وهذا حطه بسيرفر addEvent("SetSkin" ,true) addEventHandler("SetSkin" ,root, function (ID) PMoney = getPlayerMoney(source) if PMoney >= 2500 then setElementModel(source ,ID) takePlayerMoney(source,2500) outputChatBox("U bought a new skin",source ,255,255,255,false) else outputChatBox("U don't have 2500$",source ,255,255,255,false) end end ) واذا تبي تحط عامود ثالث تسوي بفنكشن setSkins كذا function SetSkins() for _, v in ipairs (ranks) do local Row = guiGridListAddRow(grid) guiGridListSetItemText(grid, Row, 1, v[1], false, false) guiGridListSetItemText(grid, Row, 2, v[2], false, false) guiGridListSetItemText(grid, Row, 3, v[3], false, false) end end Link to comment
#Untied Posted April 7, 2016 Author Share Posted April 7, 2016 (edited) DTC1 Edited April 7, 2016 by Guest Link to comment
#Untied Posted April 7, 2016 Author Share Posted April 7, 2016 (edited) DTC1 Edited April 7, 2016 by Guest Link to comment
#|_oskar_|# Posted April 7, 2016 Share Posted April 7, 2016 قوس + اند بسطر 20 و 21 زياده Link to comment
#|_oskar_|# Posted April 7, 2016 Share Posted April 7, 2016 قوس + اند بسطر 20 و 21 زياده 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