Mostafa MohammeD Posted April 5, 2016 Author Share Posted April 5, 2016 الكودين ما اشتغلو Link to comment
Mostafa MohammeD Posted April 5, 2016 Author Share Posted April 5, 2016 الكودين ما اشتغلو Link to comment
YourMind Posted April 5, 2016 Share Posted April 5, 2016 -- Client GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 563) / 2, (screenH - 622) / 2, 563, 622, "لوحة استئجار السيارات", false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "C80AB9D3") guiSetVisible(wnd,false) grid = guiCreateGridList(9, 21, 263, 591, false, wnd) guiGridListAddColumn(grid, "the car", 0.5) guiGridListAddColumn(grid, "the price", 0.5) photo = guiCreateStaticImage(275, 27, 278, 179, "11.png", false, wnd) buy = guiCreateButton(278, 225, 275, 51, "استئجار السيارة", false, wnd) guiSetFont(buy, "default-bold-small") guiSetProperty(buy, "NormalTextColour", "C80AB9D3") light = guiCreateButton(278, 330, 275, 51, "تشغيل - اطفاء ضوء السيارة", false, wnd) guiSetFont(light, "default-bold-small") guiSetProperty(light, "NormalTextColour", "C80AB9D3") lock = guiCreateButton(278, 430, 275, 51, "قفل - فتح السيارة", false, wnd) guiSetFont(lock, "default-bold-small") guiSetProperty(lock, "NormalTextColour", "C80AB9D3") close = guiCreateButton(488, 557, 65, 55, "✖", false, wnd) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "C81DB8C1") GUIEditor.label[1] = guiCreateLabel(288, 576, 179, 15, "this mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 29, 184, 193) bindKey("F9","down", function () guiSetVisible (wnd ,not guiGetVisible (wnd)) showCursor(guiGetVisible(wnd)) end ) addEventHandler("onClientGUIClick",root, function () if source == close then guiSetVisible(wnd,false) showCursor(false) end end ) -- name . id . price cars ={ {"Ferari",429,50000}, {"Nissan",411,50000}, } for k,v in ipairs(cars) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemText(grid,row,2,v[3],false,false) guiGridListSetItemData(grid,row,1,v[2]) end addEventHandler("onClientGUIClick",buy, function () local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local id = guiGridListGetItemData(grid,sel,1) local money = guiGridListGetItemText (grid,sel,2) triggerServerEvent("givecar",localPlayer,id,money) end end ,false) -- Server gv = {} addEvent("givecar",true) addEventHandler("givecar",root, function (id,money) if isElement (gv[source]) then destroyElement(gv[source]) end local hisMoney = getPlayerMoney (source) if hisMoney >= tonumber (money) then takePlayerMoney (source,tonumber(money)) local x, y, z = getElementPosition(source) gv[source] = createVehicle (id, x, y, z) warpPedIntoVehicle(source,gv[source]) end end ) Link to comment
YourMind Posted April 5, 2016 Share Posted April 5, 2016 -- Client GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 563) / 2, (screenH - 622) / 2, 563, 622, "لوحة استئجار السيارات", false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "C80AB9D3") guiSetVisible(wnd,false) grid = guiCreateGridList(9, 21, 263, 591, false, wnd) guiGridListAddColumn(grid, "the car", 0.5) guiGridListAddColumn(grid, "the price", 0.5) photo = guiCreateStaticImage(275, 27, 278, 179, "11.png", false, wnd) buy = guiCreateButton(278, 225, 275, 51, "استئجار السيارة", false, wnd) guiSetFont(buy, "default-bold-small") guiSetProperty(buy, "NormalTextColour", "C80AB9D3") light = guiCreateButton(278, 330, 275, 51, "تشغيل - اطفاء ضوء السيارة", false, wnd) guiSetFont(light, "default-bold-small") guiSetProperty(light, "NormalTextColour", "C80AB9D3") lock = guiCreateButton(278, 430, 275, 51, "قفل - فتح السيارة", false, wnd) guiSetFont(lock, "default-bold-small") guiSetProperty(lock, "NormalTextColour", "C80AB9D3") close = guiCreateButton(488, 557, 65, 55, "✖", false, wnd) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "C81DB8C1") GUIEditor.label[1] = guiCreateLabel(288, 576, 179, 15, "this mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 29, 184, 193) bindKey("F9","down", function () guiSetVisible (wnd ,not guiGetVisible (wnd)) showCursor(guiGetVisible(wnd)) end ) addEventHandler("onClientGUIClick",root, function () if source == close then guiSetVisible(wnd,false) showCursor(false) end end ) -- name . id . price cars ={ {"Ferari",429,50000}, {"Nissan",411,50000}, } for k,v in ipairs(cars) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemText(grid,row,2,v[3],false,false) guiGridListSetItemData(grid,row,1,v[2]) end addEventHandler("onClientGUIClick",buy, function () local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local id = guiGridListGetItemData(grid,sel,1) local money = guiGridListGetItemText (grid,sel,2) triggerServerEvent("givecar",localPlayer,id,money) end end ,false) -- Server gv = {} addEvent("givecar",true) addEventHandler("givecar",root, function (id,money) if isElement (gv[source]) then destroyElement(gv[source]) end local hisMoney = getPlayerMoney (source) if hisMoney >= tonumber (money) then takePlayerMoney (source,tonumber(money)) local x, y, z = getElementPosition(source) gv[source] = createVehicle (id, x, y, z) warpPedIntoVehicle(source,gv[source]) end end ) Link to comment
Mostafa MohammeD Posted April 14, 2016 Author Share Posted April 14, 2016 -- Client GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateWindow((screenW - 563) / 2, (screenH - 622) / 2, 563, 622, "لوحة استئجار السيارات", false) guiWindowSetMovable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "C80AB9D3") guiSetVisible(wnd,false) grid = guiCreateGridList(9, 21, 263, 591, false, wnd) guiGridListAddColumn(grid, "the car", 0.5) guiGridListAddColumn(grid, "the price", 0.5) photo = guiCreateStaticImage(275, 27, 278, 179, "11.png", false, wnd) buy = guiCreateButton(278, 225, 275, 51, "استئجار السيارة", false, wnd) guiSetFont(buy, "default-bold-small") guiSetProperty(buy, "NormalTextColour", "C80AB9D3") light = guiCreateButton(278, 330, 275, 51, "تشغيل - اطفاء ضوء السيارة", false, wnd) guiSetFont(light, "default-bold-small") guiSetProperty(light, "NormalTextColour", "C80AB9D3") lock = guiCreateButton(278, 430, 275, 51, "قفل - فتح السيارة", false, wnd) guiSetFont(lock, "default-bold-small") guiSetProperty(lock, "NormalTextColour", "C80AB9D3") close = guiCreateButton(488, 557, 65, 55, "✖", false, wnd) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "C81DB8C1") GUIEditor.label[1] = guiCreateLabel(288, 576, 179, 15, "this mod made by :- 1XxCr[o]sS", false, wnd) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 29, 184, 193) bindKey("F9","down", function () guiSetVisible (wnd ,not guiGetVisible (wnd)) showCursor(guiGetVisible(wnd)) end ) addEventHandler("onClientGUIClick",root, function () if source == close then guiSetVisible(wnd,false) showCursor(false) end end ) -- name . id . price cars ={ {"Ferari",429,50000}, {"Nissan",411,50000}, } for k,v in ipairs(cars) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid,row,1,v[1],false,false) guiGridListSetItemText(grid,row,2,v[3],false,false) guiGridListSetItemData(grid,row,1,v[2]) end addEventHandler("onClientGUIClick",buy, function () local sel = guiGridListGetSelectedItem(grid) if sel ~= -1 then local id = guiGridListGetItemData(grid,sel,1) local money = guiGridListGetItemText (grid,sel,2) triggerServerEvent("givecar",localPlayer,id,money) end end ,false) -- Server gv = {} addEvent("givecar",true) addEventHandler("givecar",root, function (id,money) if isElement (gv[source]) then destroyElement(gv[source]) end local hisMoney = getPlayerMoney (source) if hisMoney >= tonumber (money) then takePlayerMoney (source,tonumber(money)) local x, y, z = getElementPosition(source) gv[source] = createVehicle (id, x, y, z) warpPedIntoVehicle(source,gv[source]) end end ) مشكور الكود شغال ما قصرت بس ممكن تقلي وش كان الخطاء بكودي 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