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

Wysłany: 2015-06-01, 17:02


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Siemka, kiedy? jaki? u?ytkownik pojazdu mia? problem z prywatnymi pojazdami. Mam teraz problem, poniewa? wyskakuje mi DB, te? dam kod

function enterVehicle sourceseatjacked )
    local playercar getPedOccupiedVehicle source )
    if(seat == 0then
        if (getElementData playercar"owner" )) then
               if(getElementData playercar"owner" ) ~= "Nobody" then
                   if(getElementData playercar"owner" ) == getAccountName(getPlayerAccount(source))) then
                       outputChatBox ("To twoj pojazd!",source255,255,127 )
                else
                    outputChatBox ("Ten pojazd jest wlasnoscia: "..getElementData playercar"owner" ).."",source255,255,127 )
                end
            else
                local price getElementData playercar"price" )
                triggerClientEvent source"showBuyCar"sourceprice)
                toggleAllControls sourcefalsetruefalse )
                return true
            end
        end
    end
end

addEventHandler "onVehicleEnter"getRootElement(), enterVehicle )

function AcceptToBuyCar ( )
    local playercar getPedOccupiedVehicle source )
    if(getElementData playercar"owner" ) == "Nobody"then
        if(getPlayerMoney source ) > tonumber(getElementData playercar"price"))) then
               setElementData playercar"owner"getAccountName(getPlayerAccount(source))))
            takePlayerMoney sourcetonumber(getElementData playercar"price" )))
            toggleAllControls sourcetrue )
            outputChatBox ("Gratulujemy zakupu nowego pojazdu!"source243,149,72 )
            destroyElement(buycarpickup[getElementData(playercar,"num")])
            saveCars ()
        else
            outputChatBox ("Brak funduszy!"source243,149,72 )
            setControlState source"enter_exit"true )
        end
    end
end
addEvent("acceptBuyCar",true)
addEventHandler("acceptBuyCar",root,AcceptToBuyCar)

function playerCarLock sourcecmd)
    for i,v in ipairs (cars) do
        if(getElementData cars[i:1], "owner" ) == getAccountName(getPlayerAccount(source))) then
               setVehicleLocked cars[i:2], true )
            setElementData (cars[i:3],"lock"1)
            outputChatBox ("Zamknieto twoj pojazd!",source243,149,72 )
              saveCars()
        end
    end
end

addCommandHandler ("zamknij",playerCarLock)


function playerCarUnLock sourcecmd)
    for i,v in ipairs (cars) do
        if(getElementData cars[i:4], "owner" ) == getAccountName(getPlayerAccount(source))) then
               setVehicleLocked cars[i:5], false )
            setElementData (cars[i:6],"lock"0)
            outputChatBox ("Otwarto twoj pojazd!",source243,149,72 )
              saveCars()
        end
    end
end

addCommandHandler ("otworz",playerCarUnLock)




My?l?, ?e pomo?ecie.

Ja tak my?l?, ?e brakuje ) lub za du?o gdzie? jest )

[ Dodano: 2015-06-01, 17:09 ]
Dobra z ten DB pozby?em si? go, by?o o 1 ) za du?o w 133 linijce ;D ale teraz mam kolejnego...

         if(getElementData cars[i:1], "owner" ) == getAccountName(getPlayerAccount(source))) then 

chodzi o t? linijk? 150.
Prosz? o pomoc ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-01, 17:37


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

cars[i:1]


Co to jest?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-01, 19:03


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Shuffle, ju? zobaczy?em powinno by?
 cars[i

Temat do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-01, 20:07


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

[clo]

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Tagi: kod :: pojazdy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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