Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: autobusy
1. Praca Autobusy
Witam chcia?bym zrobic w tym skrypcie tak aby by?o wymagane 500rp oraz zeby autobus respi? sie w dw?ch miejscach. Za pomoc daje piwko


[lua]
local sw, sh=guiGetScreenSize()
local w, h=(sw/1680), (sh/1050)
local font=dxCreateFont("f.ttf", 12)
local font2=dxCreateFont("f.ttf", 10)
local font3=dxCreateFont("f.ttf", 15)
local font4=dxCreateFont("f.ttf", 14)
local menuJob=false
local potwierdzExit=false
local praca="Autobusy"
local bileciki=false
local bilecikii=false
local ileos=0
local jakibilet="?"
startTick=getTickCount()

function isMouseIn( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
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


przystanki={
{-2122.41,112.63,35.17},
{-2169.59,-26.66,35.17},
{-2260.83,-96.63,35.17},
{-2334.27,-187.85,35.17},
{-2369.71,15.27,35.16},
{-2249.44,274.71,35.16},
{-2224.04,482.04,35.02},
{-2192.46,562.47,35.02},
{-2007.88,409.30,35.02},
{-2086.54,322.91,35.02},
{-2149.06,229.84,35.17},
{-2086.71,62.46,34.56},
}

local przystanek
local przystanekTarget
local blip


addEvent("autobusy:kolizja", true)
addEventHandler("autobusy:kolizja", getRootElement(), fu...
2. Praca autobusy
Witam mam problem poniewa? gdy resetuje prace autobusy to sa 3 trasy i kazda dziala poprawnie lecz po chwili trasa 1 robi sie trasa 2 i sa tylko 2 trasy. Za pomoc daje :piwo:

I jeszcze czy mozna jakos zrobic zeby tylko gracz ktory posiada np kat.c prawko moze tylko pracowac tutaj

bus_c
[lua]--[[
Praca busa

]]--

local code = "Autobusy"
local districtsBus


local districtsBus = {
{-1510.31,744.04,8.34},
{-1543.25,722.96,8.17},
{-1535.81,792.54,8.17},
{-1525.36,900.56,8.18},
{-1577.98,1027.95,8.17},
{-1581.30,1163.18,8.18},
{-1679.03,1298.93,8.18},
{-1813.48,1384.91,8.18},
{-1981.38,1311.87,8.18},
{-2110.66,1276.92,19.21},
{-2237.84,1276.99,40.98},
{-2270.13,1156.74,59.28},
{-2269.33,1016.83,84.74},
{-2269.72,866.64,67.63},
{-2270.28,688.38,50.43},
{-2373.26,670.63,36.22},
{-2390.14,575.14,25.79},
{-2519.81,569.83,15.58},
{-2638.31,569.33,15.60},
{-2746.82,570.02,15.55},
{-2707.95,457.14,5.32},
{-2752.48,403.60,5.27},
{-2714.97,333.88,5.32},
{-2708.07,217.64,5.31},
{-2708.34,98.11,5.32},
{-2708.42,22.10,5.33},
{-2708.48,-64.32,5.38},
{-2623.18,-72.36,5.32},
{-2502.88,-72.94,26.95},
{-2389.62,-72.57,36.31},
{-2283.48,-72.71,36.31},
{-2180.94,-73.11,36.31},
{-2047.15,-73.21,36.30},
{-1957.38,-66.36,26.99},
{-1854.50,-120.20,7.29},
{-1796.49,-94.14,8.57},
{-1799.10,16.82,16.09},
{-1806.28,131.96,16.10},
{-1803.30,238.66,16.09},
{-1715.29,333.94,8.16},
{-1616.82,431.44,8.17},
{-1554.71,593.97,8.21},
{-1536.40,...
3. Nie działają mi autobusy
Witam mam problem ot??, mam napisany skrypt na autobusy lecz nie dziala a dokladniej gdy wjade w punkt to nie dostaje ani hajsu ani nie znika ten punkt pom?g?by kto? oto kody:
[b][color=red]bus.lua[/color][/b]
[code]createBlip(1742.97, -1861.93, 13.58,46,2,255,0,0,255,0,100)

local m1 = createMarker(1742.97, -1861.93, 13.58-1, "cylinder", 1.2, 0,200,0,150)
local t = createElement('text')
setElementPosition(t,1742.97, -1861.93, 13.58)
setElementData(t,"name","Praca: Kierowca MZKnZarobki:nZwyk?y Gracz od 2750PLN do 2650PLN n Premium: x1.3 Wi?cej.")
local vehs = {}

local code = "Autobusy"
local zone = createColSphere( 1732.85, -1857.30, 13.54, 6 )
addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "vehicle_job_owner") then
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
if getElementData(el,"player:job") then return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("[#00ff00INFORMACJA#ffffff]Kto? ju? zajmuje to miejsce, poczekaj a? odjedzie.",el,255,255,255,true) return end
local x,y,z = getElementPosition(el)
local autbus = createVehicle(431, 1732.85, -1857.30, 13.54, 0.00, 0, 270 )
setElementFrozen(el,true)
setElementData(autbus,"vehicle:desc","Miejski Zarz?dnKomunikacji")
setEleme...
4. Praca autobusy
Witam mam problem z praca kierowca autobusu poniewasz mam jeden przestanek i po nim bym chcial zeby po tym przestanku praca sie konczyla i pisalo "zakonczyles prace" i zeby potym jednym przestanku odrazu sie dostawalo kase a nie dopiero po wyjsciu z busa i zebym mugl sam ustawic ile ma dawac graczowi kasy.
co dopisac do skryptu i gdzie ?

Piwko napewno poleci ;)


local rootElement = getRootElement()
local busses = {[431] = true, [437] = true}
local busTable = {
[1]={-1990.33325, 138.666671, 26.948751},
}

createBlip(1256.6, -1812.2, 13.41, 55, 3, 0, 0, 255, 255, 0, 250)

function getNewBusLocation(thePlayer, ID)
local x, y, z = busTable[ID][1], busTable[ID][2], busTable[ID][3]
triggerClientEvent(thePlayer,"bus_set_location",thePlayer,x,y,z)
end

function busJob(thePlayer)
local theVehicle = getPedOccupiedVehicle (thePlayer)
local id = getElementModel(theVehicle)
if id == 431 or id == 437 then
local x, y, z = getNewBusLocation(thePlayer, 1)
setElementData(thePlayer,"buszp",0)
setElementData(thePlayer,"busData",1)
else
end
end
addEventHandler("onVehicleEnter",rootElement,busJob)

function busStart(thePlayer)
local theVehicle = getPedOccupiedVehicle (thePlayer)
local id = getElementModel(theVehicle)
if id == 431 or id == 437 then
outputChatBox("Zacz??e? prac? busiarza!", thePlayer, 255, 255, 0)
end
end
addEventHandler("onVehicleEnter",rootElement,busStart...