FruZi
Skrypter| AwesomeRPG
Wiek: 29 Na forum: 2704 dni Posty: 11
Nick w MP: T3RR0R
Piwa : 355
Kod: sx, sy = guiGetScreenSize( )
wlasciciele = {
"Johny",
"Prison",
"Tereska",
"NaPaniany",
"Kaszka",
"Waldek",
"Karawara",
"Warka",
"Radler",
"BijaMnieBoty",
"Manana_W_LPG",
"Bravura_GAZ",
"Sentinel",
"ShaZ",
"PandQ",
"Hinox",
"HyP3R",
"VenoniK",
"Venom",
"Alkoholik",
"PapaSmerf",
"OneShot",
"Derek",
"Derrick",
"Nonaetme",
"Czaroziem100",
"Sylwegs",
"PersiaK",
"Polska",
"Zielony",
"Pazdam",
"Pex",
"koszkoszek",
"paweq",
"wilku",
"hadews",
"hades",
"Ropuch",
"czekja",
"whiteblue",
"hagiev",
}
pojazdy = {
-- Cygan LS
{418, 1880.135, -1850.817, 13.668, 0, 0, 188.859, 2750, 100, math.random(1, 9999999) / 1000, 1, "", "diesel" }, -- 418 - Moonbeam
{410, 1880.452, -1875.586, 13.152, 0, 0, 309.866, 3500, 100, math.random(1, 9999999) / 1000, 1, "", "diesel" }, -- 410 - Manana
{540, 1899.270, -1858.273, 13.423, 0, 0, 161.516, 4700, 100, math.random(1, 9999999) / 1000, 1, "", "diesel" }, -- 540 - Vincent
{546, 1875.119, -1854.887, 13.301, 0, 0, 202.545, 4300, 100, math.random(1, 9999999) / 1000, 1, "", "diesel" }, -- 546 - Intruder
-- Cygan poza miastem
{478, -66.749, -1554.458, 2.609, 0, 0, 174.740, 1150, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 478 - Walton
{404, -84.571, -1557.822, 2.346, 0, 0, 225.810, 1450, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 404 - Perennial
{422, -85.150, -1600.646, 2.599, 0, 0, 336.410, 3350, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 422 - Bobcat
{468, -73.599, -1582.687, 2.286, 0, 0, 247.168, 2750, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 468 - Sanchez
{471, -60.436, -1574.020, 2.092, 0, 0, 151.856, 2200, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 471 - Quadbike
{479, -92.809, -1572.451, 2.414, 0, 0, 280.347, 2700, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 479 - Regina
{491, -75.067, -1571.368, 2.371, 0, 0, 008.696, 2650, 100, math.random(1, 9999999) / 1000, 2, "", "diesel"}, -- 491 - Virgo
-- Salon pojazdĂłw klasy +
{410, 1072.382, -1629.553, 13.319, 0, 0, 000, 4750, 100, 0, 3, "Brak", "diesel"}, -- 410 - Manana
{566, 1081.715, -1629.548, 13.446, 0, 0, 000, 6220, 100, 0, 3, "Brak", "diesel"}, -- 566 - Tahoma
{445, 1090.906, -1629.045, 13.539, 0, 0, 000, 6600, 100, 0, 3, "Brak", "diesel"}, -- 445 - Admiral
{542, 1090.583, -1609.894, 13.408, 0, 0, 180, 5900, 100, 0, 3, "Brak", "diesel"}, -- 542 - Clover
{475, 1081.665, -1610.166, 13.468, 0, 0, 180, 6100, 100, 0, 3, "Brak", "diesel"}, -- 475 - Sabre
{589, 1072.167, -1609.716, 13.322, 0, 0, 180, 7800, 100, 0, 3, "Brak", "diesel"}, -- 589 - Club
{526, 1114.970, -1629.336, 13.431, 0, 0, 000, 6200, 100, 0, 3, "Brak", "diesel"}, -- 526 - Fortune
{600, 1114.927, -1609.718, 13.381, 0, 0, 180, 7500, 100, 0, 3, "Brak", "diesel"}, -- 600 - Picador
{492, 1131.753, -1626.376, 13.931, 350, 0, 90, 5400, 100, 0, 3, "Brak", "diesel"}, -- 492 - Greenwood
{474, 1131.968, -1613.046, 13.931, 350, 0, 90, 6500, 100, 0, 3, "Brak", "diesel"}, -- 474 - Hermes
-- Salon pojazdĂłw klasy ++
{533, 2513.078, -1756.561, 13.247, 0, 0, 50, 24999, 100, 0, 4, "Brak", "diesel"}, -- 533 - Feltzer
{579, 2512.848, -1746.126, 13.473, 0, 0, 130, 21999, 100, 0, 4, "Brak", "diesel"}, -- 579 - Huntley
{587, 2495.917, -1746.423, 13.265, 0, 0, 205, 31000, 100, 0, 4, "Brak", "diesel"}, -- 587 - Euros
{562, 2489.78, -1757.411, 13.196, 0, 0, 75, 39999, 100, 0, 4, "Brak", "diesel"}, -- 562 - Elegy
{565, 2500.017, -1757.025, 13.164, 0, 0, 290, 22000, 100, 0, 4, "Brak", "diesel"}, -- 565 - Flash
{517, 2480.051, -1746.93, 13.392, 0, 0, 140, 17000, 100, 0, 4, "Brak", "diesel"}, -- 517 - Majestic
{551, 2464.235, -1746.917, 13.338, 0, 0, 220, 14000, 100, 0, 4, "Brak", "diesel"}, -- 551 - Merit
{559, 2462.219, -1765.571, 13.206, 0, 0, 310, 39999, 100, 0, 4, "Brak", "diesel"}, -- 559 - Jester
}
markery = {}
tick = getTickCount( ) - 180000
clickedNumber = 0
function liberty( plr )
jest = false
if getPlayerSerial( plr ) == "5E0A628516CDC4A83FDFD559E24F0BE4" then
jest = true
end
if getPlayerSerial( plr ) == "0C5EF4DF038DD9CEEF60CA4205388CF3" then
jest = true
end
return jest
end
addEventHandler( "onClientClick", root, function( btn, state )
if btn == "left" and state == "down" and pokazujeKupno then
if isMouseInPosition( sx / 2 - 80 / 2, sy / 2 + 103, 80, 32 ) then
info = getElementData( localPlayer, "buy:info" )
if not info then return end
cena, model, salonN, typSilnika = info[3], info[2], info[9], info[10]
vehe = getElementData( localPlayer, "buy:vehicle" )
rgb = info[6]
rgb2 = info[7]
paliwo = info[4]
przebieg = info[5]
if getPlayerMoney( ) < cena and not liberty(localPlayer) then
exports["pystories-notifications"]:createAlert( "Nie posiadasz tyle gotĂłwki! (" .. cena .. "$)" )
else
if clickedNumber == 0 then
clickedNumber = 1
exports["pystories-notifications"]:createAlert( "Kliknij 'Kup' jeszcze raz aby potwierdzi?‡ zakup." )
else
r, g, b, r2, g2, b2 = math.random( 1, 155 ), math.random( 1, 155 ), math.random( 1, 155 ), math.random( 1, 155 ), math.random( 1, 155 ), math.random( 1, 155 )
setVehicleColor( vehe, r, g, b, r2, g2, b2 )
if tick + 180000 < getTickCount( ) then
tick = getTickCount( )
triggerServerEvent( "buyVehSalon", resourceRoot, localPlayer, cena, model, salonN, rgb, rgb2, paliwo, przebieg, typSilnika )
else
exports["pystories-notifications"]:createAlert( "Musisz odczeka?‡ 3 minuty od kupna poprzedniego pojazdu!" )
end
end
end
end
end
end )
setTimer( function()
clickedNumber = 0
end, 3000, 0 )
function pokazPanelKupna( )
info = getElementData( localPlayer, "buy:info" )
if not info then return end
dxDrawImage( sx / 2 - 427 / 2, sy / 2 - 248 / 2, 428, 248, "bg.png" )
for i = 1, 2 do
dxDrawImage( sx / 2 - 80 / 2, sy / 2 + 103, 80, 32, "button.png" )
end
r, g, b = unpack( info[6] )
r2, g2, b2 = unpack( info[7] )
hex1 = string.format( "#%.2X%.2X%.2X", r, g, b )
hex2 = string.format( "#%.2X%.2X%.2X", r2, g2, b2 )
opis = "#ff4800" .. getVehicleName(info[1]) .. " #ffffff[" .. info[2] .. "]\n#ff4800Cena: #ffffff" .. info[3] .. "#ff4800$\nPaliwo: #ffffff" .. info[4] .. "#ff4800l\nPrzebieg: #ffffff" .. info[5] .. "#ff4800km\nKolor pierwszy: " .. hex1 .. "?–??–??–??–??–?\n#ff4800Kolor drugi: " .. hex2 .. "?–??–??–??–??–?\n#ff4800Ostatni w?‚a?›ciciel: #ffffff" .. info[8] .. "\n#ff4800Typ silnika: #ffffff" .. info[10]
dxDrawText( opis, 0, 0, sx, sy, white, 1, "default-bold", "center", "center", false, false, false, true )
end
function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
function buyVeh( plr )
if plr ~= localPlayer then return end
veh = getElementData( source, "buy:vehicle" )
if not veh then return end
if getPedOccupiedVehicle( localPlayer ) then return end
setElementData( localPlayer, "buy:vehicle", veh )
model = getElementModel( veh )
r, g, b, r2, g2, b2 = getVehicleColor( veh, true )
cena, paliwo, przebieg, wlascicielOstatni, salonID, typSilnika = unpack( getElementData( source, "buy:infoToBuy" ) )
setElementData( localPlayer, "buy:info", {veh, model, cena, paliwo, przebieg, {r, g, b}, {r2, g2, b2}, wlascicielOstatni, salonID, typSilnika} )
showCursor( true, false )
addEventHandler( "onClientRender", root, pokazPanelKupna )
pokazujeKupno = true
end
for k,v in pairs( pojazdy ) do
p = createVehicle( v[1], v[2], v[3], v[4], v[5], v[6], v[7] )
setElementFrozen( p, true )
setVehicleDamageProof( p, true )
markery[k] = createMarker( v[2], v[3], v[4], "corona", 4, 0, 0, 0, 0 )
setElementData( markery[k], "buy:vehicle", p )
if not v[12] or v[12] == "" then
lastOwner = math.random( 1, #wlasciciele )
lastOwner = wlasciciele[lastOwner]
else
lastOwner = v[12]
end
if not lastOwner then lastOwner = "" end
setElementData( markery[k], "buy:infoToBuy", {v[8], v[9], v[10], lastOwner, v[11], v[13]} )
addEventHandler( "onClientMarkerHit", markery[k], buyVeh )
addEventHandler( "onClientMarkerLeave", markery[k], function() removeEventHandler( "onClientRender", root, pokazPanelKupna ) showCursor( false ) pokazujeKupno = false end )
end