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: 3862 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.8312750setElementDimension (pickup200)

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 elementid ) 
            setAccountData getPlayerAccount element ), "stary:skin"false )
            takeWeapon element42 )
            removeElementData(element,"Praca")  
        else
            skin tonumber getElementModel element ) )
            setAccountData getPlayerAccount element ), "stary:skin"skin )
            setElementModel element277  )
            local nazwa "FDSA"
            local r,g,2452020
            setElementData(element,"Praca",nazwa)
            setElementData(element,"Praca:r",r) 
            setElementData(element,"Praca:g",g)     
            setElementData(element,"Praca:b",b) 
            giveWeapon element,425000000)
end
    end
    end)--FDSA!!!
    
    
--wejscie

wejscie createMarker (-2664.96265639.8587014.99313"arrow"1.22552550)
wyjscie createMarker (-2670.73877680.4108914.25563"arrow"1.22552550)
setElementDimension(wyjscie200)

addEventHandler("onMarkerHit"wejscie, function(elmd)
    if isPedInVehicle(elthen return end
    setElementDimension(el200)
    setElementPosition(el, -2667.69702681.1079113.11563)
end)

addEventHandler("onMarkerHit"wyjscie, function(elmd)
    if isPedInVehicle(elthen return end
    setElementDimension(el0)
    setElementPosition(el, -2665.26245636.0293614.65313)
end)



local pojazdyPubliczne = {
    {40724.29,-1519,2507.790.000},
    {48224.2,-1518.9,2514.290.000},    
    {41624.29,-1518.09,25210.000},
    {54423.79,-1519.29,2527.50.000},
    {55223.79,-1519.9,2533.50.000},
    {55123.7,-1534.7,2533.70.00180},
    {49024,-1534.59,2527.90.00180},
    {40724,-1535.29,2513.790.00180},
    {40724.1,-1535.5,25080.00180},
}

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(pojazdtrue)
    setElementData(pojazd"pojazd_paliwo"100)
end


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

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

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


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: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

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,zrx,ry,rznumberplatedirectionvariant1variant2id)
if model and and and and rx and ry and rz then
local PSP createVehicle(model,x,y,zrx,ry,rznumberplatedirectionvariant1variant2id)
local rejka getVehiclePlateText PSP )
addVehicleUpgrade (PSP1025 )
setVehicleHandlingPSP"driveType""awd")
setVehicleHandlingPSP"maxVelocity"100) -- maksymalna pr?dko?? 
setVehicleHandlingPSP"engineAcceleration"12.0 )
setElementData PSP"car_id"9981)
setElementData PSP"fuel"100)
setElementData PSP"pojazd_opis""" .. rejka .. " \n GCBA" ) -- w tym przypadku GCBAmo?esz zmieni?
setElementData PSP"frakcja""PSP" )
removeVehicleSirens(PSP)
addVehicleSirens(PSP62truetruetruetrue)
setVehicleSirens(PSP1, -0.73.31.525500255255)
setVehicleSirens(PSP20.63.31.525500255255)
setVehicleSirens(PSP3, -0.7, -3.21.5096.9234.6255255)
setVehicleSirens(PSP40.6, -3.21.5091.8229.5255255)
setVehicleSirens PSP50.980, -3.6170.24425500255255 )
setVehicleSirens PSP6, -0.970, -3.5610.295096.9234.6255255 )
end
end

function PSP2 ()
PSP1(idxyzrxryrz"opis"false00)
addEventHandler('onResourceStart',getResourceRootElement(getThisResource()),PSP2)


Postaw piwo autorowi tego posta
 

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


Prezes.







Wiek: 27
Na forum: 4371 dni
Posty: 75
Nick w MP: Prezes.

Piwa: 17

Respekt: 60


local pojazdyPubliczne = {
    {40724.29,-1519,2507.790.000},
    {48224.2,-1518.9,2514.290.000},    
    {41624.29,-1518.09,25210.000},
    {54423.79,-1519.29,2527.50.000},
    {55223.79,-1519.9,2533.50.000},
    {55123.7,-1534.7,2533.70.00180},
    {49024,-1534.59,2527.90.00180},
    {40724,-1535.29,2513.790.00180},
    {40724.1,-1535.5,25080.00180},
}

for i,v in ipairs(pojazdyPubliczne) do
    v.pojazd createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
    setElementDatav.pojazd"pojazd_opis""FDSA #"..i.."")
    setElementFrozenv.pojazdtrue)
    setElementDatav.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