Wysłany: 2019-01-16, 19:38
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam pomo?e mi kto? z skryptem na salony? I? chcia?bym by pojazdy w salonach by?y na sztuki. Lub jak gracz kupi pojazd to go usuwa, i dopiero gdy ja zrestartuj? skrypt, to si? pojawia. Za pomoc daje zimne
--[[
Resource : Our - Game
Filename : [ our ] vehbuy / s_vehbuy . lua
Developers : Split < split . programista @ gmail . com >
Copyright < split . programista @ gmail . com > 2015
Nie masz prawa u ? ywa ? tego kodu bez mojej zgody .
]]
local positionVehicles = {
{ 'Flash' , 565 , math . random ( 500 , 1000 ), math . random ( 65000 , 70000 ), - 1956.11 , 257.54 , 40.67 , 359.6 , 0.0 , 276.2 },
{ 'Buffalo' , 402 , math . random ( 500 , 1000 ), math . random ( 75000 , 80000 ), - 1955.11 , 305.02 , 40.88 , 360.0 , 360.0 , 95.1 },
{ 'Sultan' , 560 , math . random ( 500 , 1000 ), math . random ( 105000 , 110000 ), - 1943.89 , 273.41 , 40.75 , 359.9 , 360.0 , 181.7 },
{ 'Savanna' , 567 , math . random ( 500 , 1000 ), math . random ( 50000 , 70000 ), - 1943.69 , 256.95 , 40.91 , 0.5 , 360.0 , 16.2 },
{ 'Burrito' , 482 , math . random ( 500 , 1000 ), math . random ( 50000 , 60000 ), - 1955.91 , 266.65 , 41.17 , 359.1 , 360.0 , 302.5 },
{ 'Jester' , 559 , math . random ( 500 , 1000 ), math . random ( 120000 , 135000 ), - 1953.47 , 296.04 , 40.70 , 359.9 , 359.6 , 109.5 },
-- dol
{ 'Clover' , 542 , math . random ( 500 , 1000 ), math . random ( 15000 , 20000 ), - 1945.60 , 266.42 , 35.22 , 0.0 , 360.0 , 87.9 },
{ 'Premier' , 426 , math . random ( 500 , 1000 ), math . random ( 20000 , 25000 ), - 1962.04 , 272.60 , 35.21 , 359.9 , 0.0 , 293.0 },
{ 'Sabre' , 475 , math . random ( 500 , 1000 ), math . random ( 30000 , 35000 ), - 1945.15 , 273.97 , 35.28 , 359.7 , 0.0 , 121.7 },
{ 'Tahoma' , 566 , math . random ( 500 , 1000 ), math . random ( 10000 , 15000 ), - 1961.79 , 258.78 , 35.25 , 0.3 , 360.0 , 330.4 },
{ 'Glendale' , 466 , math . random ( 500 , 1000 ), math . random ( 40000 , 50000 ), - 1945.80 , 255.77 , 35.21 , 0.0 , 0.0 , 66.4 },
{ 'Club' , 589 , math . random ( 500 , 1000 ), math . random ( 40000 , 50000 ), - 1957.04 , 305.72 , 35.13 , 0.0 , 360.0 , 160.6 },
-- salon2
{ 'ZR-350' , 477 , math . random ( 500 , 1000 ), math . random ( 100000 , 120000 ), - 1667.28 , 1215.85 , 7.01 , 359.8 , 0.0 , 254.1 },
{ 'Cheetah' , 415 , math . random ( 500 , 1000 ), math . random ( 300000 , 350000 ), - 1658.35 , 1214.79 , 13.44 , 0.3 , 0.0 , 213.4 },
{ 'Turismo' , 451 , math . random ( 500 , 1000 ), math . random ( 700000 , 800000 ), - 1647.76 , 1207.18 , 20.86 , 359.5 , 359.9 , 47.4 },
{ 'Infernus' , 411 , math . random ( 500 , 1000 ), math . random ( 1200000 , 1300000 ), - 1663.27 , 1222.54 , 20.88 , 0.0 , 0.0 , 189.3 },
{ 'Bullet' , 541 , math . random ( 500 , 1000 ), math . random ( 800000 , 900000 ), - 1671.92 , 1205.50 , 20.78 , 359.5 , 360.0 , 309.0 },
{ 'Banshee' , 429 , math . random ( 500 , 1000 ), math . random ( 500000 , 550000 ), - 1653.78 , 1213.42 , 20.84 , 360.0 , 360.0 , 79.5 },
}
for i , v in pairs ( positionVehicles ) do
local veh = createVehicle ( v [ 2 ], v [ 5 ], v [ 6 ], v [ 7 ], v [ 8 ], v [ 9 ], v [ 10 ], v [ 11 ])
setElementData ( veh , 'vehicle:desc' , 'Pojazd: ' .. v [ 1 ].. '\nCena: ' .. v [ 4 ].. ' PLN\nPrzebieg: ' .. v [ 3 ].. ' km\nAby kupi? pojazd wsi?d? na F i wpisz /kuppojazd' )
setVehicleOverrideLights ( veh , 1 )
setElementFrozen ( veh , true )
local randomowe = math . random ( 100 , 255 )
setVehicleColor ( veh , randomowe , randomowe , randomowe , randomowe , randomowe , randomowe )
setVehicleDamageProof ( veh , true )
setElementData ( veh , 'vehicle.selling' , true )
veh : setData ( 'vehsell:info' , {
[ 'cost' ]= v [ 4 ],
[ 'model' ]= v [ 2 ],
[ 'mileage' ]= v [ 3 ],
[ 'selling' ]= v [ 12 ]
}, false )
end
addEventHandler ( 'onVehicleEnter' , resourceRoot , function( plr , seat , jacked )
if seat ~= 0 then return end
if source : getData ( 'vehsell:info' ) and source : getData ( 'vehsell:info' ). selling == 1 then
plr : outputChat ( '* Pojazd nie jest dost?pny w sprzeda?y.' , 255 , 0 , 0 )
return
end
local data = source : getData ( 'vehsell:info' )
if not data then return end
plr : setData ( 'vehsell:info' , {
[ 'cost' ]= data . cost ,
[ 'model' ]= data . model ,
[ 'mileage' ]= data . mileage ,
}, false )
plr : outputChat ( '* Aby zakupi? ten pojazd wpisz /kuppojazd' )
end )
addEventHandler ( 'onVehicleExit' , resourceRoot , function( plr , seat , jacked )
if seat ~= 0 then return end
local data = plr : getData ( 'vehsell:info' )
if not data then return end
plr : removeData ( 'vehsell:info' )
end )
addCommandHandler ( 'kuppojazd' , function( plr , cmd )
local data = plr : getData ( 'vehsell:info' )
if not data then return end
if getPlayerMoney ( plr ) < data . cost then
outputChatBox ( '* Nie posiadasz wystarczaj?cej ilo?ci PLN.' , plr , 255 , 0 , 0 )
return
end
local vehicle = plr : getOccupiedVehicle ()
if vehicle then
removePedFromVehicle ( vehicle )
end
local cost = data . cost
local model = data . model
local mileage = data . mileage
local uid = getElementData ( plr , 'player:uid' ) or 0
takePlayerMoney ( plr , cost )
exports [ 'ogrpg-db' ]: dbSet ( 'INSERT INTO ogrpg_vehicles (model, frozen, ownedPlayer, parking, fuel) VALUES (?, ?, ?, ?, ?)' , model , 0 , getElementData ( plr , 'player:uid' ), 1 , 15 )
outputChatBox ( '* Zakupiles swoj pojazd! Znajdziesz go w przechowywalni' , plr , 255 , 255 , 255 , true )
Timer (function()
destroyElement ( blip )
end , 60000 * 2 , 1 )
end )
Wysłany: 2019-01-16, 20:16
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
W jakim sensie 'na sztuki'? Chcesz mie? ograniczon??ilo?? pojazd?w w salonie?
Je?li chcesz usun?? pojazd u?yj funkcji
Dodaj go w tej komendzie:
addCommandHandler ( 'kuppojazd' , function( plr , cmd )
local data = plr : getData ( 'vehsell:info' )
if not data then return end
if getPlayerMoney ( plr ) < data . cost then
outputChatBox ( '* Nie posiadasz wystarczaj?cej ilo?ci PLN.' , plr , 255 , 0 , 0 )
return
end
local vehicle = plr : getOccupiedVehicle ()
if vehicle then
removePedFromVehicle ( vehicle )
end
local cost = data . cost
local model = data . model
local mileage = data . mileage
local uid = getElementData ( plr , 'player:uid' ) or 0
takePlayerMoney ( plr , cost )
exports [ 'ogrpg-db' ]: dbSet ( 'INSERT INTO ogrpg_vehicles (model, frozen, ownedPlayer, parking, fuel) VALUES (?, ?, ?, ?, ?)' , model , 0 , getElementData ( plr , 'player:uid' ), 1 , 15 )
outputChatBox ( '* Zakupiles swoj pojazd! Znajdziesz go w przechowywalni' , plr , 255 , 255 , 255 , true )
Timer (function()
destroyElement ( blip )
end , 60000 * 2 , 1 )
end )
Rozwi?zanie:
Wysłany: 2019-01-16, 20:30
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Okey, a dalo by sie na sztuki ?
Wysłany: 2019-01-16, 20:31
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Ale co na sztuki, ograniczona ilo?? pojazd?w w salonie?
Wysłany: 2019-01-16, 21:29
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Wysłany: 2019-01-16, 22:59
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
No to stw?rz pojazd raz i po kupnie go usuwaj, tak jak wy?ej.
Wysłany: 2019-01-17, 14:37
kuba43
Wiek: 45 Na forum: 3225 dni Posty: 166
Nick w MP: definitly
Piwa : 17
Na przyk?ad robisz tabele w mysql w kt?rej dodaj? sie modele pojazd?w, i robisz dbExec sprawdzasz ilo??, robisz instrukcje warunkow? je?eli jest np 25 pojazd?w to usuwasz pojazd z salonu.
Podpis
„(…) wystarczy, że odpowiesz sobie na jedno zajebiście, ale to zajebiście, ważne pytanie: co lubię w życiu robić. A potem zacznij to robić.”.
Wysłany: 2019-01-17, 16:43
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Okey, kuba mog? jak?? prowizork? tego? Tabelki ogarniam lecz DBexec nic a nic.
Wysłany: 2019-01-17, 16:54
kuba43
Wiek: 45 Na forum: 3225 dni Posty: 166
Nick w MP: definitly
Piwa : 17
je?eli to pys mo?esz u?yc funkcji dbSet b?dz dbGet a jak nie wiesz o co chodzi to odsy?am cie do poradnika http://gtao.pl/102402.htm
Podpis
„(…) wystarczy, że odpowiesz sobie na jedno zajebiście, ale to zajebiście, ważne pytanie: co lubię w życiu robić. A potem zacznij to robić.”.
Wysłany: 2019-01-20, 15:17
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Tagi: sztuki :: salonach
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: