Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Resource: Pudding
- Developers: Yolos
- You have no right to use this code without my permission.
- ]]
- mojeW,mojeH = 1280, 1024
- sW,sH = guiGetScreenSize()
- width, height = (sW/mojeW), (sH/mojeH)
- GUIEditor = {
- gridlist = {},
- progressbar = {},
- button = {},
- window = {}
- }
- function przecinek(liczba)
- local format = liczba
- while true do
- format, k = string.gsub(format, "^(-?%d+)(%d%d%d)", '%1,%2')
- if ( k==0 ) then
- break
- end
- end
- return format
- end
- local cenaCzesci={
- [1025]=5000,
- [1073]=2000,
- [1074]=8000,
- [1075]=2000,
- [1076]=2200,
- [1077]=1000,
- [1078]=5000,
- [1079]=2200,
- [1080]=3600,
- [1081]=2000,
- [1082]=5000,
- [1083]=6700,
- [1084]=1000,
- [1085]=3000,
- [1096]=3000,
- [1097]=7000,
- [1098]=3000,
- -- Stereo
- [1086]=1200,
- -- Spoilery
- [1000]=4000,
- [1001]=4400,
- [1002]=6300,
- [1003]=5000,
- [1014]=5600,
- [1015]=4000,
- [1016]=3700,
- [1023]=8700,
- [1049]=4200,
- [1050]=4700,
- [1058]=6200,
- [1060]=6000,
- [1138]=2500,
- [1139]=2500,
- [1146]=2500,
- [1147]=2500,
- [1158]=3100,
- [1162]=3250,
- [1163]=3700,
- [1164]=1500,
- -- Progi
- [1036]=5500,
- [1039]=1200,
- [1040]=1180,
- [1041]=1230,
- [1007]=5000,
- [1017]=5000,
- [1026]=3300,
- [1027]=4000,
- [1030]=1150,
- [1031]=1230,
- [1042]=3000,
- [1047]=4890,
- [1048]=4730,
- [1051]=1200,
- [1052]=1180,
- [1056]=4000,
- [1057]=1000,
- [1062]=3000,
- [1063]=2250,
- [1069]=4800,
- [1070]=4500,
- [1071]=2650,
- [1072]=4750,
- [1090]=5750,
- [1093]=5700,
- [1094]=4500,
- [1095]=4000,
- [1099]=3000,
- [1101]=3000,
- [1102]=2700,
- [1106]=3000,
- [1107]=4000,
- [1108]=4000,
- [1118]=4700,
- [1119]=4700,
- [1120]=4700,
- [1121]=4700,
- [1122]=5700,
- [1124]=5700,
- [1133]=4000,
- [1134]=3000,
- [1137]=3000,
- -- Bullbar . . ? [przod]
- [1100]=6750,
- [1115]=6750,
- [1116]=6750,
- [1123]=6750,
- [1125]=6000,
- -- Bullbar . . ? [tył]
- [1109]=4900,
- [1110]=4200,
- -- Front Sign [figurka itd z przodu]
- [1111]=4650,
- [1112]=4650,
- -- Hydraulika
- [1087]=10000,
- -- Wydechy
- [1034]=1190,
- [1037]=1200,
- [1044]=1180,
- [1046]=1200,
- [1018]=1170,
- [1019]=1190,
- [1020]=2000,
- [1021]=1800,
- [1022]=1800,
- [1028]=1900,
- [1029]=2000,
- [1043]=1500,
- [1044]=1000,
- [1045]=1500,
- [1059]=1500,
- [1064]=1200,
- [1065]=1300,
- [1066]=1500,
- [1089]=2000,
- [1092]=1750,
- [1104]=1650,
- [1105]=1450,
- [1113]=1200,
- [1114]=1750,
- [1126]=1000,
- [1127]=1100,
- [1129]=1000,
- [1132]=1500,
- [1135]=1000,
- [1136]=1500,
- -- Zderzaki [tylni]
- [1149]=2400,
- [1148]=2500,
- [1150]=2300,
- [1151]=2350,
- [1154]=2300,
- [1156]=2300,
- [1159]=2350,
- [1161]=2360,
- [1167]=2300,
- [1168]=2250,
- [1175]=2250,
- [1177]=2250,
- [1178]=2290,
- [1180]=2310,
- [1183]=2270,
- [1184]=2300,
- [1186]=2300,
- [1187]=2260,
- [1192]=2200,
- [1193]=2200,
- -- Zderzaki [pzrzód]
- [1171]=2350,
- [1172]=2500,
- [1140]=2350,
- [1141]=2500,
- [1117]=2500,
- [1152]=2300,
- [1153]=2350,
- [1155]=2300,
- [1153]=2300,
- [1157]=2300,
- [1160]=2400,
- [1165]=2400,
- [1166]=2300,
- [1169]=2300,
- [1170]=2350,
- [1173]=2350,
- [1174]=2250,
- [1176]=2250,
- [1179]=2350,
- [1181]=2250,
- [1182]=2230,
- [1185]=2300,
- [1188]=2320,
- [1189]=2290,
- [1190]=2250,
- [1191]=2210,
- -- Wloty [góra]
- [1035]=2300,
- [1038]=2350,
- [1006]=2196,
- [1032]=2300,
- [1033]=2350,
- [1053]=2350,
- [1054]=2300,
- [1055]=2200,
- [1061]=2200,
- [1068]=2325,
- [1067]=2275,
- [1088]=2230,
- [1091]=2300,
- [1103]=2150,
- [1128]=3500, -- DACH DO BLADE
- [1130]=3500, -- DACH DO SAVANNA
- [1131]=3500, -- DACH DO SAVANNA
- -- Wloty [przód]
- [1004]=2140,
- [1005]=2160,
- [1011]=2140,
- [1012]=2160,
- [1142]=2120,
- [1143]=2120,
- [1144]=2100,
- [1145]=2100,
- -- Dodatkowe lampy
- [1013]=4100,
- [1024]=4800,
- }
- local nazwaCzesci={
- [1025]="Offroad",
- [1073]="Shadow",
- [1074]="Mega",
- [1075]="Rimshine",
- [1076]="Wires",
- [1077]="Classic",
- [1078]="Twist",
- [1079]="Cutter",
- [1080]="Switch",
- [1081]="Grove",
- [1082]="Import",
- [1083]="Dolar",
- [1084]="Trance",
- [1085]="Atomic",
- [1096]="Ahab",
- [1097]="Virtual",
- [1098]="Access",
- -- Stereo
- [1086]="Stereo",
- -- Spoilery
- [1000]="Pro",
- [1001]="Win",
- [1002]="Drag",
- [1003]="Alpha",
- [1014]="Champ",
- [1015]="Race",
- [1016]="Worix",
- [1023]="Furry",
- [1049]="Alien",
- [1050]="X-Flow",
- [1058]="Alien",
- [1060]="X-Flow",
- [1138]="Alien Wentyl",
- [1139]="X-Flow Prog",
- [1146]="Alien wydech",
- [1147]="Alien Prog",
- [1158]="X-Flow",
- [1162]="Alien",
- [1163]="X-Flow",
- [1164]="Alien",
- -- Progi
- [1036]="Alien",
- [1039]="X-Flow",
- [1040]="Alien",
- [1041]="X-Flow",
- [1007]="Czysty",
- [1017]="Czysty",
- [1026]="Alien",
- [1027]="Alien",
- [1030]="X-Flow",
- [1031]="X-Flow",
- [1042]="Chrome",
- [1047]="Alien",
- [1048]="X-Flow",
- [1051]="Alien",
- [1052]="X-Flow",
- [1056]="Alien",
- [1057]="X-Flow",
- [1062]="Alien",
- [1063]="X-Flow",
- [1069]="Alien",
- [1070]="X-Flow",
- [1071]="Alien",
- [1072]="X-Flow",
- [1090]="Alien",
- [1093]="X-Flow",
- [1094]="Alien",
- [1095]="X-Flow",
- [1099]="Chrome",
- [1101]="Chrome Flames",
- [1102]="Chrome Strip",
- [1106]="Chrome Arches",
- [1107]="Chrome Strip",
- [1108]="Chrome Strip",
- [1118]="Chrome Trim",
- [1119]="Wheel Covers",
- [1120]="Chrome Trim",
- [1121]="Wheelcovers",
- [1122]="Chrome Flames",
- [1124]="Chrome Arches",
- [1133]="Chrome Strip",
- [1134]="Chrome Strip",
- [1137]="Chrome Strip",
- -- Bullbar . . ? [przod]
- [1100]="Chrome Grill",
- [1115]="Chrome",
- [1116]="Slamin",
- [1123]="Chrome",
- [1125]="Chrome Lights",
- -- Bullbar . . ? [tył]
- [1109]="Chrome",
- [1110]="Slamin",
- -- Front Sign [figurka itd z przodu]
- [1111]="Figurka",
- [1112]="Figurka",
- -- Hydraulika
- [1087]="Hydraulika",
- -- Wydechy
- [1034]="Alien",
- [1037]="X-Flow",
- [1044]="Chrome",
- [1046]="Alien",
- [1018]="Upswept",
- [1019]="Twin",
- [1020]="Large",
- [1021]="Medium",
- [1022]="Small",
- [1028]="Alien",
- [1029]="X-Flow",
- [1043]="Slamin",
- [1044]="Chrome",
- [1045]="X-Flow",
- [1059]="X-Flow",
- [1064]="Alien",
- [1065]="Alien",
- [1066]="X-Flow",
- [1089]="X-Flow",
- [1092]="Alien",
- [1104]="Chrome",
- [1105]="Slamin",
- [1113]="Chrome",
- [1114]="Slamin",
- [1126]="Chrome",
- [1127]="Slamin",
- [1129]="Chrome",
- [1132]="Slamin",
- [1135]="Slamin",
- [1136]="Chrome",
- -- Zderzaki [tylni]
- [1149]="Alien",
- [1148]="X-Flow",
- [1150]="Alien",
- [1151]="X-Flow",
- [1154]="Alien",
- [1156]="X-Flow",
- [1159]="Alien",
- [1161]="X-Flow",
- [1167]="X-Flow",
- [1168]="Alien",
- [1175]="Slamin",
- [1177]="Slamin",
- [1178]="Slamin",
- [1180]="Chrome",
- [1183]="Slamin",
- [1184]="Chrome",
- [1186]="Slamin",
- [1187]="Chrome",
- [1192]="Chrome",
- [1193]="Slamin",
- -- Zderzaki [pzrzód]
- [1171]="Alien",
- [1172]="X-Flow",
- [1140]="X-Flow",
- [1141]="Alien",
- [1117]="Chrome",
- [1152]="X-Flow",
- [1153]="Alien",
- [1155]="Alien",
- [1157]="X-Flow",
- [1160]="Alien",
- -- Wloty [góra]
- [1128]="Dach", -- DACH DO BLADE
- [1130]="Dach", -- DACH DO SAVANNA
- [1131]="Dach", -- DACH DO SAVANNA
- -- Wloty [przód]
- -- Dodatkowe lampy
- [1013]="Lampa",
- [1024]="Lampa",
- }
- local wykluczoneCzesci={
- }
- local idSlotow={
- ["Hood"]=0,
- ["Vent"]=1,
- ["Spoiler"]=2,
- ["Sideskirt"]=3,
- ["Front Bullbars"]=4,
- ["Rear Bullbars"]=5,
- ["Headlights"]=6,
- ["Roof"]=7,
- ["Nitro"]=8,
- ["Hydraulics"]=9,
- ["Stereo"]=10,
- ["Unknown"]=11,
- ["Wheels"]=12,
- ["Exhaust"]=13,
- ["Front Bumper"]=14,
- ["Rear Bumper"]=15,
- ["Misc"]=16,
- }
- addEvent("pokazPanelTuningu", true)
- addEventHandler("pokazPanelTuningu", localPlayer, function(veh)
- if not isElement(GUIEditor.window[1]) then
- if getElementData(veh, "vehicle:spawn") then
- setElementFrozen(veh, false)
- showCursor(true)
- veh1 = veh
- setElementData(localPlayer, "tune:car", veh)
- local screenW, screenH = guiGetScreenSize()
- GUIEditor.window[1] = guiCreateWindow((screenW - 888) / 2, (screenH - 546) / 2, 888*width, 546*height, "---=== Tuningowanie pojazdu ===---", false)
- guiWindowSetSizable(GUIEditor.window[1], false)
- GUIEditor.button[1] = guiCreateButton(445*width, 484*height, 233*width, 52*height, "TUNINGUJ\nDEMONTUJ", false, GUIEditor.window[1])
- guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
- GUIEditor.button[2] = guiCreateButton(212*width, 484*height, 233*width, 52*height, "ZAMKNIJ OKNO", false, GUIEditor.window[1])
- guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
- GUIEditor.gridlist[1] = guiCreateGridList(31*width, 41*height, 827*width, 390*height, false, GUIEditor.window[1])
- guiGridListAddColumn(GUIEditor.gridlist[1], "ID CZESCI", 0.15)
- guiGridListAddColumn(GUIEditor.gridlist[1], "TYP", 0.15)
- guiGridListAddColumn(GUIEditor.gridlist[1], "AKCJA", 0.15)
- guiGridListAddColumn(GUIEditor.gridlist[1], "KOSZT CZESCI", 0.15)
- guiGridListAddColumn(GUIEditor.gridlist[1], "NAZWA Czesci", 0.15)
- -- a=0
- for i=0,16 do
- if getVehicleUpgradeOnSlot(veh, i) ~= 0 then
- local a = guiGridListAddRow(GUIEditor.gridlist[1])
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(getVehicleUpgradeOnSlot(veh, i)), false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(getVehicleUpgradeOnSlot(veh, i))), false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "demtuning", false, false)
- if cenaCzesci[getVehicleUpgradeOnSlot(veh,i)] then
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(tonumber(cenaCzesci[getVehicleUpgradeOnSlot(veh,i)]*9/10)) , false, false)
- else
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, "--" , false, false)
- end
- if nazwaCzesci[getVehicleUpgradeOnSlot(veh,i)] then
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[getVehicleUpgradeOnSlot(veh,i)]), false, false)
- else
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
- end
- -- a=a+1
- else
- for i2,v2 in ipairs(getVehicleCompatibleUpgrades(veh, i)) do
- if cenaCzesci[v2] then
- if not wykluczoneCzesci[v2] then
- if v2 == 1164 then
- if getElementModel(veh) == 558 then
- local a=guiGridListAddRow(GUIEditor.gridlist[1])
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(v2), false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(v2)), false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "tuning", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(przecinek(cenaCzesci[v2])), false, false)
- if nazwaCzesci[v2] then
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[v2]), false, false)
- else
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
- end
- end
- else
- local a=guiGridListAddRow(GUIEditor.gridlist[1])
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(v2), false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(v2)), false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "tuning", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(przecinek(cenaCzesci[v2])), false, false)
- if nazwaCzesci[v2] then
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[v2]), false, false)
- else
- guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
- end
- -- a=a+1
- end
- end
- end
- end
- end
- end
- GUIEditor.progressbar[1] = guiCreateProgressBar(129*width, 436*height, 631*width, 38*height, false, GUIEditor.window[1])
- guiProgressBarSetProgress(GUIEditor.progressbar[1], 0)
- end
- else
- setElementData(localPlayer, "tune:car",nil)
- end
- end)
- addEvent("ukryjPanelTuningu",true)
- addEventHandler("ukryjPanelTuningu", localPlayer, function()
- if GUIEditor.window[1] and isElement(GUIEditor.window[1]) then
- destroyElement(GUIEditor.window[1])
- setElementData(localPlayer, "tune:car",nil)
- showCursor(false)
- end
- end)
- time=5000
- function onClientGUIClick()
- if GUIEditor.button[2] and isElement(GUIEditor.button[2]) and source == GUIEditor.button[2] then
- if GUIEditor.window[1] and isElement(GUIEditor.window[1]) then
- destroyElement(GUIEditor.window[1])
- showCursor(false)
- end
- elseif GUIEditor.button[1] and isElement(GUIEditor.button[1]) and source == GUIEditor.button[1] then
- if GUIEditor.progressbar[1] and isElement(GUIEditor.progressbar[1]) and GUIEditor.gridlist[1] and isElement(GUIEditor.gridlist[1]) then
- if guiProgressBarGetProgress(GUIEditor.progressbar[1]) == 0 or guiProgressBarGetProgress(GUIEditor.progressbar[1]) == 100 then
- b=0
- local x,y = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
- if y == 1 then
- removeEventHandler("onClientGUIClick",resourceRoot, onClientGUIClick)
- setTimer(function()
- b=b+1
- if GUIEditor.progressbar[1] and isElement(GUIEditor.progressbar[1]) then
- guiProgressBarSetProgress(GUIEditor.progressbar[1], b)
- end
- end,time/100,100)
- setTimer(function()
- addEventHandler("onClientGUIClick",resourceRoot, onClientGUIClick)
- local text1 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 1) -- ID
- local text2 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 2) -- TYP
- local text3 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 3) -- AKCJA
- local text4 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 4) -- CENA
- local text5 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 5) -- nazwa
- if text1 and tonumber(text1) and text4 and tonumber(text4) and text3 and tostring(text3) then
- -- if not wykluczoneCzesci[tonumber(text1)] then
- if cenaCzesci[tonumber(text1)] then
- if veh1 and isElement(veh1) and getElementType(veh1) == "vehicle" then
- triggerServerEvent("montazElementu", root, veh1, text3, text1, text4, text5)
- end
- end
- end
- -- end
- end,time*1.14,1)
- end
- end
- end
- end
- end
- addEventHandler("onClientGUIClick",resourceRoot, onClientGUIClick)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement