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: kierowcy
1. wykrycie kierowcy
Witajcie bawi? si? w tworzenie systemu naprawy i napotka?em problem z wykryciem kierowcy podpowiem, ?e chc? by wykry?o, ?e kierowca jest w cuboidzie


addEventHandler
("onClientMarkerHit", resourceRoot, function(el,md)
    if 
not md or el~=localPlayer then return end
   local cs
=getElementData(source, "snn_cs")
    if 
not cs then return end
    vehicles
=getElementsWithinColShape(cs,"vehicle")
    
vehicles2=getElementsWithinColShape(cs,"player")
    
driver=getVehicleController(vehicles2)
     if 
#vehicles < 1 then
        
triggerEvent('onClientAddNotification', localPlayer, 'Na stanowisku naprawczym nie znajduje si?npojazd', 'error')
        return
    
end
    
if #vehicles > 1 then
        
triggerEvent('onClientAddNotification', localPlayer, 'Na stanowisku naprawczym znajduje si?nzbyt du?a ilo?? pojazd?w', 'error')
        return
    
end
    
if not driver then triggerEvent('onClientAddNotification', localPlayer, 'Brak kierowcy', 'error')
        return
    
end


Marker b?dzie u?ywa?a osoba trzecia nie osoba kt?ra sied? w aucie.
2. Pasażer zabiera HP kierowcy
Co zrobi? gdy pasa?er robi?c driveby zabiera hp kierowcy? Chodzi mi o to ?eby wszyscy siedz?cy w jednym aucie nie mogli zabiera? sobie HP
3. Rozwalanie auta bez kierowcy
Witam mam skrypt na to ,?e jak nikogo nie ma w poj?dzie auto si? nie rozwala
i co? mi nie dzia??

local 
function pojazdPusty(veh)
if 
not veh then return end
    local occupants 
= getVehicleOccupants(veh)
    
local seats = getVehicleMaxPassengers(veh)
    if (
not seats) then return true end
    
for i=0,seats do
    
local occupant = occupants[seat]
    if 
occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") and getPedOccupiedVehicleSeat(occupant) == i then
        
return false
    end
    end
    
return true
end


for i,v in ipairs(getElementsByType("vehicle")) do
    if (
pojazdPusty(v)) then
        setVehicleDamageProof
(v,true)
    else
    if 
getElementData(v,"damageproof") then setVehicleDamageProof(v, true) return end
    setVehicleDamageProof
(v,false)
    
end
end

addEventHandler 
( "onVehicleEnter", root, function()
if 
source then
    
if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
    setVehicleDamageProof
(source, false)
    
end
end
)

addEventHandler ( "onVehicleExit", root, function()
    if 
source then
    
if (pojazdPusty(source)) then
        setVehicleDamageProof
(source, true)
    else
        if 
getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
        setVehicleDamageProof
(source, false)
    
end
    end
end
)
4. Praca kierowcy autobusu
Witam chcia?bym edytowa? prac? kierowcy autobusu, aby po wyj?ciu z autobusu nie trzeba by?o robi? reconnecta, aby zn?w si? w tej pracy zatrudni?.

Link do skrptu: http://www59.zippyshare.com/v/98O1SFoi/file.html

PS: Nie chc? gotowej pracy tylko linijke kt?r? usun??/doda?. Z g?ry dzi?ki.[/code]
5. Bind dla kierowcy
Witam. Tak jak w temacie. Przypomnicie mi jak si? robi?o aby danego binda m?g? u?y? kierowca?

Jak komu? si? chce to mo?e mi zrobi? :P


addEventHandler
("onPlayerVehicleEnter", root, function(pojazd)
    if 
auta[getElementModel(pojazd)] then
    bindKey
(source, "1", "down", dzwiek, source)
    
end
end
)

6. Praca kierowcy tira
Witam, mam pytanie odno?nie pracy.
Mam prac?, kt?ra dzia?a:

jest marker, wchodz? w niego to mnie teleportuje do tira. Podczepiam naczep? i jad? do celu. W lokalizacji docelowej jest drugi marker kt?ry niszczy mi tira i naczep? oraz daje kas?.

Problem polega na tym, ?e marker pocz?tkowy si? nie odnawia.
Blip owszem, pojawia si? na mapie w lokalizacji pocz?tkowej. Ale nie ma ju? tam markera...

Skrypt jest ca?kowicie po stronie servera.

Ca?y skrypt posiadam z community, bo stwierdzi?em, ?e na gotowych b?dzie mi si? ?atwiej uczy?(ostatnim razem jak pisa?em od zera skrypt, to nie do ko?ca dzia?a? na hostowanym servie. Ale to inny temat).

[lua]--// Made by: MoPoMaN

--//Tables and other stuff
tableLocationsX = {}
tableLocationsY = {}
tableLocationsZ = {}

tableMoney = {}
locationCount = 4

--//Location 1
tableLocationsX[1] = 2253.7
tableLocationsY[1] = -84.0
tableLocationsZ[1] = 25.3

tableMoney[1] = 500

--//Location 2
tableLocationsX[2] = 1093.7
tableLocationsY[2] = -931.6
tableLocationsZ[2] = 41.9

tableMoney[2] = 550

--//Location3
tableLocationsX[3] = -47.3
tableLocationsY[3] = -1137.5
tableLocationsZ[3] = 0.07

tableMoney[3] = 500

--//Location4
tableLocationsX[4] = 1198
tableLocationsY[4] = -1828
tableLocationsZ[4] = 12.3

tableMoney[4] = 350

function startScript ()
--Marker
marker = createMarker (2177, -2258, 13.7, "cylinder", 1.1, 255, 90, 0, 255)
addEventHandler ("onMarkerHit", marker, star...
7. [GF] Uszkodzenia pojazdów bez kierowcy
Witajcie
Czy istnieje jaki? spos?b w SA-MPie na odblokowanie mo?liwo?ci uszkadzania nieu?ywanych pojazd?w? Chodzi mi tu g??wnie o doczepiane naczepy, kt?re zawsze maj? poziom "zdrowia" na poziomie 1000.0.
8. Bindy dla kierowcy
Witajcie.

Jak zrobi? w tym kodzie ?eby tych guzik?w m?g? u?y? tylko kierowca ?


vehicleEngine 
= { false } 
 
vehicleLights = { false } 
 function 
Script_onPlayerJoin( ) 
 
bindKey ( source,"k", "down", Engine ) 
 
bindKey ( source, "l", "down", Lights ) 
 
end 
 addEventHandler 
( "onPlayerJoin", getRootElement(), Script_onPlayerJoin) 
 function 
Script_onVehicleEnter( thePlayer, seat ) 
 if 
seat == 0 then 
 
if not getVehicleEngineState( source ) then 
 vehicleEngine
[ source ]=false 
 setVehicleEngineState 
( source, false ) 
 else 
 
vehicleEngine[ source ]=true 
 setVehicleEngineState 
( source, true ) 
 
end 
 
if vehicleLights[ source ] then 
 vehicleLights
[ source ]=true 
 setVehicleOverrideLights 
( car, 2 ) 
 else 
 
vehicleLights[ source ]=false 
 setVehicleOverrideLights 
( car, 1 ) 
 
end 
 end 
 end 
 addEventHandler 
( "onVehicleEnter", getRootElement(), Script_onVehicleEnter ) 


Pozdrawiam :)
9. Praca kierowcy autobusu
Witajcie.

Mam system na prac? w taxi i tam boty si? pojawiaj? w jaki? tam miejscach, a jak zrobi? w systemie pracy kierowcy autobusu ?eby boty wszystkie by?y wy?wietlone ?

Oto kod z tych bot?w [chyba] :

[lua]
function startJob ( thePlayer )
local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] )
markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 )
mposi = { getElementPosition( markers [ thePlayer ] ) }
local skins = unpack ( pedCus [ math.random ( #pedCus ) ] )
peds [ thePlayer ] = createPed( skins, x, y, z )
blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 )
addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit )
end

function inVEH ( thePlayer )
if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then
if ( getElementModel ( source ) == 431 ) then
startJob ( thePlayer )
end
end
end
addEventHandler ( "onVehicleEnter", getRootElement(), inVEH )

function warpit ( thePlayer )
if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then
local vehiclee = getPedOccupiedVehicle ( thePlayer )
if ( getElementModel ( vehiclee ) == 431 ) then
setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 )
destroyJob ( thePlayer )
local x, y, z = unpack ( dropoffss ...