Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-05-28, 19:49


dawid1990

Człowiek nierozumny.






Wiek: 23
Na forum: 4003 dni
Posty: 14
Nick w MP: ZSW

Piwa: 40

Respekt: 60

wiec tak. Mam problem z pojazdami Frakcyjnymi bo nie chc? si? pojawi? jak by kto? umia? to prosze o odpowiedz

Kod:

pickup = createPickup ( 23.5,-1538.09,2521.8, 3, 1275, 0, 0 ) 
setElementDimension (pickup, 200)

addEventHandler ( "onPickupHit", pickup, function(element)
    if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( element ) ), aclGetGroup ( "Pogotowie" ) ) then
        if getAccountData ( getPlayerAccount ( element ), "stary:skin" ) then
            id = tonumber ( getAccountData ( getPlayerAccount ( element ), "stary:skin" ) )
            setElementModel ( element, id ) 
            setAccountData ( getPlayerAccount ( element ), "stary:skin", false )
            takeWeapon ( element, 42 )
            removeElementData(element,"Praca")  
        else
            skin = tonumber ( getElementModel ( element ) )
            setAccountData ( getPlayerAccount ( element ), "stary:skin", skin )
            setElementModel ( element, 277  )
            local nazwa = "FDSA"
            local r,g,b = 245, 20, 20
            setElementData(element,"Praca",nazwa)
            setElementData(element,"Praca:r",r) 
            setElementData(element,"Praca:g",g)     
            setElementData(element,"Praca:b",b) 
            giveWeapon ( element,42, 5000000)
end
    end
    end)--FDSA!!!
    
    
--wejscie

wejscie = createMarker (-2664.96265, 639.85870, 14.99313, "arrow", 1.2, 255, 255, 0)
wyjscie = createMarker (-2670.73877, 680.41089, 14.25563, "arrow", 1.2, 255, 255, 0)
setElementDimension(wyjscie, 200)

addEventHandler("onMarkerHit", wejscie, function(el, md)
    if isPedInVehicle(el) then return end
    setElementDimension(el, 200)
    setElementPosition(el, -2667.69702, 681.10791, 13.11563)
end)

addEventHandler("onMarkerHit", wyjscie, function(el, md)
    if isPedInVehicle(el) then return end
    setElementDimension(el, 0)
    setElementPosition(el, -2665.26245, 636.02936, 14.65313)
end)



local pojazdyPubliczne = {
    {407, 24.29,-1519,2507.79, 0.0, 0, 0},
    {482, 24.2,-1518.9,2514.29, 0.0, 0, 0},    
    {416, 24.29,-1518.09,2521, 0.0, 0, 0},
    {544, 23.79,-1519.29,2527.5, 0.0, 0, 0},
    {552, 23.79,-1519.9,2533.5, 0.0, 0, 0},
    {551, 23.7,-1534.7,2533.7, 0.0, 0, 180},
    {490, 24,-1534.59,2527.9, 0.0, 0, 180},
    {407, 24,-1535.29,2513.79, 0.0, 0, 180},
    {407, 24.1,-1535.5,2508, 0.0, 0, 180},
}

for i,v in ipairs(pojazdyPubliczne) do
    local pojazd = createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
    setElementData(pojazd, "pojazd_opis", "FDSA #"..i.."")
    setElementFrozen(pojazd, true)
    setElementData(pojazd, "pojazd_paliwo", 100)
end


addEventHandler("onVehicleStartEnter", resourceRoot, function(plr,seat)
if seat == 0 then
local accountName=getAccountName(getPlayerAccount(plr))
if isObjectInACLGroup("user."..accountName, aclGetGroup("FDSA")) then return end
outputChatBox("* Nie jeste? pracownikiem Fire Department of San Andreas.", plr, 255, 0, 0)
cancelEvent()
return
end
end)

addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
    if seat == 0 then
        setElementFrozen(source, false)
        setElementData(source, "pojazd_paliwo", 100)
    end
end)

function respawnVehicles()
    for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
        if not getVehicleOccupant(v) then
            respawnVehicle(v)
            setElementFrozen(v, true)
            setElementData(v, "pojazd_opis", "FDSA #"..i.."")
            setElementData(v, "pojazd_paliwo", 100)
        end
    end
end
setTimer(respawnVehicles, 300000000, 0)


Stosuj znaczniki lua/code //Emm

Ostatnio zmieniony przez Emm 2016-05-28, 21:19, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-28, 20:04


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

Stosuj znaczniki: [.lua] [./lua] (bez kropki)

Ja bym proponowa? co? takiego: (masz odrazu opis pojazdu, je?eli masz vopis)


function PSP1(model,x,y,z, rx,ry,rz, numberplate, direction, variant1, variant2, id)
if model and x and y and z and rx and ry and rz then
local PSP = createVehicle(model,x,y,z, rx,ry,rz, numberplate, direction, variant1, variant2, id)
local rejka = getVehiclePlateText ( PSP )
addVehicleUpgrade (PSP, 1025 )
setVehicleHandling( PSP, "driveType", "awd")
setVehicleHandling( PSP, "maxVelocity", 100) -- maksymalna pr?dko?? 
setVehicleHandling( PSP, "engineAcceleration", 12.0 )
setElementData ( PSP, "car_id", 9981)
setElementData ( PSP, "fuel", 100)
setElementData ( PSP, "pojazd_opis", "" .. rejka .. " \n GCBA" ) -- w tym przypadku GCBA, mo?esz zmieni?
setElementData ( PSP, "frakcja", "PSP" )
removeVehicleSirens(PSP)
addVehicleSirens(PSP, 6, 2, true, true, true, true)
setVehicleSirens(PSP, 1, -0.7, 3.3, 1.5, 255, 0, 0, 255, 255)
setVehicleSirens(PSP, 2, 0.6, 3.3, 1.5, 255, 0, 0, 255, 255)
setVehicleSirens(PSP, 3, -0.7, -3.2, 1.5, 0, 96.9, 234.6, 255, 255)
setVehicleSirens(PSP, 4, 0.6, -3.2, 1.5, 0, 91.8, 229.5, 255, 255)
setVehicleSirens ( PSP, 5, 0.980, -3.617, 0.244, 255, 0, 0, 255, 255 )
setVehicleSirens ( PSP, 6, -0.970, -3.561, 0.295, 0, 96.9, 234.6, 255, 255 )
end
end

function PSP2 ()
PSP1(id, x, y, z, rx, ry, rz, "opis", false, 0, 0)
addEventHandler('onResourceStart',getResourceRootElement(getThisResource()),PSP2)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-28, 23:28


Prezes.







Wiek: 28
Na forum: 4511 dni
Posty: 75
Nick w MP: Prezes.

Piwa: 17

Respekt: 60


local pojazdyPubliczne = {
    {407, 24.29,-1519,2507.79, 0.0, 0, 0},
    {482, 24.2,-1518.9,2514.29, 0.0, 0, 0},    
    {416, 24.29,-1518.09,2521, 0.0, 0, 0},
    {544, 23.79,-1519.29,2527.5, 0.0, 0, 0},
    {552, 23.79,-1519.9,2533.5, 0.0, 0, 0},
    {551, 23.7,-1534.7,2533.7, 0.0, 0, 180},
    {490, 24,-1534.59,2527.9, 0.0, 0, 180},
    {407, 24,-1535.29,2513.79, 0.0, 0, 180},
    {407, 24.1,-1535.5,2508, 0.0, 0, 180},
}

for i,v in ipairs(pojazdyPubliczne) do
    v.pojazd = createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
    setElementData( v.pojazd, "pojazd_opis", "FDSA #"..i.."")
    setElementFrozen( v.pojazd, true)
    setElementData( v.pojazd, "pojazd_paliwo", 100)
end


Postaw piwo autorowi tego posta
 

 
Tagi: skrypt :: pojazdy :: frakcyjne
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Skrypt na Pojazdy Frakcyjne Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku