iMr.G[7]A Posted May 15, 2014 Share Posted May 15, 2014 كود شوب سيارات ~ يوم اشتري سياره وابي اظهرهآ تطلع واحد ابي حل ابي تعدلون لي الكود ذا ابي اشتري اكثر من سياره واظهرهـأ يعني قصدي اشتري سيارتين واظهرها من اف 2 ابي يوم اظهرها ما تطلع 1 ابي يوم افتح اللوحه اقدر اختر سياره من اللي شرييتها اتمنى فهمتو اللي ما فهم يجي سكايب اشرحله باالتفصيل الكود local screenX, screenY = guiGetScreenSize() local width, height = 200, 200 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) local lp = getLocalPlayer() theWindow = guiCreateWindow(x,y,width,height,"Car Control / التحكم بالسيارة",false) guiWindowSetSizable(theWindow,false) guiSetVisible (theWindow, false) spawnBut = guiCreateButton(0.0604,0.120,0.4,0.2,"Spawn \n إظهار",true,theWindow) engenieBut = guiCreateButton(0.0604,0.420,0.4,0.2,"Engenie \n المحرك",true,theWindow) lockBut = guiCreateButton(0.490,0.420,0.4,0.2,"Lock \n قفل",true,theWindow) lightsBut = guiCreateButton(0.0604,0.720,0.4,0.2,"Lights \n النور",true,theWindow) destroyBut = guiCreateButton(0.490,0.120,0.4,0.2,"Destroy \n إخفاء",true,theWindow) function resourceStart () bindKey ("F2", "down", menuShow) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end addEvent ("carSpawn", true) addEvent ("carDestroy", true) function guiClick (button, state, absoluteX, absoluteY) if (source == spawnBut) then triggerServerEvent ("carSpawn", lp) elseif (source == destroyBut) then triggerServerEvent ("carDestroy", lp) elseif (source == engenieBut) then triggerServerEvent ("engenieSwitch", lp) elseif (source == lockBut) then triggerServerEvent ("lockSwitch", lp) elseif (source == lightsBut) then triggerServerEvent ("lightsSwitch", lp) end end addEventHandler ("onClientGUIClick", getRootElement(), guiClick) carshopWindow = guiCreateWindow(500,200,290,440,"Car Shop",false) guiSetVisible (carshopWindow, false) guiSetAlpha(carshopWindow,1) guiWindowSetSizable(carshopWindow,false) carPic = guiCreateStaticImage( 0.0423,0.0709,0.8889,0.408, "Png\\style.png", true,carshopWindow ) carGridList = guiCreateGridList(0.0476,0.5289,0.9048,0.33,true,carshopWindow) guiGridListSetSelectionMode(carGridList,0) carColumn = guiGridListAddColumn(carGridList,"Car",0.5) costColumn = guiGridListAddColumn(carGridList,"$",0.3) local cars = {{429,60000},{421,60000},{527,28000},{550,65000},{546,65000},{411,45000},{589,45000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (carGridList) guiGridListSetItemText (carGridList, row, 1, carName, false, true) guiGridListSetItemText (carGridList, row, 2, tostring(v[2]), false, true) end function navList ( key, keyState) local rowSel = guiGridListGetSelectedItem ( carGridList ) if key == "arrow_u" then guiGridListSetSelectedItem ( carGridList, tonumber(rowSel)-1, 1 ) elseif key == "arrow_d" then guiGridListSetSelectedItem ( carGridList, tonumber(rowSel)+1, 1 ) end local aCurrentVehicle = guiGridListGetItemText ( carGridList, guiGridListGetSelectedItem ( carGridList ), 1 ) guiStaticImageLoadImage ( carPic, "Png\\"..aCurrentVehicle..".png" ) end function aClickGuiCar (button) if (button == "left" ) then if (source == carGridList ) then aCurrentVehicle = guiGridListGetItemText ( carGridList, guiGridListGetSelectedItem ( carGridList ), 1 ) if ( carPic ) then if guiStaticImageLoadImage ( carPic, "Png\\"..aCurrentVehicle..".png" ) == false then guiStaticImageLoadImage ( carPic, "Png\\rien.png" ) end else local dd = destroyElement( carPic ) if ( dd ) then carPic = guiCreateStaticImage( 0.0423,0.0709,0.8889,0.408, "Png\\"..aCurrentVehicle..".png", true,carshopWindow ) end end end end end addEventHandler("onClientGUIClick",root,aClickGuiCar) guiSetAlpha(carGridList,1) buyButton = guiCreateButton(0.0476,0.8624,0.7778,0.0963,"Buy it / شراء السيارة",true,carshopWindow) guiSetAlpha(buyButton,1) closeButton = guiCreateButton(0.8571,0.8624,0.0899,0.1009,"x",true,carshopWindow) addEvent ("viewGUI", true) function viewGUI () if (getLocalPlayer() == source) then guiSetVisible (carshopWindow, true) showCursor (true) end end addEventHandler ("viewGUI", getRootElement(), viewGUI) function onClientGUIClick (button, state, absoluteX, absoluteYe) if (source == buyButton) then guiSetVisible (carshopWindow, false) showCursor (false) if (guiGridListGetSelectedItem (carGridList)) then local carName = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 1) local carID = getVehicleModelFromName (carName) local carCost = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 2) triggerServerEvent ("carShopCarBuy", getLocalPlayer(), carID, carCost, carName) end elseif (source == closeButton) then guiSetVisible (carshopWindow, false) showCursor (false) end end addEventHandler ("onClientGUIClick", getRootElement(), onClientGUIClick) fileDelete("client.lua") سكايب : xXG7AXx Link to comment
TAPL Posted May 15, 2014 Share Posted May 15, 2014 SQL الي تبي تسويه يحتاج خبرة في نظام الحفظ مثل dbConnect dbExec dbQuery dbPoll http://www.w3schools.com/sql/default.asp Link to comment
KING-_-HOHO Posted May 15, 2014 Share Posted May 15, 2014 +++ لازم تغير لوحة الإظهار وتسوي لوحة فيها قرييد لست علشان تختار منها السياره 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