Awruk2003
Wiek: 36 Na forum: 3490 dni Posty: 7
Nick w MP: Suchy
Piwa : 13
Otoz mam problem z salonem. Mam skrypt z ownworda salony. Gdy kupuje pojazd auto znika i ma sie zrespic za 2-5sekund ale sie nie respi tutaj kod:
-[[
@Author: Asper
@Copyright: Asper, 2017
@Pierwotne prawo do u?ytku tego skryptu ma TYLKO autor i serwery otrzymuj?ce zgod? na jego u?ytkowanie przez autora
@Obowi?zuje ca?kowity zakaz rozpowszechniania skrypt?w, zmiany autora, edycji skrypt?w bez zgody autora
@Obowi?zuje ca?kowity nakaz zachowania autora po uzyskaniu zgody na u?ywanie skryptu przez autora
@Nakazuje si? zastosowa? do regulaminu zawartego w licencji skryptu
@Skrypt zosta? zrobiony przez "Asper".
@Nie masz prawa u?ytkowa? tego skryptu bez mojej zgody.
@Pierwotne prawo do u?ytkowania tego skryptu ma tylko i wy??cznie autor tj. Asper oraz serwer Own World
@Z?amanie powy?szych podpunkt?w wi??e si? z odpowiedzialno?ci? karn?, "Naruszenie praw autorskich".
Kontakt do zezwolenia na u?ytek skryptu:
E-Mail: [email protected]
]]
local vehiclesForSell = {
[ 1 ] = { -- salon las barrancas -- KLASA C
modele = { 482 , 554 , 496 , 439 , 475 , 542 , 405 , 445 , 424 , 412 },
ceny = {
[ 482 ] = 53950 ,
[ 554 ] = 53540 ,
[ 496 ] = 52432 ,
[ 439 ] = 54954 ,
[ 475 ] = 55429 ,
[ 542 ] = 53459 ,
[ 405 ] = 53299 ,
[ 445 ] = 51300 ,
[ 424 ] = 53954 ,
[ 412 ] = 52200 ,
},
rodzaje = { "Benzyna" , "Diesel" },
pojemnosc = math . random ( 4 , 6 ),
przebieg = math . random ( 200 , 500 ),
auta = {
{ pos ={- 766.5859375 , 1637.083984375 , 27.449569702148 , - 10 , 177.54156494141 }},
{ pos ={- 778.79193115234 , 1635.5759277344 , 27.619089126587 , - 10 , 199.60162353516 }},
{ pos ={- 752.69158935547 , 1635.5114746094 , 27.437664031982 , - 10 , 176.05902099609 }},
},
respawn = {- 778.66839599609 , 1626.8509521484 , 27.124444961548 , 0 , 0 , 180 }
},
[ 2 ] = { -- lokalny sprzedawca fc - lv 1 -- KLASA A / B
modele = { 418 , 422 , 478 , 543 , 436 , 546 , 400 , 500 , 491 , 479 },
ceny = {
[ 418 ] = 2040 ,
[ 422 ] = 2100 ,
[ 478 ] = 1970 ,
[ 543 ] = 2070 ,
[ 436 ] = 2120 ,
[ 546 ] = 2100 ,
[ 400 ] = 11540 ,
[ 500 ] = 11300 ,
[ 491 ] = 10400 ,
[ 479 ] = 1920 ,
},
rodzaje = { "Benzyna" , "Diesel" , "LPG" },
pojemnosc = math . random ( 1 , 3 ),
przebieg = math . random ( 300000 , 450000 ),
auta = {
{ pos ={ 709.24578857422 , 1202.9727783203 , 13.106240272522 , 0 , 264.01013183594 }},
{ pos ={ 705.05096435547 , 1184.7241210938 , 13.418202400208 , 0 , 248.83923339844 }},
{ pos ={ 506.37805175781 , 1113.1976318359 , 14.630906105042 , 0 , 357 }},
},
respawn = { 714.74188232422 , 1195.1882324219 , 13.073204040527 , 0 , 0 , 350 }
},
[ 3 ] = { -- lokalny sprzedawca fc - lv 2 -- KLASA A / B
modele = { 418 , 422 , 478 , 543 , 436 , 546 , 526 , 489 , 400 , 479 },
ceny = {
[ 418 ] = 2040 ,
[ 422 ] = 2100 ,
[ 478 ] = 1970 ,
[ 543 ] = 2070 ,
[ 436 ] = 2120 ,
[ 546 ] = 2100 ,
[ 526 ] = 12320 ,
[ 489 ] = 11230 ,
[ 400 ] = 11540 ,
[ 479 ] = 1920 ,
},
rodzaje = { "Benzyna" , "Diesel" , "LPG" },
pojemnosc = math . random ( 1 , 3 ),
przebieg = math . random ( 300000 , 450000 ),
auta = {
{ pos ={ 506.01614379883 , 1113.7913818359 , 14.562087059021 , 0 , 330 }},
{ pos ={ 505.88836669922 , 1112.7608642578 , 14.603409767151 , 0 , 340 }},
},
respawn = { 514.30242919922 , 1119.2205810547 , 14.773616790771 , 0 , 0 , 42.929809570313 }
},
[ 3 ] = { -- lokalny sprzedawca fc - lv 3 -- KLASA B
modele = { 600 , 491 , 526 , 419 , 518 , 467 , 466 , 529 , 540 , 400 , 489 , 500 },
ceny = {
[ 600 ] = 12400 ,
[ 491 ] = 10400 ,
[ 526 ] = 12320 ,
[ 419 ] = 11200 ,
[ 518 ] = 11430 ,
[ 467 ] = 10320 ,
[ 466 ] = 11120 ,
[ 529 ] = 11000 ,
[ 540 ] = 10400 ,
[ 400 ] = 11540 ,
[ 489 ] = 11230 ,
[ 500 ] = 11300 ,
},
rodzaje = { "Benzyna" , "Diesel" , "LPG" },
pojemnosc = math . random ( 1 , 3 ),
przebieg = math . random ( 300000 , 450000 ),
auta = {
{ pos ={ 781.85900878906 , 1941.6395263672 , 5.1951537132263 , 0 , 55 }},
{ pos ={ 752.86602783203 , 1966.5372314453 , 5.0718927383423 , 0 , 263 }},
{ pos ={ 754.89709472656 , 1982.0913085938 , 5.0918235778809 , 0 , 250 }},
},
respawn = { 758.59594726563 , 1944.072265625 , 5.1748971939087 , 0 , 0 , 178.22985839844 }
},
[ 4 ] = { -- lokalny sprzedawca las barrancas
modele = { 418 , 422 , 478 , 543 , 436 , 546 , 526 , 489 , 400 },
ceny = {
[ 418 ] = 2040 ,
[ 422 ] = 2100 ,
[ 478 ] = 1970 ,
[ 543 ] = 2070 ,
[ 436 ] = 2120 ,
[ 546 ] = 2100 ,
[ 526 ] = 12320 ,
[ 489 ] = 11230 ,
[ 400 ] = 11540 ,
},
rodzaje = { "Benzyna" , "Diesel" , "LPG" },
pojemnosc = math . random ( 1 , 3 ),
przebieg = math . random ( 300000 , 450000 ),
auta = {
{ pos ={- 883.46569824219 , 1519.8520507813 , 25.898166656494 , 0 , 92.070861816406 }},
{ pos ={- 904.36474609375 , 1547.7326660156 , 25.88151550293 , 0 , 274.24993896484 }},
{ pos ={- 882.51342773438 , 1558.1418457031 , 25.74137878418 , 0 , 84.237182617188 }},
},
respawn = {- 899.05383300781 , 1533.6219482422 , 25.762277603149 , 0 , 0 , 341.58020019531 }
},
[ 5 ] = { -- lokalny sprzedawca las paysadas
modele = { 471 , 462 ,},
ceny = {
[ 471 ] = 3940 ,
[ 462 ] = 4200 ,
},
rodzaje = { "Benzyna" },
pojemnosc = math . random ( 1 , 3 ),
przebieg = math . random ( 60000 , 110000 ),
auta = {
{ pos ={- 615.70910644531 , 2709.7622070313 , 71.773368835449 , 0 , 179.5712890625 }},
{ pos ={- 586.01409912109 , 2713.173828125 , 71.193145751953 , 0 , 182.43853759766 }},
},
respawn = {- 597.58917236328 , 2704.3330078125 , 71.769355773926 , 0 , 0 , 158.24523925781 }
},
[ 6 ] = { -- salon el quebrados -- KLASA C
modele = { 482 , 554 , 496 , 439 , 475 , 542 , 405 , 445 , 424 , 412 ,},
ceny = {
[ 482 ] = 53950 ,
[ 554 ] = 53540 ,
[ 496 ] = 52432 ,
[ 439 ] = 54954 ,
[ 475 ] = 55429 ,
[ 542 ] = 53459 ,
[ 405 ] = 53299 ,
[ 445 ] = 51300 ,
[ 424 ] = 53954 ,
[ 412 ] = 52200 ,
},
rodzaje = { "Benzyna" , "Diesel" },
pojemnosc = math . random ( 4 , 6 ),
przebieg = math . random ( 200 , 500 ),
auta = {
{ pos ={- 1522.5491943359 , 2640.7563476563 , 56.296276092529 , - 10 , 94 }},
{ pos ={- 1522.3863525391 , 2631.37109375 , 56.249530792236 , - 10 , 90 }},
},
respawn = {- 1532.0906982422 , 2635.6027832031 , 55.7109375 , 0 , 0 , 90 }
},
[ 7 ] = { -- salon las payasadas -- KLASA D
modele = { 558 , 565 , 587 , 602 , 533 , 545 ,},
ceny = {
[ 558 ] = 92300 ,
[ 565 ] = 94032 ,
[ 587 ] = 93230 ,
[ 602 ] = 94300 ,
[ 533 ] = 94030 ,
[ 545 ] = 95200 ,
},
rodzaje = { "Benzyna" , "Diesel" },
pojemnosc = math . random ( 4 , 6 ),
przebieg = math . random ( 200 , 500 ),
auta = {
{ pos ={- 221.44659423828 , 2730.6340332031 , 63.064525604248 , - 10 , 8 }},
{ pos ={- 231.51264953613 , 2729.9150390625 , 63.093330383301 , - 10 , 0 }},
{ pos ={- 241.36517333984 , 2730.8486328125 , 63.060375213623 , - 10 , 350 }},
},
respawn = {- 231.5301361084 , 2737.5517578125 , 62.562492370605 , 0 , 0 , 0 }
},
[ 8 ] = { -- salon fc - lv -- KLASA B
modele = { 600 , 491 , 526 , 419 , 518 , 467 , 466 , 529 , 540 , 400 , 489 , 500 },
ceny = {
[ 600 ] = 22400 ,
[ 491 ] = 20400 ,
[ 526 ] = 22320 ,
[ 419 ] = 21200 ,
[ 518 ] = 21430 ,
[ 467 ] = 20320 ,
[ 466 ] = 21120 ,
[ 529 ] = 21000 ,
[ 540 ] = 20400 ,
[ 400 ] = 21540 ,
[ 489 ] = 21230 ,
[ 500 ] = 21300 ,
},
rodzaje = { "Benzyna" , "Diesel" },
pojemnosc = math . random ( 4 , 6 ),
przebieg = math . random ( 200 , 500 ),
auta = {
{ pos ={ 691.78814697266 , 1829.2016601563 , 5.5590443611145 , - 10 , 10 }},
{ pos ={ 681.13012695313 , 1829.4720458984 , 5.5104570388794 , - 10 , 349 }},
{ pos ={ 671.21362304688 , 1833.0034179688 , 5.4190573692322 , - 10 , 318 }},
},
respawn = { 681.81842041016 , 1844.1842041016 , 5.2508063316345 , 0 , 0 , 354 }
},
[ 9 ] = { -- salon las payasadas -- KLASA D
modele = { 558 , 565 , 587 , 602 , 533 , 545 ,},
ceny = {
[ 558 ] = 92300 ,
[ 565 ] = 94032 ,
[ 587 ] = 93230 ,
[ 602 ] = 94300 ,
[ 533 ] = 94030 ,
[ 545 ] = 95200 ,
},
rodzaje = { "Benzyna" , "Diesel" },
pojemnosc = math . random ( 4 , 6 ),
przebieg = math . random ( 200 , 500 ),
auta = {
{ pos ={- 147.35707092285 , 1182.1918945313 , 19.983442306519 , 10 , 334 }},
{ pos ={- 155.48170471191 , 1182.5645751953 , 20.0133228302 , 10 , 20 }},
},
respawn = {- 151.19030761719 , 1188.4525146484 , 19.495906829834 , 0 , 0 , 0 }
},
[ 10 ] = { -- lokalny sprzedawca eq -- KLASA M2
modele = { 463 , 586 , 468 ,},
ceny = {
[ 463 ] = 14650 , -- freeway
[ 586 ] = 14300 , -- wayfarer
[ 468 ] = 16200 , -- sabchez
},
rodzaje = { "Benzyna" },
pojemnosc = math . random ( 1 , 3 ),
przebieg = math . random ( 60000 , 110000 ),
auta = {
{ pos ={- 1480.9230957031 , 2636.130859375 , 58.451278686523 , 0 , 58 }},
{ pos ={- 1480.7233886719 , 2632.0036621094 , 58.455635070801 , 0 , 86 }},
},
respawn = {- 1483.3231201172 , 2644.9926757813 , 58.455699920654 , 0 , 0 , 0 }
},
}
local pedy = {
{ 505.21505737305 , 1116.9650878906 , 14.814413070679 , 330 },
{ 707.68084716797 , 1185.8043212891 , 13.390625 , 228 },
{ 712.80810546875 , 1204.416015625 , 13.396438598633 , 230 },
{- 885.81195068359 , 1517.3201904297 , 25.9140625 , 99 },
{- 902.68487548828 , 1545.2883300781 , 25.9140625 , 306 },
{- 614.61193847656 , 2708.4392089844 , 72.375 , 165 },
{- 584.27532958984 , 2711.8984375 , 71.748054504395 , 194 },
{ 779.18994140625 , 1939.8366699219 , 5.4568634033203 , 72 },
{ 754.25994873047 , 1971.8992919922 , 5.69961977005 , 171 },
{ 757.15484619141 , 1984.8095703125 , 5.3359375 , 186 },
{- 1481.0703125 , 2641.34375 , 58.787948608398 , 75 }
}
for i , v in ipairs ( pedy ) do
local ped = createPed ( 158 , v [ 1 ], v [ 2 ], v [ 3 ], v [ 4 ])
setElementFrozen ( ped , true )
setElementData ( ped , "text" , "Lokalny sprzedawca" )
end
local getPojemnosc = {
[- 1 ] = "50" ,
[- 2 ] = "200" ,
[- 3 ] = "350" ,
[- 4 ] = "500" ,
[- 5 ] = "750" ,
[- 6 ] = "950" ,
[- 7 ] = "1100" ,
[ 1 ] = "1200" ,
[ 2 ] = "1600" ,
[ 3 ] = "1800" ,
[ 4 ] = "2000" ,
[ 5 ] = "2200" ,
[ 6 ] = "2500" ,
}
local cuboids = {}
local markers = {}
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 = vehiclesForSell [ i ][ "pojemnosc" ]
local przebieg = vehiclesForSell [ i ][ "przebieg" ]
model = vehiclesForSell [ i ][ "modele" ][ model ]
local cena = vehiclesForSell [ i ][ "ceny" ][ model ]
rodzaj = vehiclesForSell [ i ][ "rodzaje" ][ rodzaj ]
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 , 75 )
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 ], "cena" , cena )
setElementData ( cuboids [ x ], "przebieg" , przebieg )
setElementData ( cuboids [ x ], "rodzaj" , rodzaj )
setElementData ( cuboids [ x ], "pojemnosc" , pojemnosc )
setElementFrozen ( veh , true )
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 })
local desc = exports [ "custom_vehicles" ]: getVehicleCustomName ( model ).. "\nPrzebieg: " .. przebieg .. "km\nCena: " .. cena .. " $\nPojemno ??: " .. getPojemnosc [ pojemnosc ].. "cm³\nRodzaj paliwa: " .. rodzaj
setElementData ( veh , "veh:salon" , true )
setElementData ( veh , "veh:salon:desc" , desc )
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 pojemnosc = vehiclesForSell [ i ][ "pojemnosc" ]
local przebieg = vehiclesForSell [ i ][ "przebieg" ]
model = vehiclesForSell [ i ][ "modele" ][ model ]
local cena = vehiclesForSell [ i ][ "ceny" ][ model ]
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 , 75 )
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 [ _ ], "cena" , cena )
setElementData ( cuboids [ _ ], "marker" , markers [ _ ])
setElementData ( cuboids [ _ ], "slotix" , _ )
setElementData ( cuboids [ _ ], "przebieg" , przebieg )
setElementData ( cuboids [ _ ], "rodzaj" , rodzaj )
setElementData ( cuboids [ _ ], "pojemnosc" , pojemnosc )
setElementFrozen ( veh , true )
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 })
local desc = exports [ "custom_vehicles" ]: getVehicleCustomName ( model ).. "\nPrzebieg: " .. przebieg .. "km\nCena: " .. cena .. " $\nPojemno ??: " .. getPojemnosc [ pojemnosc ].. "cm³\nRodzaj paliwa: " .. rodzaj
setElementData ( veh , "veh:salon" , true )
setElementData ( veh , "veh:salon:desc" , desc )
end
end
end
for i = 1 , #vehiclesForSell do
createVehicleFromSlot ( i )
end
print( "salon wystartowal" )
function isPlayerInCuboid ( element )
for i , v in ipairs ( getElementsByType ( "colshape" , resourceRoot )) do
for k , x in ipairs ( getElementsWithinColShape ( v )) do
if x == element then
return v
end
end
end
return false
end
addEvent ( "kup:pojazd" , true )
addEventHandler ( "kup:pojazd" , root , function()
local player = source
local shape = isPlayerInCuboid ( player )
if shape then
local result = exports . rpg_mysql : mysql_query ( "SELECT * FROM rpg_prawka WHERE serial=? AND aktywnydo>NOW()" , getPlayerSerial ( player ))
if #result > 0 then
outputChatBox ( "Posiadasz zabrane prawo jazdy od " .. result [ 1 ]. aktywnyod .. " do " .. result [ 1 ]. aktywnydo .. " zabrane przez " .. result [ 1 ]. admin .. " z powodu " .. result [ 1 ]. powod , player , 255 , 0 , 0 )
return
else
exports . rpg_mysql : mysql_query ( "DELETE FROM rpg_prawka WHERE serial=?" , getPlayerSerial ( player ))
end
if getElementData ( player , "user:pjB" ) == 0 then
exports . rpg_noti : createNotification ( player , "error" , "Nie posiadasz prawa jazdy" )
return
end
local data = getElementData ( shape , "data" )
local slot = getElementData ( shape , "slot" )
local slotix = getElementData ( shape , "slotix" )
local marker = getElementData ( shape , "marker" )
local respawn = getElementData ( shape , "respawn" )
local model = getElementData ( shape , "model" )
local cena = getElementData ( shape , "cena" )
local pojemnosc = getElementData ( shape , "pojemnosc" )
local rodzaj = getElementData ( shape , "rodzaj" )
local przebieg = getElementData ( shape , "przebieg" )
if data then
local money = getPlayerMoney ( player )
if money >= cena then
exports . rpg_noti : createNotification ( player , "x" , "Kupi?e? pojazd " .. exports [ "custom_vehicles" ]: getVehicleCustomName ( model ))
local x , y , z , rz = unpack ( respawn )
local pos = x .. ", " .. y .. ", " .. z .. ", 0, 0, " .. rz
local cc = getElementData ( shape , "color" )
local r , g , b = unpack ( cc )
local vehicle = getElementData ( shape , "vehicle" )
takePlayerMoney ( player , cena )
local color = r .. ", " .. g .. ", " .. b .. ", " .. r .. ", " .. g .. ", " .. b
local query , _ , uid
if rodzaj == "LPG" then
query , _ , uid = exports . rpg_mysql : mysql_query ( "insert into rpg_vehicles set model=?, owner=?, przecho=0, parking=0, pcost=0, pos=?, plate=?, panelstates=?, wheelstates=?, upgrades=?, distance=?, stan=1000, fuel=0, bak=25, gas=25, color=?, lampy=?, mk1=0, mk2=0, mk3=0, naped=?, pojemnosc=?, rodzaj=?, organizacja=?, rh=0" , model , getElementData ( player , "user:uid" ), pos , "" , "0,0,0,0,0,0" , "0,0,0" , "" , przebieg , color , "255,255,255" , "" , pojemnosc , rodzaj , "" )
else
query , _ , uid = exports . rpg_mysql : mysql_query ( "insert into rpg_vehicles set model=?, owner=?, przecho=0, parking=0, pcost=0, pos=?, plate=?, panelstates=?, wheelstates=?, upgrades=?, distance=?, stan=1000, fuel=25, bak=25, gas=0, color=?, lampy=?, mk1=0, mk2=0, mk3=0, naped=?, pojemnosc=?, rodzaj=?, organizacja=?, rh=0" , model , getElementData ( player , "user:uid" ), pos , "" , "0,0,0,0,0,0" , "0,0,0" , "" , przebieg , color , "255,255,255" , "" , pojemnosc , rodzaj , "" )
end
local veh = exports . rpg_vehicles : createNewVehicle ( uid )
warpPedIntoVehicle ( player , veh )
destroyElement ( vehicle )
destroyElement ( shape )
destroyElement ( marker )
cuboids [ slotix ] = false
markers [ slotix ] = false
setTimer (function()
createVehicleFromSlot ( slot , slotix )
end , 1800000 , 1 )
else
exports . rpg_noti : createNotification ( player , "x" , "Brak wystarczaj?cych funduszy" )
end
end
end
end )
Ostatnio zmieniony przez FrosteR 2018-07-25, 22:44, w całości zmieniany 1 raz