Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-12-30, 21:31


Matu123







Wiek: 23
Na forum: 2495 dni
Posty: 24
Nick w MP: Matu998

Piwa: 1

Respekt: 50

(Wstawiam na pro?b? znajomego poniewa? niestety nie mo?e tworzy? temat?w)

Witam, mam problem z skryptem salonu, wszystko pieknie dzia?a tylko jak podchodze i klikam kup nic sie nie dzieje, okienko znika a pojazdu jak nie by?o tak nie ma

[ Dodano: 2020-12-30, 21:32 ]
[code]
Kod:

local vehiclesForSell = {
[1] = { -- EKSKLUZYWNE POJAZDY podmianki
modele = {541,470,445},
ceny = {
[541] = math.random(67400,75000), -- Bullet
[470] = math.random(389600,399000), -- Patriot
[445] = math.random(589600,599000), -- Pancerniak Admiral
},
rodzaje = {"Benzyna", "Diesel"},
dimension = 0,
przebieg = math.random(180000,270000),
pojemnosci = {"1.2","1.4","1.6"},
auta = {
{pos={-950.01, -537.45, 26.1, 0.00, 314.89}},
},
respawn = {-778.66839599609, 1626.8509521484, 27.124444961548,0,0,180}
},
[2] = { -- Salon SF najtansze auta
modele = {426,587,602,565,495,477,400,475,496,554,402,439,567,533,561,405,507,419,589,603},
ceny = {
[426] = math.random(54300,57800), -- premier
[587] = math.random(38740,42000), -- euros
[602] = math.random(29800,33550), -- alpha
[565] = math.random(73500,74800), -- uranus
[495] = math.random(79850,82100), -- sandking
[477] = math.random(85000,86500), -- zr-350
[400] = math.random(28400,29950), -- landstalker
[475] = math.random(29700,32200), -- sabre
[496] = math.random(33400,35000), -- blista comact
[554] = math.random(47650,49000), -- Yosemite
[402] = math.random(82150,85000), -- buffalo
[439] = math.random(46435,48000), -- stallion
[567] = math.random(53500,56000), -- savanna
[533] = math.random(43250,45000), -- feltzer
[561] = math.random(29865,30370), -- stratum
[405] = math.random(34650,37000), -- sentinel
[507] = math.random(44750,48000), -- elegant
[419] = math.random(23500,25000), -- esperanto
[589] = math.random(33450,36000), -- club
[603] = math.random(82300,84500), -- phoenix
},
rodzaje = {"Benzyna", "Diesel"},
przebieg = 0,
dimension = 0,
pojemnosci = {"1.2","1.4","1.6"},
auta = {
{pos={-1948.47, 258.80, 35.34, -0.00, 42.65}},
},
respawn = {-1948.47, 258.80, 35.04, -0.00, 42.65}
},
[3] = { -- Salon SF **** UNIKATY
modele = {424,474,535,434,580,576,412},
ceny = {
[424] = math.random(165400,180000), -- bj injection
[474] = math.random(534500,545000), -- hermes
[535] = math.random(342500,356750), -- slamvan
[434] = math.random(424500,435000), -- hotknife
[580] = math.random(575500,580000), -- stafford
[576] = math.random(199700,201650), -- tornado
[412] = math.random(234009,240000), -- voodoo
},
rodzaje = {"Benzyna", "Diesel"},
przebieg = 0,
dimension = 0,
pojemnosci = {"1.6"},
auta = {
{pos={-1663.22, 1214.13,7.15, -0.01, 250.77}},
},
respawn = {-1948.47, 258.80, 35.04, -0.00, 42.65}
},
[4] = { -- Salon SPORTOWY
modele = {506,562,480,415,429,451,559,558},
ceny = {
[506] = math.random(98900,100000), -- Super GT
[562] = math.random(164500,167600), -- Elegy
[480] = math.random(198650,203120), -- Comet
[415] = math.random(286530,293540), -- Cheetah
[429] = math.random(459980,567000), -- Banshee
[451] = math.random(543800,660000), -- Turismo
[559] = math.random(96400,99000), -- Jester
[558] = math.random(543800,660000), -- uranus
},
rodzaje = {"Benzyna", "Diesel"},
przebieg = 0,
dimension = 0,
pojemnosci = {"1.6","1.8"},
auta = {
{pos={-1664.79, 1225.57, 13.67, 0.07, 200.45}},
},
respawn = {-1948.47, 258.80, 35.04, -0.00, 42.65}
},
[5] = { -- Salon MOTOROW
modele = {581,461,521,462,463,468,471},
ceny = {
[581] = math.random(75450,76430), -- BF-400
[461] = math.random(62300,64000), -- PCJ-600
[521] = math.random(112500,115500), -- FCR-900
[462] = math.random(9800,10350), -- Faggio
[463] = math.random(56670,58000), -- Freeway
[468] = math.random(70200,72000), -- Sanchez
[471] = math.random(17880,18350), -- Quad
},
rodzaje = {"Benzyna"},
przebieg = 0,
dimension = 0,
pojemnosci = {"1.6"},
auta = {
{pos={255.15, -310.86, 1.58, -0.00, 0.00, 48.45}},
},
respawn = {-1948.47, 258.80, 35.04, -0.00, 42.65}
},
[6] = { -- cygan
modele = {418,404,410,478,543,491,529,547,401,436,516,540,458,566,585,527,549,534,400,551,526,467,600,517},
ceny = {
[418] = math.random(1000,1350), -- moonbeam
[404] = math.random(1300,1700), -- perennial
[410] = math.random(1450,1900), -- manana
[478] = math.random(2100,2630), -- walton
[543] = math.random(2900,3280), -- sadler
[491] = math.random(3350,3600), -- virgo
[529] = math.random(3600,4000), -- willard
[547] = math.random(3650,4300), -- primo
[401] = math.random(3780,4120), -- bravura
[436] = math.random(4150,4400), -- previon
[516] = math.random(4400,4700), -- nebula
[540] = math.random(4870,5200), -- vincent
[458] = math.random(5120,5400), -- solair
[566] = math.random(5890,6150), -- tahoma
[585] = math.random(6240,6700), -- emperor
[527] = math.random(7150,7500), -- cadrona
[549] = math.random(8750,9330), -- tampa
[534] = math.random(12400,12850), -- remington
[400] = math.random(19800,22300), -- landstalker
[551] = math.random(9980,10800), -- merit
[526] = math.random(10300,10900), -- fortune
[467] = math.random(15700,16350), -- oceanic
[600] = math.random(8750,9000), -- picador
[517] = math.random(12350,13000), -- majestic
},
rodzaje = {"Benzyna", "Diesel"},
dimension = 0,
przebieg = math.random(180000,270000),
pojemnosci = {"1.2","1.4","1.6"},
auta = {
{pos={-907.77, -510.05, 25.96,0.00, 84}},
{pos={-908.54, -515.55, 26.03, 0.00, 84}},
{pos={-909.02, -520.70, 26.03, 0.00, 84}},
{pos={-916.36, -543.47, 25.95, 0.00, 20}},
{pos={-909.02, -520.70, 26.03, 0.00, 84}},
{pos={-909.02, -520.70, 26.03, 0.00, 84}},
{pos={-909.02, -520.70, 26.03, 0.00, 84}},
{pos={-909.02, -520.70, 26.03, 0.00, 84}},
-916.36, -543.47, 25.95
},
respawn = {-778.66839599609, 1626.8509521484, 27.124444961548,0,0,180}
},
[7] = { -- Salon ELECTRIC
modele = {411,555,426,533},
ceny = {
[411] = math.random(880000,920000), -- Infernus
[555] = math.random(132500,138000), -- Windsor
[426] = math.random(84210,88399), -- Premier
[533] = math.random(89300,92130), -- Feltzer
},
rodzaje = {"Elektryk"},
przebieg = 0,
dimension = 219,
pojemnosci = {"1.6"},
auta = {
{pos={-2289.57, 2317.06, 4.54, 0.00, 227.63}},
},
respawn = {-2287.97, 2317.06, 4.34, 0.00, 227.63}
},

}

local cuboids = {}
local markers = {}
local strzalkas = {}

function createVehicleFromSlot(i,x)
local k = vehiclesForSell[i]
if not k then return end
if x then
v = vehiclesForSell[i]["auta"][x]
local model = math.random(1,#vehiclesForSell[i]["modele"])
local rodzaj = math.random(1,#vehiclesForSell[i]["rodzaje"])
local pojemnosc = math.random(1,#vehiclesForSell[i]["pojemnosci"])
local dimension = vehiclesForSell[i]["dimension"]
local przebieg = vehiclesForSell[i]["przebieg"]
model = vehiclesForSell[i]["modele"][model]
local cena = vehiclesForSell[i]["ceny"][model]
rodzaj = vehiclesForSell[i]["rodzaje"][rodzaj]
pojemnosc = vehiclesForSell[i]["pojemnosci"][pojemnosc]
if pojemnosc == "1.2" then
cena = vehiclesForSell[i]["ceny"][model]*0.6
elseif pojemnosc == "1.4" then
cena = vehiclesForSell[i]["ceny"][model]*0.8
elseif pojemnosc == "1.6" then
cena = vehiclesForSell[i]["ceny"][model]
elseif pojemnosc == "1.8" then
cena = vehiclesForSell[i]["ceny"][model]*1.4
end
local xx,y,z,rx,rz = unpack(v.pos)
local veh = createVehicle(model, xx, y, z, rx, 0, rz)
cuboids[x] = createColSphere(xx, y, z, 3)
markers[x] = createMarker(xx, y, z-0.3, "cylinder", 1, 255, 75, 0, 0)
strzalkas[x] = createMarker(xx, y, z-3.3, "arrow", 0, 0, 0, 0, 0)
setElementDimension(strzalkas[x],dimension)
setElementDimension(markers[x],dimension)
setElementDimension(cuboids[x],dimension)
setElementData(markers[x], "selling", true)
setElementData(cuboids[x], "data", v)
setElementData(cuboids[x], "model", model)
setElementData(cuboids[x], "respawn", vehiclesForSell[i]["respawn"])
setElementData(cuboids[x], "vehicle", veh)
setElementData(cuboids[x], "slot", i)
setElementData(cuboids[x], "slotix", x)
setElementData(cuboids[x], "marker", markers[x])
setElementData(cuboids[x], "strzalka", strzalkas[x])
setElementData(cuboids[x], "cena", cena)
setElementData(cuboids[x], "przebieg", przebieg)
setElementData(cuboids[x], "rodzaj", rodzaj)
setElementData(cuboids[x], "pojemnosc", pojemnosc)
setElementFrozen(veh, true)
if rodzaj == "Elektryk" then
setElementData(veh,"vehicle:rodzaj","Elektryk")
end
setElementDimension(veh,dimension)
local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255)
setVehicleColor(veh, r, g, b, r, g, b)
setElementData(cuboids[x], "color", {r,g,b})
if getElementData(cuboids[_],"rodzaj") == "Elektryk" then
desc2 = "Nazwa Pojazdu: "..getVehicleNameFromModel(model).." Electric\nPrzebieg: "..przebieg.."km\nPojemno?›?‡: "..pojemnosc.. "cmÂł\n\nCena: "..cena.." PLN"
else
desc2 = "Nazwa Pojazdu: "..getVehicleNameFromModel(model).."\nPrzebieg: "..przebieg.."km\nPojemno?›?‡: "..pojemnosc.. "cmÂł\nRodzaj paliwa: "..rodzaj.."\n\nCena: "..cena.." PLN"
end
setElementData(veh, "veh:salon", true)
setElementData(veh, "veh:salon:desc", desc2)
setElementData(veh,"dimenszon",dimension)
setVehicleDamageProof(veh,true)
else
for _,v in ipairs(k.auta) do
local model = math.random(1,#vehiclesForSell[i]["modele"])
local rodzaj = math.random(1,#vehiclesForSell[i]["rodzaje"])
local dimension = vehiclesForSell[i]["dimension"]
local pojemnosc = math.random(1,#vehiclesForSell[i]["pojemnosci"])
pojemnosc = vehiclesForSell[i]["pojemnosci"][pojemnosc]
model = vehiclesForSell[i]["modele"][model]
if pojemnosc == "1.2" then
cena = vehiclesForSell[i]["ceny"][model]*0.6
elseif pojemnosc == "1.4" then
cena = vehiclesForSell[i]["ceny"][model]*0.8
elseif pojemnosc == "1.6" then
cena = vehiclesForSell[i]["ceny"][model]
elseif pojemnosc == "1.8" then
cena = vehiclesForSell[i]["ceny"][model]*1.4
end
local przebieg = vehiclesForSell[i]["przebieg"]
rodzaj = vehiclesForSell[i]["rodzaje"][rodzaj]
local x,y,z,rx,rz = unpack(v.pos)
local veh = createVehicle(model, x, y, z, rx, 0, rz)
cuboids[_] = createColSphere(x, y, z, 3)
markers[_] = createMarker(x, y, z-0.3, "cylinder", 1, 255, 75, 0, 0)
strzalkas[_] = createMarker(x, y, z-3.3, "arrow", 0, 0, 200, 0, 0)
setElementDimension(strzalkas[_],dimension)
setElementDimension(markers[_],dimension)
setElementDimension(cuboids[_],dimension)
setElementData(markers[_], "selling", true)
setElementData(cuboids[_], "data", v)
setElementData(cuboids[_], "model", model)
setElementData(cuboids[_], "respawn", vehiclesForSell[i]["respawn"])
setElementData(cuboids[_], "vehicle", veh)
setElementData(cuboids[_], "slot", i)
setElementData(cuboids[_], "pojemnosc", pojemnosc)
setElementData(cuboids[_], "cena", cena)
setElementData(cuboids[_], "marker", markers[_])
setElementData(cuboids[_], "strzalka", strzalkas[_])
setElementData(cuboids[_], "slotix", _)
setElementData(cuboids[_], "przebieg", przebieg)
setElementData(cuboids[_], "rodzaj", rodzaj)
setElementFrozen(veh, true)
if rodzaj == "Elektryk" then
setElementData(veh,"vehicle:rodzaj","Elektryk")
end
setElementDimension(veh,dimension)
local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255)
setVehicleColor(veh, r, g, b, r, g, b)
setElementData(cuboids[_], "color", {r,g,b})
if getElementData(cuboids[_],"rodzaj") == "Elektryk" then
desc1 = "Nazwa Pojazdu: "..getVehicleNameFromModel(model).." Electric\nPrzebieg: "..przebieg.."km\nPojemno?›?‡: "..pojemnosc.. "cmÂł\n\nCena: "..cena.." PLN"
else
desc1 = "Nazwa Pojazdu: "..getVehicleNameFromModel(model).."\nPrzebieg: "..przebieg.."km\nPojemno?›?‡: "..pojemnosc.. "cmÂł\nRodzaj paliwa: "..rodzaj.."\n\nCena: "..cena.." PLN"
end
setElementData(veh, "veh:salon", true)
setElementData(veh, "veh:salon:desc", desc1)
setElementData(veh,"dimenszon",dimension)
setVehicleDamageProof(veh,true)
end
end
end

for i = 1,#vehiclesForSell do
createVehicleFromSlot(i)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-30, 21:48


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
auta = {
{pos={-907.77, -510.0525.96,0.0084}},
{pos={-908.54, -515.5526.030.0084}},
{pos={-909.02, -520.7026.030.0084}},
{pos={-916.36, -543.4725.950.0020}},
{pos={-909.02, -520.7026.030.0084}},
{pos={-909.02, -520.7026.030.0084}},
{pos={-909.02, -520.7026.030.0084}},
{pos={-909.02, -520.7026.030.0084}},
-916.36, -543.4725.95
},

tutaj jest jeden b??d

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Matu123
Wysłany: 2020-12-30, 22:07


Matu123







Wiek: 23
Na forum: 2495 dni
Posty: 24
Nick w MP: Matu998

Piwa: 1

Respekt: 50

skrypt po zmienieniu
Wyst?puje taki b??d



Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-30, 22:37


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Formatowanie kodu ustaw na UTF-8. Poka? t? linijk? z b??du z klienta.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Matu123
Wysłany: 2020-12-30, 22:43


skakacz







Wiek: 27
Na forum: 2315 dni
Posty: 19
Nick w MP: skakacz

Piwa: 1

Respekt: 50




a tu linijka

Kod:

addEventHandler( "onClientPedDamage", ped, anulujOtrzymywaneObrazenia )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-31, 11:18


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

skakacz, je?eli nie mo?esz zmieni? formatowania to wystarczy wszystko skopiowa? Ctrl + A, Zaznacz wszystko Ctrl + C, Kopiuj wpisz losow? liter?/cyfr? np 1 zapisz nast?pnie zmieni? kodowanie na UTF-8 Ctrl + V, Wklej i zapisz. Problem z kodowaniem rozwi?zany.

A co do b??dy masz b??d w drugi argumenie tej linijki?


addEventHandler"onClientPedDamage"pedanulujOtrzymywaneObrazenia )


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Matu123
Wysłany: 2020-12-31, 21:23


skakacz







Wiek: 27
Na forum: 2315 dni
Posty: 19
Nick w MP: skakacz

Piwa: 1

Respekt: 50

"TheSebaPL" napisał/a:

skakacz, je?eli nie mo?esz zmieni? formatowania to wystarczy wszystko skopiowa? Ctrl + A, Zaznacz wszystko Ctrl + C, Kopiuj wpisz losow? liter?/cyfr? np 1 zapisz nast?pnie zmieni? kodowanie na UTF-8 Ctrl + V, Wklej i zapisz. Problem z kodowaniem rozwi?zany.


Ustawilem formatowanie na UTF-8, dalej b?ad



A to ta linijka z b??du


addEventHandler"onClientPedDamage"pedanulujOtrzymywaneObrazenia )


Postaw piwo autorowi tego posta
 

 
Tagi: salony
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku